home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 March / SOFM_Mar1995.bin / pc / utility / os2 / clock / english.cmd < prev    next >
OS/2 REXX Batch file  |  1995-01-27  |  2KB  |  124 lines

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