home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / memsz331.zip / ESPANOL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-02-17  |  3KB  |  155 lines

  1. /* ESPANOL.CMD: Instalación de MEMSIZE en español */
  2.  
  3. '@Echo Off'
  4. 'CHCP 850'
  5.  
  6. /* Cargar 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 'Instalación de MEMSIZE...'
  20. Say ''
  21.  
  22.  
  23. /* Verify the existence of the various component files. */
  24.  
  25. Language = 'ESPANOL'
  26.  
  27. Result = SysFileTree( 'MEMSIZE.EXE', 'Files', 'F' )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say 'ERROR: ¡No se encuentra 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 encuentra '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 encuentra '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 'Por favor, escriba el nombre completo del directorio en el'
  57. Say '  que quiere instalar el programa MEMSIZE (por defecto es '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 puede crear el directorio destino.'
  74.     Signal DONE
  75.     End
  76.   End
  77. Say ''
  78.  
  79.  
  80. /* Ask for the target folder. */
  81.  
  82. Say "¿Quiere instalarlo de forma que se ejecute automáticamente al arrancar? (S/N)"
  83. Pull YesNo
  84. If YesNo = "S" Then
  85.   Do
  86.   Folder = '<WP_START>'
  87.   Say "El objeto se copiará en la carpeta Inicio."
  88.   End
  89. Else
  90.   Do
  91.   Folder = '<WP_DESKTOP>'
  92.   Say "El objeto se copiará en el Escritorio."
  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 'Copiando MEMSIZE en el directorio '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 "Creando el objeto 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 "El objeto se ha creado.  Fin."
  136. Else
  137.   Say "ERROR: ¡No se ha podido crear el objeto!"
  138.  
  139. Signal DONE
  140.  
  141. FAILURE:
  142. Say 'Error de REXX.'
  143. Signal DONE
  144.  
  145. HALT:
  146. Say 'Se ha parado REXX.'
  147. Signal DONE
  148.  
  149. SYNTAX:
  150. Say 'Error de sintaxis de REXX.'
  151. Signal DONE
  152.  
  153. DONE:
  154. Exit
  155.