home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games Special 3 / cd.iso / dosgames / puzzler / os2setup.cmd < prev    next >
OS/2 REXX Batch file  |  1995-06-29  |  3KB  |  90 lines

  1. /* Rexx program to install a Puzzler Object on the desktop         */
  2. /* USEAGE:  OS2SETUP      //Reads data directory from pzl.bat      */
  3. /*                        //must be run from destination directory */
  4. /*                                                                 */
  5. /*          OS2SETUP DESTINATION_PATH DATA_PATH                    */
  6.  
  7. PARSE ARG DESTINATION DATA
  8.  
  9. /* The print timeout of the object will be set to this value */
  10. printTimeout=20
  11.  
  12. Call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  13. Call sysloadfuncs
  14.  
  15. IF DESTINATION = "" | DATA="" THEN DO
  16.     /* Read in PZL.BAT to find the destination and data directories */
  17.     IF STREAM('pzl.bat','c','open read')<>"READY:" THEN DO
  18.         SAY "Can't open the file pzl.bat"
  19.         say "Run OS2SETUP from the destination directory you specified in install"
  20.         say "Or specify the directories you chose in install:"
  21.         say "   OS2SETUP DESTINATION_DIR DATA_DIR"
  22.         say "Install must be run before running OS2SETUP"
  23.         exit
  24.     END
  25.  
  26.     DESTINATION=DIRECTORY()
  27.  
  28.     TEMP=LINEIN('pzl.bat')
  29.     TEMP=LINEIN('pzl.bat')
  30.     TEMP=LINEIN('pzl.bat')
  31.     TEMP=LINEIN('pzl.bat')
  32.     TEMP=LINEIN('pzl.bat')
  33.  
  34.     DATA=TEMP /* DRIVE */
  35.  
  36.     TEMP=LINEIN('pzl.bat')
  37.     TEMP=LINEIN('pzl.bat')
  38.  
  39.     RC=STREAM("PZL.BAT","C","CLOSE")
  40.  
  41.     PARSE VAR TEMP . PATH
  42.     DATA=DATA || PATH
  43.  
  44.     IF SUBSTR(DATA,2,1)<> ":" | SUBSTR(DATA,3,1) <> '\' THEN DO
  45.         SAY "The pzl.bat file appears to have been modified."
  46.         say "Unable to determine data directory."
  47.         say "Please run OS2SETUP again and supply the directories"
  48.         say "   OS2SETUP  DESTINATION_DIR  DATA_DIR"
  49.         exit
  50.     END
  51.  
  52.     IF STREAM(DESTINATION || "\PUZZLER.EXE","C","QUERY EXISTS")="" THEN DO
  53.         SAY "'"DESTINATION || "\PUZZLER.EXE' Does not exist."
  54.         SAY "Run OS2SETUP from the directory you specified as"
  55.         SAY "the destination directory, or specify the directories"
  56.         SAY "on the command line."
  57.         SAY "   OS2SETUP  DESTINATION_DIR  DATA_DIR"
  58.         EXIT
  59.     END
  60. END
  61. ELSE DO
  62.     IF SUBSTR(DATA,2,2) <> ":\" THEN DO
  63.         SAY "Invalid data directory. You must specify a full path."
  64.         EXIT
  65.     END
  66.  
  67.     IF STREAM(DESTINATION || "\PUZZLER.EXE","C","QUERY EXISTS")="" THEN DO
  68.         SAY "'"DESTINATION || "\PUZZLER.EXE' Does not exist."
  69.         SAY "The destination directory you specified may be incorrect."
  70.         SAY "Or you may not have run install first."
  71.         SAY "USEAGE:   OS2SETUP  DESTINATION_DIR  DATA_DIR"
  72.         EXIT
  73.     END
  74. END
  75.  
  76. Say "Object will have the following settings:"
  77. SAY "   Path to program  : " DESTINATION || "\PUZZLER.EXE"
  78. SAY "   Working directory: " DATA
  79. SAY "   Print Timeout    : " printTimeout
  80. SAY " "
  81. SAY " "
  82.  
  83. /* Create the object on the desktop */
  84. Call SysCreateObject 'WPProgram','Puzzler','<WP_DESKTOP>','ICONFILE='||destination||'\puzzler.ico;EXENAME='||destination||'\PUZZLER.EXE;PROGTYPE=VDM;STARTUPDIR='||data||';SET DPMI_MEMORY_LIMIT=0;SET EMS_MEMORY_LIMIT=0;SET XMS_MEMORY_LIMIT=0;SET PRINT_TIMEOUT='printTimeout';SET IDLE_SENSITIVITY=50;','F'
  85.  
  86. IF RESULT=1 THEN
  87.     SAY "The Puzzler object was successfully created."
  88. ELSE
  89.     SAY "The Puzzler object was not created. Perhaps it already exists."
  90.