home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / eupm2_24.zip / Install.cmi < prev    next >
Text File  |  1999-09-19  |  6KB  |  180 lines

  1. /* Installationsdatei für EuraPM2 */
  2. /* Demo-Version  */
  3. /* Paketversion 0.24 */
  4.  
  5. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' 
  6. call SysLoadFuncs
  7. call RxFuncAdd 'ErxLoadFuncs', 'EClient', 'ErxLoadFuncs' 
  8. call ErxLoadFuncs
  9.  
  10. parse arg Run hwnd Lkz New
  11.  
  12. say 'Install Version 0.24' Run
  13.  
  14. /* Listbox füllen */
  15. if Run=='Start' then
  16. do 
  17.    call IrxSetTitle hwnd, "EuraPM2 - Installation - Paket 0.24"
  18. /*   say 'LKZ = 'lkz New    */
  19.    if Lkz==49 then
  20.    do 
  21.       call IrxAddTable hwnd, "Vorwahlen",  0, 'm'
  22.       call IrxAddTable hwnd, "Rufnummern", 1, 'm'
  23.       if New==1 then
  24.          call IrxAddTable hwnd, "Provider",  13, 'm'
  25.       else
  26.          call IrxAddTable hwnd, "Provider",  13, 'n'
  27.       call IrxAddTable hwnd, "Tarife",    15, 'm'
  28.       if New==1 then
  29.          call IrxAddTable hwnd, "Zonen",     16, 'm'
  30.       else
  31.          call IrxAddTable hwnd, "Zonen",     16, 'n'
  32.       call IrxAddTable hwnd, "Feiertage",  17, 'm'
  33.    end /* do */
  34.    else
  35.    do 
  36.       /* OK, ist ja eigentlich doppelt */
  37.       call IrxAddTable hwnd, "Vorwahlen",  0, 'm'
  38.       call IrxAddTable hwnd, "Rufnummern", 1, 'm'
  39.       call IrxAddTable hwnd, "Provider",  13, 'n'
  40.       call IrxAddTable hwnd, "Tarife",    15, 'n'
  41.       call IrxAddTable hwnd, "Zonen",     16, 'n'
  42.       call IrxAddTable hwnd, "Feiertage",  17, 'n'
  43.    end /* do */
  44.    exit 0
  45. end /* do */
  46.  
  47. /* Installation starten */
  48. if Run=='Install' then
  49. do 
  50.    parse arg Run this Backup Lkz WPS
  51.    if Backup==1 then 
  52.    do 
  53.       rc = IrxBackUp( this )
  54.       if rc>0 then exit rc    /* Backup fehlgeschlagen */
  55.    end /* do */
  56.     
  57.    rc = CopyFile( this, "file_id.diz" )
  58.    rc = CopyFile( this, "Doku.INF" );
  59.    rc = CopyFile( this, "De_Inst.cmd" );
  60.    rc = CopyFile( this, "Install.cmi" );
  61.    rc = CopyFile( this, "quit.cmd" );
  62.    rc = CopyFile( this, "Konfig.exe" );
  63.    rc = CopyFile( this, "Konfig.hlp" );
  64.    rc = CopyFile( this, "Install.exe" );
  65.    rc = CopyFile( this, "Gebühr.exe" );
  66.    rc = CopyFile( this, "TBuch.exe" );
  67.    rc = CopyFile( this, "Monitor.exe" );
  68.    rc = CopyFile( this, "EServer.cfg", , 'q' );
  69.    rc = CopyFile( this, "LCR.exe" );
  70.    rc = CopyFile( this, "Easy.lcr", ,'n' );
  71.    rc = CopyFile( this, "Full.lcr", ,'n' );
  72.    rc = CopyFile( this, "EServer.exe" );
  73.    rc = CopyFile( this, "CaLib.Dll" );
  74.    rc = CopyFile( this, "EClient.dll" );
  75.    rc = CopyFile( this, "CaTable.dll" );
  76.    rc = CopyFile( this, "CaTable.exe" );
  77.    rc = CopyFile( this, "toolbox.ico" );
  78.    rc = CopyFile( this, "toolbox1.ico" );
  79.    rc = CopyFile( this, "QueryDB.cmd", ,'n' );
  80.    rc = CopyFile( this, "PrintTax.cmd", , 'n' );
  81.    rc = CopyFile( this, "Vorwahl.dat" );
  82.  
  83.    if Lkz==49 then 
  84.    do 
  85.       rc = CopyTable( this, 0, "Vorw49", "Vorwahlen", "Vorwahl" )
  86.       rc = CopyTable( this, 1, "RufN49", "Rufnummern", "RufNum" )
  87.       rc = CopyTable( this, 13, "Provider" );
  88.       rc = CopyTable( this, 15, "Tarife" );
  89.       rc = CopyTable( this, 16, "Zonen" )
  90.       rc = CopyTable( this, 17, "Feiertag", "Feiertage", "Feiertag" )
  91.    end /* do */
  92.    else
  93.    do 
  94.       rc = CopyTable( this, 0, "VorwXX", "Vorwahlen", "Vorwahl" )
  95.       rc = CopyTable( this, 1, "RufNXX", "Rufnummern", "RufNum" )
  96.       /* Provider, Tarife, Zonen und Feiertage für Ausland sind nicht vorhanden */
  97.    end /* do */
  98.    exit 0
  99. end /* do */
  100.  
  101. if Run=='WPS' then
  102. do 
  103.    parse arg Run this Path
  104.    say 'erzeuge Ordner'
  105.    rc = SysCreateObject( 'WPFolder', "EuraPM2", "<WP_DESKTOP>", "OBJECTID=<WP_EURAPM2FOLDER>;ICONFILE="Path"\toolbox1.ico;ICONNFILE=1,"Path"\toolbox.ico;ALWAYSSORT=YES;", "update" );
  106.    if rc==0 then
  107.    do 
  108.       say 'Ordner konnte nicht erzeugt werden'
  109.       exit 1000;
  110.    end /* do */
  111.    else 
  112.    do 
  113.       call MakeProgram Path, "Konfig",         "WP_EURAPM2KONFIG",  "Konfig.exe"
  114.       call MakeProgram Path, "Gebühr",         "WP_EURAPM2TAXES",   "Gebühr.exe"
  115.       call MakeProgram Path, "Quit Server",    "WP_EURAPM2QUIT",    "QUIT.cmd"
  116.       call MakeProgram Path, "Monitor",        "WP_EURAPM2MONITOR", "Monitor.exe"
  117.       call MakeProgram Path, "Telefonbuch",    "WP_EURAPM2TBUCH",   "TBuch.exe"
  118.       call MakeProgram Path, "LCR",            "WP_EURAPM2LCR",     "LCR.exe"
  119.       call MakeProgram Path, "Setup",          "WP_EURAPM2SETUP",   "Install.exe"
  120.       call MakeShadow  Path, "WP_EURAPM2CFG",  "EServer.cfg"
  121.       call MakeShadow  Path, "WP_EURAPM2PRINTTAX",  "PrintTax.cmd"
  122.       rc = SysCreateObject( "WPProgram", 'Doku', "<WP_EURAPM2FOLDER>", "OBJECTID=<WP_EURAPM2DOKU>;EXENAME=VIEW.EXE;PARAMETERS="Path"\Doku.INF", 'update' );
  123.       if rc==0 then
  124.          say 'Objekt Doku konnte nicht erzeugt werden'
  125.  
  126.    end /* do */
  127. end /* do */
  128.  
  129. exit 0
  130.  
  131. MakeProgram:
  132. procedure 
  133. parse arg Path, Title, id, exe
  134. Path = translate( Path )
  135. exe = translate( exe )
  136. Param = "OBJECTID=<"id">;EXENAME="Path"\"exe";STARTUPDIR="Path
  137. say 'erzeuge Programmobjekt' Title /* Param */
  138. rc = SysCreateObject( "WPProgram", Title, "<WP_EURAPM2FOLDER>", Param, 'U' );
  139. if rc==0 then
  140.    say 'Objekt 'Title' konnte nicht erzeugt werden'
  141. return 0
  142.  
  143. MakeShadow:
  144. procedure 
  145. parse arg Path, id, File
  146. Param = "OBJECTID=<"id">;SHADOWID="Path"\"File
  147. say 'erzeuge Referenz' File /* Param */
  148. rc = SysCreateObject( "WPShadow", '.', "<WP_EURAPM2FOLDER>", Param, 'U' );
  149. if rc==0 then
  150.    say 'Objekt 'Title' konnte nicht erzeugt werden'
  151. return 0
  152.  
  153. CopyFile:
  154. procedure 
  155. parse arg this, Src, Dest, Opt
  156. rc = IrxCopyFile( this, Src, Dest, Opt )
  157. if rc>0 then 
  158. do 
  159.    say 'IrxCopyFile = 'rc 
  160.    if rc!=27 then
  161.       say ErxGetErrorText( rc )
  162.    exit rc
  163. end /* do */
  164. return 0
  165.  
  166. CopyTable:
  167. procedure
  168. parse arg this, Typ, Src, Dest, Alt
  169. rc = IrxCopyTable( this, Typ, Src, Dest, Alt )
  170. if rc>0 then 
  171. do 
  172.    say 'IrxCopyTable = 'rc
  173.    if rc!=27 then
  174.       say ErxGetErrorText( rc )
  175.    exit rc
  176. end /* do */
  177. return 0
  178.  
  179.  
  180.