home *** CD-ROM | disk | FTP | other *** search
- /* */
- /*
- * ********************************************************************
- * * Copyright (c) IBM Corporation, 1995 *
- * * All Rights Reserved *
- * ********************************************************************
- *
- *
- * DESCRIPTION: This REXX command file is to be used to make changes
- * to CONFIG.SYS for IBM Microchannel PS/2's in order
- * to install Microsoft applications that are in DMF
- * format on your IBM PS/2 Microchannel system.
- *
- */
-
- /* trace I */
- call init
-
- /* Get the version of the current OS/2 system. */
- version = SysOs2Ver()
- if version < '2.30' then /* 2.30 represents Warp version. */
- do
- say 'Este archivo de mandatos no funciona con esta versión de OS/2.'
- say 'Programa finalizado.'
- exit
- end
- "@cls"
- Say ' '
- Say ' '
- Say ' '
- Say 'Este programa permite que los usuarios de OS/2 Warp que utilizan'
- Say 'IBM PS/2 puedan instalar el software que se proporciona en diskettes'
- Say 'con formato DMF no estándar.'
- Say ' '
- Say 'Este program modificará el archivo CONFIG.SYS para permitir que se'
- Say 'puedan leer los diskettes DMF. Una vez el software de DMF está '
- Say 'instalado, debería ejecutar de nuevo este programa mediante la opción'
- Say 'R para Restaurar el archivo CONFIG.SYS original.'
- Say ' '
- Say 'Para modificar el archivo CONFIG.SYS de Os/2 Warp de modo que ofrezca'
- Say 'soporte para instalar desde diskettes con formato DMF, entre M para'
- Say 'modificarlo. '
- Say 'Para deshacer los cambios del CONFIG.SYS de OS/2 Warp relacionados con'
- Say 'DMF, entre R para Restaurar.'
- Say ' '
- Say 'Para salir de este programa sin hacer cambios, pulse S de Salir'
- Say ' '
- Say 'Teclee M (Modificar) o R (Restaurar) o S (Salir).'
-
- parse upper pull answer . /* Get the answer */
-
- if (answer='S' | answer='SALIR') then /* If answer is exit then exit */
- say 'Saliendo del archivo de mandatos!'
-
- else if (answer='RESTAURAR' | answer='R') then
- call UNDO /* If the answer is UNDO then go to the UNDO Subroutine */
-
- else if (answer='M' | answer = 'MODIFICAR') then
- do /* If the answer is Modify then modify config.sys */
- '@cls'
- say ' '
- say ' '
- say ' '
- say '¿En qué unidad se ha instalado el sistema OS/2 Warp?'
- say 'Entre la letra de unidad o la vía de acceso (ejemplo C:\)'
- say ''
-
- /* Check whether the given drive is valid. */
- call Checkdrive /* GO to the Checkdrive subroutine */
-
- fname=drive'\config.sys' /* Assign drive letter and path for config.sys */
-
- /* Check whether config.sys exists. */
- call sysfiletree fname, 'files.', 'F'
-
- if files.0 < 1 then
- do
- say 'No se ha encontrado el archivo CONFIG.SYS.'
- say 'Programa finalizado.'
- exit
- end
-
- sname=drive'\config.dmf' /* Assign drive letter and path to */
- /* config.sys back up file name */
-
- /* Check whether config.dmf exists. */
- call sysfiletree sname, 'files.', 'F'
-
- if files.0 >= 1 then
- do
- say 'Config.dmf ya existe. ¿Desea sobreescribirlo (S/N)?'
-
- parse upper pull answer
- answer = left(answer,1)
- if answer = 'N' then
- do
- say 'Renombre o suprima config.dmf antes de volver a ejecutar dmf_ps2.'
- exit
- end
- end
-
- nname=drive'\config1.tmp' /* Assign drive letter and path to */
- /* temporary file */
-
- say 'Ejecutándose ........'
- say ' '
- "@copy" fname sname ">nul 2>nul" /* Backup config.sys */
-
- call lineout nname,,1
- do while lines(fname) /* Parse through config.sys looking for */
- str = linein(fname) /* the string to be modified */
- basedev = (substr(str,1,20)) /* Only need to look at first 20 */
- /* characters of the line */
- select
- when substr(basedev,1,20) == 'BASEDEV=IBM1FLPY.ADD' then do
- if left(reverse(str), 4) \= 'ACM/' then do
- call lineout nname, str '/MCA' /* Add /MCA option to */
- end /* IBM1FLPY.ADD driver */
- else
- call lineout nname, str
- end
- when substr(basedev,1,20) == 'BASEDEV=IBM2FLPY.ADD' then do
- call lineout nname, 'REM' str /* REM out the */
- end /* IBM2FLPY.ADD driver */
- otherwise do
- call lineout nname, str
- end
- end
- end
-
- call lineout fname
- call lineout nname
- "@copy" nname fname ">nul 2>nul"
- "@erase" nname
- "@cls"
-
-
- say ''
- say ''
- say ''
- say ''
- say 'Cambios hechos en el archivo' fname
- say ''
- say 'Se ha modificado el archivo CONFIG.SYS. La versión original'
- say 'se ha guardado como CONFIG.DMF. Para que entren en efecto los '
- say 'cambios, utilice el mandato Concluir, y vuelva iniciar el sistema.'
- say ''
- say 'Cuando se hayan instalado las aplicaciones DMF, por favor vuelva'
- say 'a ejecutar DMF_PS2 con la opción R (Restaurar), para volver a'
- say 'dejar el sistema en el estado original.'
-
- end
- else
- say 'Respuesta desconocida.'
- say 'Programa finalizado.'
-
- exit
-
- UNDO:
- '@cls'
- say ' '
- say ' '
- say ' '
- say '¿En qué unidad ha instalado el sistema OS/2 Warp?'
- say 'Entre la letra de unidad o la vía de acceso (ejemplo C:\)'
- say ' '
-
- call Checkdrive
-
- fname=drive'\config.sys'
-
- call sysfiletree fname, 'files.', 'F'
- if files.0 < 1 then
- do
- say 'No se ha encontrado el archivo CONFIG.SYS.'
- say 'Programa finalizado.'
- exit
- end
-
- nname=drive'\config1.tmp'
-
- do while lines(fname) /* This section of code is to check the */
- str = linein(fname) /* config.sys to see if the DMF changes */
- basedev = (substr(str,1,24)) /* need to be UNDone. */
- select
- when substr(basedev,1,20) == 'BASEDEV=IBM2FLPY.ADD' then do
- "@CLS"
- say ' ' /* If it finds this then display */
- say ' ' /* Message */
- say ' '
- say 'CONFIG.SYS no contiene cambios DMF'
- say 'Nada para DESHACER'
- say 'Programa finalizado'
- call exit
- end
- when substr(basedev,1,24) == 'REM BASEDEV=IBM2FLPY.ADD' then do
- call lineout nname
- call lineout fname /* If it finds this then lets */
- call undo2 /* call undo2 to really undo the */
- end /* DMF changes */
- otherwise do
- call lineout nname, str
- end
- end
- end
- EXIT:
- call lineout nname
- "@ERASE" nname
- exit
-
- UNDO2:
-
- "@erase" nname
-
- nname=drive'\config1.tmp'
-
- call lineout nname,,1
- do while lines(fname)
- str = linein(fname)
- basedev = (substr(str,1,24))
-
- select
- when substr(basedev,1,24) == 'REM BASEDEV=IBM2FLPY.ADD' then do
- newstr = (subword(str,2))
- call lineout nname, newstr
- end
- when substr(basedev,1,20) == 'BASEDEV=IBM1FLPY.ADD' then do
- parse var str final remaining
- num_item = words(remaining)
- do p = 1 to num_item
- if strip(word(remaining, p)) \= '/MCA' then
- final = final || ' 'word(remaining, p)
- end
- call lineout nname, final
- end
- otherwise do
- call lineout nname, str
- end
- end
- end
- call lineout fname
- call lineout nname
- "@copy" nname fname ">nul 2>nul"
- "@erase" nname
- "@cls"
-
-
- say ''
- say ''
- say ''
- say ''
- say 'Se ha restaurado el archivo CONFIG.SYS. Para que los cambios entren en'
- say 'efecto, utilice el mandato concluir, y vuelva a iniciar el sistema.'
- say ''
- exit
-
- CheckDrive:
- /* Get all the local drive letters. */
- drivemap = sysdrivemap('c:', 'LOCAL')
-
- parse upper pull drive .
-
- drive = strip(translate(drive, ' ', '\'))
- num_item = words(drive)
- if num_item > 1 then
- do
- say 'Unidad no reconocida.'
- say 'Programa finalizado.'
- exit
- end
- found = 'NO'
- do while drivemap \= ''
- parse var drivemap head tail
- drivemap = tail
- head = strip(head)
- if head = drive then
- found = 'YES'
- end
-
- if found = 'NO' then
- do
- say 'Unidad no reconocida.'
- say 'Programa finalizado.'
- end
- return
-
- /* Load in the extra function library. WPW001 */
- Init: Procedure
-
- /* Load in the extra function library */
- if RxFuncQuery('SysLoadFuncs') then do
- Call RXFuncAdd 'SysLoadFuncs','RexxUtil','SysloadFuncs'
- end
- Call SysLoadFuncs
- return