home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / mems400b.zip / mem4b.zip / Catala.cmd < prev    next >
OS/2 REXX Batch file  |  1997-10-23  |  4KB  |  162 lines

  1. /* CATALA.CMD: Instal·lació de MEMSIZE en català */
  2.  
  3. "@Echo Off"
  4. 'CHCP 850'
  5.  
  6. /* Càrregar 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 "Instal·lació de MEMSIZE..."
  20. Say ""
  21.  
  22.  
  23. /* Verify the existence of the various component files. */
  24.  
  25. Language = "CATALA"
  26.  
  27. Result = SysFileTree( "MEMSIZE2.EXE", "Files", "F" )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say "ERROR: No se troba el MEMSIZE2.EXE!"
  31.   Signal DONE
  32.   End
  33.  
  34. Result = SysFileTree( "OBJECTS.OS2\"Language".DLL", "Files", "F" )
  35. If Files.0 = 0 Then
  36.   Do
  37.   Say "ERROR: No se troba el "Language".DLL!"
  38.   Signal DONE
  39.   End
  40.  
  41. Result = SysFileTree( "OBJECTS.OS2\"Language".HLP", "Files", "F" )
  42. If Files.0 = 0 Then
  43.   Do
  44.   Say "ERROR: No se troba el "Language".HLP!"
  45.   Signal DONE
  46.   End
  47.  
  48. /* Ask for the target directory name. */
  49.  
  50. BootDrive = Filespec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))
  51. Default = SysIni('USER', 'MEMSIZE', 'INIPATH' )
  52. If Default = 'ERROR:'
  53.   Then Default = BootDrive'\OS2\Apps'
  54. If SUBSTR(Default,LENGTH(Default),1) <= ' '
  55.   Then Default = SUBSTR(Default,1,LENGTH(Default)-1)
  56.  
  57. Say "Si us plau, escribiu el nom complet del directori on voleu"
  58. Say "  instal·lar el programa MEMSIZE (per defecte és 'Default'): "
  59. Parse Pull Directory
  60. If Directory = "" Then Directory = Default
  61.  
  62.  
  63. /* Create the target directory if necessary. */
  64.  
  65. Result = SysFileTree( Directory, "Dirs", "D" )
  66. If Dirs.0 = 0 Then
  67.   Do
  68.   Result = SysMkDir( Directory )
  69.   if Result == 0 Then
  70.     Do
  71.     End
  72.   Else
  73.     Do
  74.     Say "ERROR: No se pot crear el directori destí."
  75.     Signal DONE
  76.     End
  77.   End
  78. Say ""
  79.  
  80.  
  81. /* Save the target directory. */
  82.  
  83. SysIni( "USER", "MEMSIZE", "INIPATH", Directory )
  84. SysIni( Directory"\MEMSIZE2.INI", "MEMSIZE", "INIPATH", Directory )
  85.  
  86.  
  87. /* Ask for the target folder. */
  88.  
  89. Say "Voleu instal·lar-lo de forma que s'executi automàticament a l'arrencar? (S/N)"
  90. Pull YesNo
  91. If YesNo = "S" Then
  92.   Do
  93.   Folder = "<WP_START>"
  94.   Say "L'objecte es copiarà a la carpeta Inici."
  95.   End
  96. Else
  97.   Do
  98.   Folder = "<WP_DESKTOP>"
  99.   Say "L'objecte es copiarà a l'escriptori."
  100.   End
  101. Say ""
  102.  
  103.  
  104. /* Destroy the old object, if present. */
  105.  
  106. Call SysDestroyObject( '<MEMSIZE>' )
  107. Call SysSleep( 5 )
  108.  
  109.  
  110. /* Perform the installation. */
  111.  
  112. Say "Copiant MEMSIZE al directori "Directory" ..."
  113. Copy MEMSIZE2.EXE Directory                  "1>NUL"
  114. Copy "OBJECTS.OS2\"Language".DLL" Directory"\MEMSIZE2.DLL" "1>NUL"
  115. Copy "OBJECTS.OS2\"Language".HLP" Directory"\MEMSIZE2.HLP" "1>NUL"
  116. Copy Language".DOC" Directory"\MEMSIZE2.DOC" "1>NUL"
  117.  
  118. Result = SysFileTree( "HLP2INF.EXE", 'Files', 'F' )
  119. If Files.0 > 0 Then
  120.    Do
  121.    Result = SysFileTree( Directory"\MEMSIZE2.INF", 'Files', 'F' )
  122.    If Files.0 > 0 Then
  123.       Do
  124.       "Erase" Directory"\MEMSIZE2.INF"
  125.       End
  126.    "HLP2INF" Directory"\MEMSIZE2.HLP"
  127.    End
  128.  
  129. Result = SysFileTree( "SNPSHOT2.EXE", 'Files', 'F' )
  130. If Files.0 > 0 Then
  131.    Do
  132.    Copy "SNPSHOT2.EXE" Directory"\SNPSHOT2.EXE"  '1>NUL'
  133.    End
  134.  
  135. Say "Creant l'objecte del programa..."
  136. Type = "WPProgram"
  137. Title = "Recursos del Sistema"
  138. Parms = "OPEN=DEFAULT;MINWIN=DESKTOP;PROGTYPE=PM;EXENAME="Directory"\MEMSIZE2.EXE;STARTUPDIR="Directory";OBJECTID=<MEMSIZE>;NOPRINT=YES;"
  139. Result = SysCreateObject( Type, Title, Folder, Parms, "ReplaceIfExists" )
  140.  
  141. If Result = 1 Then
  142.   Say "L'objecte s'ha creat.  Final"
  143. Else
  144.   Say "ERROR: No s'ha pogut crear l'objecte!"
  145.  
  146. Signal DONE
  147.  
  148. FAILURE:
  149. Say "Errada del REXX."
  150. Signal DONE
  151.  
  152. HALT:
  153. Say "S'atura el REXX."
  154. Signal DONE
  155.  
  156. SYNTAX:
  157. Say "Error de síntaxi del REXX."
  158. Signal DONE
  159.  
  160. DONE:
  161. Exit
  162.