home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 December / SOFM_Dec1995.bin / pc / os2 / resource / english.cmd < prev    next >
OS/2 REXX Batch file  |  1995-10-31  |  3KB  |  138 lines

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