home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzipshl.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-12-01  |  2KB  |  64 lines

  1. /* Generic REXX Installation Utility                                 */
  2. /* John Wagner, Power Programming, Inc. - 1994 -                     */
  3. /* Checks for the existance of the file to be installed              */
  4. /* If file found, creates a WPS object for it                        */
  5. /* Will add the ability to input an install drive/dir in the future  */
  6.  
  7. /* Load the RexxUtil DLL                                             */
  8. call RxFuncAdd 'SysLoadFuncs' , RexxUtil, 'SysLoadFuncs'
  9. call SysLoadFuncs
  10.  
  11. /* Initialize the varibles needed for this installation              */
  12. /* These variables should cover most basic installations             */
  13. ProgramTitle = 'The UnZip Shell'
  14. EXE = 'UNZSH.EXE'
  15. InstallDir = Directory()
  16. /* Put any file type associations in this string, seperated by a ,   */
  17. Assoc = '*.ZIP'
  18. Setup = 'EXENAME='InstallDir'\'EXE';ASSOCFILTER='Assoc''
  19. /* Action to take if pre-existing object is found */
  20. Action = Update
  21.  
  22. call SysCls
  23.  
  24. say '    ┌───────────────────────────────────────────────────────────────┐'
  25. say '    │                  Rexx Installation Utility                    │'
  26. say '    └───────────────────────────────────────────────────────────────┘'
  27. say
  28. say 'This program will create an object on your desktop to access:'
  29. say ProgramTitle
  30. say 'After the installation, you can move the object to any WPS folder.'
  31.  
  32. /* See if EXE is in this directory. If not, quit!                    */
  33. say 'Locating file:' EXE || '...'
  34. if Stream(EXE,'C','Query Exists') = '' then do
  35.   say 'The file' EXE 'was not located in' InstallDir
  36.   say EXE 'must be in this directory for the installation to work.'
  37.   say 'Exiting...'
  38.   exit
  39. end
  40.  
  41. /* Create the WPS object                                             */
  42. say 'Located' EXE ||'. Creating WPS object...'
  43. rc = SysCreateObject('WPProgram', ProgramTitle, '<WP_DESKTOP>',,
  44.                      Setup,,
  45.                      Action)
  46.  
  47. /* Check if the WPS object was created                               */
  48. if rc = 0 then do
  49.    say 'Failed to create WPS object for' ProgramTitle || '!!!'
  50. end
  51. else do
  52.    say 'WPS Object created for' ProgramTitle || '.'
  53.    if Assoc \= '' then do
  54.       say
  55.       say ProgramTitle 'has been associated with file types ending in:'
  56.       say Assoc
  57.       say 'Double clicking on a WPS file object with that extension(s)'
  58.       say 'will invoke' ProgramTitle 'with that file loaded.'
  59.       say
  60.    end
  61. end
  62.  
  63. say 'Exiting REXX installation utility.'
  64.