home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / omnidemo.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-07-01  |  8KB  |  189 lines

  1. /* REXX PROGRAM */
  2. /* OMNIFILE DEMO INSTALLATION PROGRAM */
  3. SAY "INSTALLATION PROGRAM FOR OMNIFILE DEMO"
  4. SAY ""
  5. /* You may optionally specify the destination path for the program as an argument. */
  6. /* If you do not specify the destination path you will be prompted to enter a path. */
  7. PARSE SOURCE os processor cmd
  8. srcdrive = FILESPEC("drive",cmd)
  9. srcpath = FILESPEC("path",cmd)
  10. src = srcdrive||srcpath
  11. minHardDiskSize = 2800000
  12.  
  13. arg destpath
  14. "@echo off"
  15.  
  16. call RxFuncAdd 'SysMkDir', 'RexxUtil', 'SysMkDir'
  17. call RxFuncAdd 'SysDriveInfo', 'RexxUtil', 'SysDriveInfo'
  18. driveInfo = SysDriveInfo(srcdrive)
  19. driveSize = SUBWORD(driveInfo, 3, 1)
  20. DO FOREVER
  21.    IF destpath = "" THEN DO
  22.        IF driveSize > minHardDiskSize THEN DO
  23.            tempsrc = STRIP(src, 'T', '\')
  24.            SAY "If you would like to run the demonstration"
  25.            SAY "from "tempsrc" without copying"
  26.            SAY "the files to a new directory simply"
  27.            SAY "press Enter without typing anything."
  28.            SAY ""
  29.            SAY "Otherwise enter the full directory path (including drive)"
  30.            SAY "where you would like the demonstration program"
  31.            SAY "to be installed."
  32.            SAY '(We suggest "C:\OMNIDEMO").'
  33.            END
  34.        ELSE DO
  35.            SAY "Enter the full directory path (including drive) where"
  36.            SAY "you would like the demonstration program installed."
  37.            SAY "If you press Enter without typing anything"
  38.            SAY 'it will be installed in the "C:\OMNIDEMO" directory.'
  39.            END
  40.        SAY "If you would like to abort this installation"
  41.        SAY "type QUIT and press Enter."
  42.        PULL destpath
  43.        IF destpath = "QUIT" THEN EXIT
  44.        IF driveSize > minHardDiskSize THEN DO
  45.            IF destpath = "" THEN LEAVE
  46.            END
  47.        ELSE DO
  48.            IF destpath = "" THEN destpath = "C:\OMNIDEMO"
  49.            END
  50.        END
  51.    rc = SysMkDir(destpath)
  52.    IF rc == 0 THEN LEAVE
  53.    SAY ""
  54.    SAY "ERROR: Unable to make the directory "destpath"."
  55.    IF rc == 3 THEN say "The path was not found."
  56.    IF rc == 5 THEN say "Either it already exists or you do not have access to the directory."
  57.    SAY "Enter a new path."
  58.    SAY ""
  59.    destpath = ""
  60.    END
  61.  
  62. DO FOREVER
  63.    SAY "Which version of OmniFile would you like to install?"
  64.    SAY "     Enter HOME, PRO, or OFFICE and press Enter."
  65.    SAY "     Home  - is for personal use,"
  66.    SAY "     Pro    - is for professional use,"
  67.    SAY "     Office - is a multi user version."
  68.    SAY "If you would like to abort this installation"
  69.    SAY "type QUIT and press Enter."
  70.    PULL version
  71.    IF version = "QUIT" THEN EXIT
  72.    IF version = "HOME" THEN LEAVE
  73.    IF version = "PRO" THEN LEAVE
  74.    IF version = "OFFICE" THEN LEAVE
  75.    SAY "Enter a valid version name."
  76.    SAY ""
  77.    END
  78. IF destpath = "" THEN DO
  79.    destpath = src
  80.    SIGNAL INSTALL_VERSION
  81.    END
  82.  
  83. /* Copy the files */
  84. SAY ""
  85. SAY "Now copying files..."
  86. /* If the source drive is not big enough to hold the entire program (i.e. a floppy) ask for disk 2. */
  87. IF driveSize <= minHardDiskSize THEN DO
  88.    src"decomp "src"Omnifile.exe "destpath"\Omnifile.exe"
  89.    src"decomp "src"Omnifile.hlp "destpath"\Omnifile.hlp"
  90.    "copy "src"*.cmd "destpath"/v"
  91.    "copy "src"*.txt "destpath"/v"
  92.    src"decomp "src"cicodu0.dll "destpath"\cicodu0.dll"
  93.    src"decomp "src"cicodw01.dll "destpath"\cicodw01.dll"
  94.    src"decomp "src"cicoda01.dll "destpath"\cicoda01.dll"
  95.    src"decomp "src"cicodr01.dll "destpath"\cicodr01.dll"
  96.    "md "destpath"\ICONS.OS2 2>nul"
  97.    "copy "src"ICONS.OS2\*.* "destpath"\ICONS.OS2/v"
  98.    "md "destpath"\SYSTEM.HME 2>nul"
  99.    "copy "src"SYSTEM.HME\*.* "destpath"\SYSTEM.HME/v"
  100.    "del "destpath"\SYSTEM.HME\bundled.dbv"
  101.    src"decomp "src"SYSTEM.HME\bundled.dbv "destpath"\SYSTEM.HME\bundled.dbv"
  102.    "md "destpath"\SYSTEM.PRO 2>nul"
  103.    "copy "src"SYSTEM.PRO\*.* "destpath"\SYSTEM.PRO/v"
  104.    "del "destpath"\SYSTEM.PRO\bundled.dbv"
  105.    src"decomp "src"SYSTEM.PRO\bundled.dbv "destpath"\SYSTEM.PRO\bundled.dbv"
  106.    src"decomp "src"impex2wn.ntx "destpath"\impex2wn.ntx"
  107.    src"decomp "src"impex295.ntx "destpath"\impex295.ntx"
  108.    SAY ""
  109.    SAY "Insert the disk Labeled Disk 2 and press Enter."
  110.    PULL response
  111.    SAY ""
  112.    SAY "Now copying files..."
  113.    src"decomp "src"cicodv01.dll "destpath"\cicodv01.dll"
  114.    src"decomp "src"cicodb0.dll "destpath"\cicodb0.dll"
  115.    src"decomp "src"cicodd01.dll "destpath"\cicodd01.dll"
  116.    src"decomp "src"cicodt01.dll "destpath"\cicodt01.dll"
  117.    src"decomp "src"cicodm0.dll "destpath"\cicodm0.dll"
  118.    src"decomp "src"cicodp01.dll "destpath"\cicodp01.dll"
  119.    src"decomp "src"cicodx01.dll "destpath"\cicodx01.dll"
  120.    src"decomp "src"cicodi01.dll "destpath"\cicodi01.dll"
  121.    src"decomp "src"impexpwn.gbf "destpath"\impexpwn.gbf"
  122.    src"decomp "src"impexpwn.gbt "destpath"\impexpwn.gbt"
  123.    src"decomp "src"impexpwn.ntx "destpath"\impexpwn.ntx"
  124.    src"decomp "src"impexp95.gbf "destpath"\impexp95.gbf"
  125.    src"decomp "src"impexp95.gbt "destpath"\impexp95.gbt"
  126.    src"decomp "src"impexp95.ntx "destpath"\impexp95.ntx"
  127.    "copy "src"*.rep "destpath"/v"
  128.    "erase "destpath"\install.cmd 2>nul"
  129.    END
  130. ELSE DO
  131.    "copy "src"Omnifile.exe "destpath"\Omnifile.exe"
  132.    "copy "src"Omnifile.hlp "destpath"\Omnifile.hlp"
  133.    "copy "src"*.cmd "destpath"/v"
  134.    "copy "src"*.txt "destpath"/v"
  135.    "copy "src"cicodu0.dll "destpath"\cicodu0.dll"
  136.    "copy "src"cicodw01.dll "destpath"\cicodw01.dll"
  137.    "copy "src"cicoda01.dll "destpath"\cicoda01.dll"
  138.    "copy "src"cicodr01.dll "destpath"\cicodr01.dll"
  139.    "md "destpath"\ICONS.OS2 2>nul"
  140.    "copy "src"ICONS.OS2\*.* "destpath"\ICONS.OS2/v"
  141.    "md "destpath"\SYSTEM.HME 2>nul"
  142.    "copy "src"SYSTEM.HME\*.* "destpath"\SYSTEM.HME/v"
  143.    "md "destpath"\SYSTEM.PRO 2>nul"
  144.    "copy "src"SYSTEM.PRO\*.* "destpath"\SYSTEM.PRO/v"
  145.    "copy "src"impex2wn.ntx "destpath"\impex2wn.ntx"
  146.    "copy "src"impex295.ntx "destpath"\impex295.ntx"
  147.    "copy "src"cicodv01.dll "destpath"\cicodv01.dll"
  148.    "copy "src"cicodb0.dll "destpath"\cicodb0.dll"
  149.    "copy "src"cicodd01.dll "destpath"\cicodd01.dll"
  150.    "copy "src"cicodt01.dll "destpath"\cicodt01.dll"
  151.    "copy "src"cicodm0.dll "destpath"\cicodm0.dll"
  152.    "copy "src"cicodp01.dll "destpath"\cicodp01.dll"
  153.    "copy "src"cicodx01.dll "destpath"\cicodx01.dll"
  154.    "copy "src"cicodi01.dll "destpath"\cicodi01.dll"
  155.    "copy "src"impexpwn.gbf "destpath"\impexpwn.gbf"
  156.    "copy "src"impexpwn.gbt "destpath"\impexpwn.gbt"
  157.    "copy "src"impexpwn.ntx "destpath"\impexpwn.ntx"
  158.    "copy "src"impexp95.gbf "destpath"\impexp95.gbf"
  159.    "copy "src"impexp95.gbt "destpath"\impexp95.gbt"
  160.    "copy "src"impexp95.ntx "destpath"\impexp95.ntx"
  161.    "copy "src"*.rep "destpath"/v"
  162.    "erase "destpath"\install.cmd 2>nul"
  163.    END
  164.  
  165. INSTALL_VERSION:
  166. "md "destpath"\SYSTEM 2>nul"
  167. IF version = HOME
  168.    THEN DO
  169.        "del "destpath"\*.db* 2>nul"
  170.        "copy "destpath"\SYSTEM.HME\*.* "destpath"\SYSTEM/v"
  171.        END
  172.    ELSE DO
  173.        "del "destpath"\*.db* 2>nul"
  174.        "copy "destpath"\SYSTEM.PRO\*.* "destpath"\SYSTEM/v"
  175.        END
  176.  
  177. /* Create the Omnifile Demo Icon. */
  178. call RxFuncAdd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
  179. if SysCreateObject('WPProgram', 'OmniFile Demo', '<WP_DESKTOP>', 'EXENAME='destpath'\Omnifile.exe;STARTUPDIR='destpath, 'replace') == 0 then SAY 'Unable to create the OmniFile Demo icon.  You should add it manually after the installation program finishes.'
  180.  
  181. /* Make sub directories */
  182. "md "destpath"\FILES 2>nul"
  183.  
  184. SAY ""
  185. SAY "DONE INSTALLING THE OMNIFILE DEMO."
  186. SAY "To use the program double click on the OmniFile Demo icon on your desktop."
  187. SAY ""
  188. EXIT
  189.