home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 December / SOFM_Dec1995.bin / pc / os2 / resource / catala.cmd next >
OS/2 REXX Batch file  |  1995-10-31  |  3KB  |  138 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. Say "Si us plau, escribiu el nom complet del directori on voleu"
  51. Say "  instal·lar el programa MEMSIZE (per defecte és 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: No se pot crear el directori destí."
  68.     Signal DONE
  69.     End
  70.   End
  71. Say ""
  72.  
  73.  
  74. /* Ask for the target folder. */
  75.  
  76. Say "Voleu instal·lar-lo de forma que s'executi automàticament a l'arrencar? (S/N)"
  77. Pull YesNo
  78. If YesNo = "S" Then
  79.   Do
  80.   Folder = "<WP_START>"
  81.   Say "L'objecte es copiarà a la carpeta Inici."
  82.   End
  83. Else
  84.   Do
  85.   Folder = "<WP_DESKTOP>"
  86.   Say "L'objecte es copiarà a l'escriptori."
  87.   End
  88. Say ""
  89.  
  90.  
  91. /* Perform the installation. */
  92.  
  93. Say "Copiant MEMSIZE al directori " 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 "Creant l'objecte del programa..."
  112. Type = "WPProgram"
  113. Title = "Recursos del Sistema"
  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 "L'objecte s'ha creat.  Final"
  119. Else
  120.   Say "ERROR: No s'ha pogut crear l'objecte!"
  121.  
  122. Signal DONE
  123.  
  124. FAILURE:
  125. Say "Errada del REXX."
  126. Signal DONE
  127.  
  128. HALT:
  129. Say "S'atura el REXX."
  130. Signal DONE
  131.  
  132. SYNTAX:
  133. Say "Error de síntaxi del REXX."
  134. Signal DONE
  135.  
  136. DONE:
  137. Exit
  138.