home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / contacts.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-02-24  |  3KB  |  99 lines

  1. /* REXX PROGRAM */
  2. /* CONTACT CONNECTION INSTALLATION PROGRAM */
  3. SAY "INSTALLATION PROGRAM FOR CONTACT CONNECTION 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 from "tempsrc
  25.             SAY "without copying the files to a new directory simply press Enter without"
  26.             SAY "typing anything.  Otherwise enter the full directory path (including drive)"
  27.             SAY "where where you would like the demonstration program to be installed."
  28.             SAY '(We suggest "C:\CCDEMO").'
  29.             END
  30.         ELSE DO
  31.             SAY "Enter the full directory path (including drive) where you would like the"
  32.             SAY "demonstration program installed.  If you press Enter without typing anything"
  33.             SAY 'it will be installed in the "C:\CCDEMO" directory.'
  34.             END
  35.         SAY "If you would like to abort this installation type QUIT and press Enter."
  36.         PULL destpath
  37.         IF destpath = "QUIT" THEN EXIT
  38.         IF driveSize > minHardDiskSize THEN DO
  39.             IF destpath = "" THEN DO
  40.                 destpath = src
  41.                 SIGNAL MAKE_ICON
  42.                 END
  43.             END
  44.         ELSE DO
  45.             IF destpath = "" THEN destpath = "C:\CCDEMO"
  46.             END
  47.         END
  48.     rc = SysMkDir(destpath)
  49.     IF rc == 0 THEN LEAVE
  50.     SAY ""
  51.     SAY "ERROR: Unable to make the directory "destpath"."
  52.     IF rc == 3 THEN say "The path was not found."
  53.     IF rc == 5 THEN say "Either it already exists or you do not have access to the directory."
  54.     SAY "Enter a new path."
  55.     SAY ""
  56.     destpath = ""
  57.     END
  58.  
  59. /* Copy the files */
  60. SAY ""
  61. SAY "Now copying files..."
  62. /* If the source drive is not big enough to hold the entire program (i.e. a floppy) ask for disk 2. */
  63. IF driveSize <= minHardDiskSize THEN DO
  64.     "copy "src"*.* "destpath"/v"
  65.     SAY ""
  66.     SAY "Insert the disk Labeled Disk 2 and press Enter."
  67.     PULL response
  68.     SAY ""
  69.     SAY "Now copying files..."
  70.     "copy "src"*.* "destpath"/v"
  71.     "erase "destpath"\install.cmd 2>nul"
  72.     "erase "destpath"\upgrade.cmd 2>nul"
  73.     END
  74. ELSE DO
  75.     "copy "src"contacts.exe "destpath"/v"
  76.     "copy "src"contacts.hlp "destpath"/v"
  77.     "copy "src"cic*.dll "destpath"/v"
  78.     "copy "src"*.hdr "destpath"/v"
  79.     /* "copy "src"*.db* "destpath"/v" */
  80.     "copy "src"readme.txt "destpath"/v"
  81.     SAY ""
  82.     END
  83.  
  84. MAKE_ICON:
  85. /* Create the Contact Connection Icon. */
  86. call RxFuncAdd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
  87. if SysCreateObject('WPProgram', 'Contact Connection Demo', '<WP_DESKTOP>', 'EXENAME='destpath'\contacts.exe;STARTUPDIR='destpath, 'replace') == 0 then SAY 'Unable to create the Contact Connection icon.  You should add it manually after the installation program finishes.'
  88.  
  89. /* Make sub directories */
  90. "md "destpath"\NOTES 2>nul"
  91. "md "destpath"\FILES 2>nul"
  92. "md "destpath"\TEMPLATE 2>nul"
  93.  
  94. SAY ""
  95. SAY "DONE INSTALLING THE CONTACT CONNECTION DEMO."
  96. SAY "To use the program double click on the 'Contact Connection Demo' icon on your desktop."
  97. SAY ""
  98. EXIT
  99.