home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / progs / reminder / install.cmd next >
Encoding:
Text File  |  1994-02-01  |  2.6 KB  |  131 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.ICO', 'Files', 'F' )
  32. If Files.0 = 0 Then
  33.   Do
  34.   Say 'ERROR: REMINDER.ICO not found!'
  35.   Signal DONE
  36.   End
  37.  
  38. Result = SysFileTree( 'REMINDER.DOC', 'Files', 'F' )
  39. If Files.0 = 0 Then
  40.   Do
  41.   Say 'ERROR: REMINDER.DOC not found!'
  42.   Signal DONE
  43.   End
  44.  
  45. Result = SysFileTree( 'REMINDER.DAT', 'Files', 'F' )
  46. If Files.0 = 0 Then
  47.   Do
  48.   Say 'ERROR: REMINDER.DAT not found!'
  49.   Signal DONE
  50.   End
  51.  
  52.  
  53. /* Ask for the target directory name. */
  54.  
  55. Say 'Please enter the full name of the directory to which'
  56. Say '  you want REMINDER installed (default C:\OS2\APPS): '
  57. Pull Directory
  58. If Directory = "" Then Directory = 'C:\OS2\APPS'
  59.  
  60.  
  61. /* Create the target directory if necessary. */
  62.  
  63. Result = SysFileTree( Directory, 'Dirs', 'D' )
  64. If Dirs.0 = 0 Then
  65.   Do
  66.   Result = SysMkDir( Directory )
  67.   if Result == 0 Then
  68.     Do
  69.     End
  70.   Else
  71.     Do
  72.     Say 'ERROR: Unable to create target directory.'
  73.     Signal DONE
  74.     End
  75.   End
  76. Say ''
  77.  
  78.  
  79. /* Ask for the target folder. */
  80.  
  81. Say 'Do you wish to install to the startup folder? (Y/N)'
  82. Pull YesNo
  83. If YesNo = "Y" Then
  84.   Do
  85.   Folder = '<WP_START>'
  86.   Say 'Object will be placed in the startup folder.'
  87.   End
  88. Else
  89.   Do
  90.   Folder = '<WP_DESKTOP>'
  91.   Say 'Object will be placed on the desktop.'
  92.   End
  93. Say ''
  94.  
  95.  
  96. /* Perform the installation. */
  97.  
  98. Say 'Copying REMINDER to ' Directory '...'
  99. Copy REMINDER.EXE Directory                  '1>NUL'
  100. Copy REMINDER.ICO Directory                  '1>NUL'
  101. Copy REMINDER.DOC Directory                  '1>NUL'
  102. Copy REMINDER.DAT Directory                  '1>NUL'
  103.  
  104. Say 'Creating program object...'
  105. Type = 'WPProgram'
  106. Title = 'Reminder for OS/2'
  107. Parms = 'MINWIN=DESKTOP;PROGTYPE=PM;EXENAME='Directory'\REMINDER.EXE;STARTUPDIR='Directory';OBJECTID=<REMINDER>;NOPRINT=YES;'
  108. Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
  109.  
  110. If Result = 1 Then
  111.   Say 'Object created!  Done.'
  112. Else
  113.   Say 'ERROR: Object not created.'
  114.  
  115. Signal DONE
  116.  
  117. FAILURE:
  118. Say 'REXX failure.'
  119. Signal DONE
  120.  
  121. HALT:
  122. Say 'REXX halt.'
  123. Signal DONE
  124.  
  125. SYNTAX:
  126. Say 'REXX syntax error.'
  127. Signal DONE
  128.  
  129. DONE:
  130. Exit
  131.