home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / memsz331.zip / CATALA.CMD < prev    next >
OS/2 REXX Batch file  |  1996-07-26  |  3KB  |  155 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( "MEMSIZE.EXE", "Files", "F" )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say "ERROR: No se troba el MEMSIZE.EXE!"
  31.   Signal DONE
  32.   End
  33.  
  34. Result = SysFileTree( 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( 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. Default = SysIni('USER', 'MEMSIZE', 'INIPATH' )
  51. If Default = 'ERROR:'
  52.   Then Default = 'C:\OS2\Apps'
  53. If SUBSTR(Default,LENGTH(Default),1) <= ' '
  54.   Then Default = SUBSTR(Default,1,LENGTH(Default)-1)
  55.  
  56. Say "Si us plau, escribiu el nom complet del directori on voleu"
  57. Say "  instal·lar el programa MEMSIZE (per defecte és 'Default'): "
  58. Parse Pull Directory
  59. If Directory = "" Then Directory = Default
  60.  
  61.  
  62. /* Create the target directory if necessary. */
  63.  
  64. Result = SysFileTree( Directory, "Dirs", "D" )
  65. If Dirs.0 = 0 Then
  66.   Do
  67.   Result = SysMkDir( Directory )
  68.   if Result == 0 Then
  69.     Do
  70.     End
  71.   Else
  72.     Do
  73.     Say "ERROR: No se pot crear el directori destí."
  74.     Signal DONE
  75.     End
  76.   End
  77. Say ""
  78.  
  79.  
  80. /* Ask for the target folder. */
  81.  
  82. Say "Voleu instal·lar-lo de forma que s'executi automàticament a l'arrencar? (S/N)"
  83. Pull YesNo
  84. If YesNo = "S" Then
  85.   Do
  86.   Folder = "<WP_START>"
  87.   Say "L'objecte es copiarà a la carpeta Inici."
  88.   End
  89. Else
  90.   Do
  91.   Folder = "<WP_DESKTOP>"
  92.   Say "L'objecte es copiarà a l'escriptori."
  93.   End
  94. Say ""
  95.  
  96.  
  97. /* Destroy the old object, if present. */
  98.  
  99. Call SysDestroyObject( '<MEMSIZE>' )
  100. Call SysSleep( 5 )
  101.  
  102.  
  103. /* Perform the installation. */
  104.  
  105. Say "Copiant MEMSIZE al directori "Directory" ..."
  106. Copy MEMSIZE.EXE Directory                  "1>NUL"
  107. Copy Language".DLL" Directory"\MEMSIZE.DLL" "1>NUL"
  108. Copy Language".HLP" Directory"\MEMSIZE.HLP" "1>NUL"
  109. Copy Language".DOC" Directory"\MEMSIZE.DOC" "1>NUL"
  110.  
  111. Result = SysFileTree( "HLP2INF.EXE", 'Files', 'F' )
  112. If Files.0 > 0 Then
  113.    Do
  114.    Result = SysFileTree( Directory"\MEMSIZE.INF", 'Files', 'F' )
  115.    If Files.0 > 0 Then
  116.       Do
  117.       "Erase" Directory"\MEMSIZE.INF"
  118.       End
  119.    "HLP2INF" Directory"\MEMSIZE.HLP"
  120.    End
  121.  
  122. Result = SysFileTree( "SNAPSHOT.EXE", 'Files', 'F' )
  123. If Files.0 > 0 Then
  124.    Do
  125.    Copy "SNAPSHOT.EXE" Directory"\SNAPSHOT.EXE"  '1>NUL'
  126.    End
  127.  
  128. Say "Creant l'objecte del programa..."
  129. Type = "WPProgram"
  130. Title = "Recursos del Sistema"
  131. Parms = "OPEN=DEFAULT;MINWIN=DESKTOP;PROGTYPE=PM;EXENAME="Directory"\MEMSIZE.EXE;STARTUPDIR="Directory";OBJECTID=<MEMSIZE>;NOPRINT=YES;"
  132. Result = SysCreateObject( Type, Title, Folder, Parms, "ReplaceIfExists" )
  133.  
  134. If Result = 1 Then
  135.   Say "L'objecte s'ha creat.  Final"
  136. Else
  137.   Say "ERROR: No s'ha pogut crear l'objecte!"
  138.  
  139. Signal DONE
  140.  
  141. FAILURE:
  142. Say "Errada del REXX."
  143. Signal DONE
  144.  
  145. HALT:
  146. Say "S'atura el REXX."
  147. Signal DONE
  148.  
  149. SYNTAX:
  150. Say "Error de síntaxi del REXX."
  151. Signal DONE
  152.  
  153. DONE:
  154. Exit
  155.