home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / remind20.zip / install.cmd next >
OS/2 REXX Batch file  |  1994-05-30  |  2KB  |  123 lines

  1. /* INSTALL.CMD: Install REMINDER */
  2.  
  3. '@Echo Off'
  4.  
  5. /* Load REXXUTIL */
  6.  
  7. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  8. Call SysLoadFuncs
  9.  
  10.  
  11. /* Initialize */
  12.  
  13. Signal On Failure Name FAILURE
  14. Signal On Halt Name HALT
  15. Signal On Syntax Name SYNTAX
  16.  
  17. Call SysCls
  18. Say 'Installing REMINDER for OS/2...'
  19. Say ''
  20.  
  21.  
  22. /* Verify the existence of the various component files. */
  23.  
  24. Result = SysFileTree( 'REMINDER.EXE', 'Files', 'F' )
  25. If Files.0 = 0 Then
  26.   Do
  27.   Say 'ERROR: REMINDER.EXE not found!'
  28.   Signal DONE
  29.   End
  30.  
  31. Result = SysFileTree( 'REMINDER.DOC', 'Files', 'F' )
  32. If Files.0 = 0 Then
  33.   Do
  34.   Say 'ERROR: REMINDER.DOC not found!'
  35.   Signal DONE
  36.   End
  37.  
  38. Result = SysFileTree( 'REMINDER.DAT', 'Files', 'F' )
  39. If Files.0 = 0 Then
  40.   Do
  41.   Say 'ERROR: REMINDER.DAT not found!'
  42.   Signal DONE
  43.   End
  44.  
  45.  
  46. /* Ask for the target directory name. */
  47.  
  48. Say 'Please enter the full name of the directory to which'
  49. Say '  you want REMINDER installed (default C:\OS2\APPS): '
  50. Pull Directory
  51. If Directory = "" Then Directory = 'C:\OS2\APPS'
  52.  
  53.  
  54. /* Create the target directory if necessary. */
  55.  
  56. Result = SysFileTree( Directory, 'Dirs', 'D' )
  57. If Dirs.0 = 0 Then
  58.   Do
  59.   Result = SysMkDir( Directory )
  60.   if Result == 0 Then
  61.     Do
  62.     End
  63.   Else
  64.     Do
  65.     Say 'ERROR: Unable to create target directory.'
  66.     Signal DONE
  67.     End
  68.   End
  69. Say ''
  70.  
  71.  
  72. /* Ask for the target folder. */
  73.  
  74. Say 'Do you wish to install to the startup folder? (Y/N)'
  75. Pull YesNo
  76. If YesNo = "Y" Then
  77.   Do
  78.   Folder = '<WP_START>'
  79.   Say 'Object will be placed in the startup folder.'
  80.   End
  81. Else
  82.   Do
  83.   Folder = '<WP_DESKTOP>'
  84.   Say 'Object will be placed on the desktop.'
  85.   End
  86. Say ''
  87.  
  88.  
  89. /* Perform the installation. */
  90.  
  91. Say 'Copying REMINDER to ' Directory '...'
  92. Copy REMINDER.EXE Directory                  '1>NUL'
  93. Copy REMINDER.DOC Directory                  '1>NUL'
  94. Copy REMINDER.DAT Directory                  '1>NUL'
  95.  
  96. Say 'Creating program object...'
  97. Type = 'WPProgram'
  98. Title = 'Reminder for OS/2'
  99. Parms = 'MINWIN=DESKTOP;PROGTYPE=PM;EXENAME='Directory'\REMINDER.EXE;STARTUPDIR='Directory';OBJECTID=<REMINDER>;NOPRINT=YES;'
  100. Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
  101.  
  102. If Result = 1 Then
  103.   Say 'Object created!  Done.'
  104. Else
  105.   Say 'ERROR: Object not created.'
  106.  
  107. Signal DONE
  108.  
  109. FAILURE:
  110. Say 'REXX failure.'
  111. Signal DONE
  112.  
  113. HALT:
  114. Say 'REXX halt.'
  115. Signal DONE
  116.  
  117. SYNTAX:
  118. Say 'REXX syntax error.'
  119. Signal DONE
  120.  
  121. DONE:
  122. Exit
  123.