home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxphn.zip / INSTALL.CMD next >
OS/2 REXX Batch file  |  1995-01-23  |  4KB  |  125 lines

  1. /******************************| Install.Cmd |*******************************
  2.  |                                                                          |
  3.  | RexxPhone Installation program.                                          |
  4.  |                                                                          |
  5.  |                                                                          |
  6.  | Copyright 1994 Silver Bullet Software, Inc.                              |
  7.  |                                                                          |
  8.  ****************************************************************************/
  9. '@echo off'
  10.  
  11.   signal on halt
  12.   Say "Installation Program for REXXPHONE."
  13.   Say "Copyright 1994, Silver Bullet Software, Inc."
  14.   Say " "
  15.  
  16.   rc = RxFuncAdd('SysLoadFuncs','RexxUtil','SysLoadFuncs')
  17.   rc = SysLoadFuncs()
  18.  
  19.   rxphone = Value( 'RXPHONE',, 'OS2ENVIRONMENT' )
  20.   if rxphone = "" then do
  21.     map = SysDriveMap()
  22.     say "Enter the drive to install RexxPhone ("||map||")."
  23.     Pull drive
  24.     destdir = drive||"\RxPhone"
  25.     End
  26.   else do
  27.     drive = FileSpec( "drive", rxphone )
  28.     destdir = rxphone
  29.     End
  30.  
  31.   say " "
  32.   say "Installing RexxPhone to" destdir
  33.  
  34.  
  35.   /* If we can create a RxPhone directory on the drive, continue. */
  36.  
  37.   rc = SysMkDir( destdir )
  38.   if rc = 5 then do
  39.     say "Directory" destdir "already exists."
  40.     say "OK to continue installation of RexxPhone (y/n)?"
  41.     Pull answer
  42.     if answer \= 'Y' then signal Halt
  43.     End
  44.   else if rc \= 0 then do
  45.     say "Could not create directory" destdir
  46.     say "Check if" drive "is a valid drive."
  47.     signal Halt
  48.     End
  49.  
  50.   /* Create RexxPhone directory structure. */
  51.   rc = SysMkDir( destdir||"\Samples" )
  52.   rc = SysMkDir( destdir||"\Samples\Rexx" )
  53.   rc = SysMkDir( destdir||"\Samples\VXRexx" )
  54.   rc = SysMkDir( destdir||"\Samples\VXRexx\Machine" )
  55.   rc = SysMkDir( destdir||"\Samples\VXRexx\Machine\Project" )
  56.   rc = SysMkDir( destdir||"\Samples\VXRexx\Monitor" )
  57.   rc = SysMkDir( destdir||"\Samples\VXRexx\Monitor\Project" )
  58.   rc = SysMkDir( destdir||"\Samples\VXRexx\Recorder" )
  59.   rc = SysMkDir( destdir||"\Extras" )
  60.  
  61.   Parse Source . . thisfile
  62.   packfile = FileSpec( "drive", thisfile )||"\RxPhone.pak"
  63.   destfile = drive||"\RxPhone\RxPhone.pak"
  64.  
  65.   say "Copying compressed RexxPhone from" packfile "to" destfile||"."
  66.   Address CMD "Copy" packfile destfile      /* Copy over packed file. */
  67.   rc = Directory( destdir )
  68.   say "Unpacking..."
  69.   Address CMD "UnPack" destfile             /* Unpack the file. */
  70.   Address CMD "Erase" destfile              /* Erase it. */
  71.  
  72.   /* Now copy .dll's to \os2\dll */
  73.   bootpath = Value( 'Path',, 'OS2ENVIRONMENT' )
  74.   Parse Upper Var bootpath bootpath
  75.   bootdrive = Substr( bootpath, Pos('\OS2\SYSTEM', bootpath)-2, 2 )
  76.  
  77.   dlldir = bootdrive||"\OS2\DLL"
  78.  
  79.   fromdll = destdir||"\DlgPhone.dll"
  80.   todll = dlldir||"\DlgPhone.dll"
  81.   say "Copying DlgPhone.dll to" todll
  82.   Address CMD "Copy" fromdll todll
  83.  
  84.   vxrexx = Value( 'VXREXX',, 'OS2ENVIRONMENT' )
  85.   if vxrexx = "" then do
  86.     fromdll = destdir||"\VRObj.dll"
  87.     todll = dlldir||"\VRObj.dll"
  88.     say "Copying VRObj.dll to" todll
  89.     Address CMD "Copy" fromdll todll
  90.     End
  91.   else do
  92.     say " "
  93.     say "VX-REXX is already installed."
  94.     say "VRObj.dll will not be installed."
  95.     say "See the Read.Me file on the install disk."
  96.     say " "
  97.     End
  98.  
  99.   if rxphone = "" then do
  100.     config = bootdrive||"\config.sys"
  101.     configbak = bootdrive||"\config.bak"
  102.     say "Copying config.sys to" configbak
  103.     Address CMD "Copy" config configbak
  104.     rc = LineOut( config, "Set RXPHONE="||destdir )
  105.     say "Config.sys updated."
  106.     say "Reboot to effectuate changes."
  107.     End
  108.  
  109.   rc = SysDropFuncs()
  110.  
  111.   /* Build folder on desktop. */
  112.   Call Build.cmd
  113.  
  114.   say
  115.   say "See the Read.Me file in" destdir "for the latest information."
  116.   say "Installation of RexxPhone ended normally."
  117.   Exit
  118.  
  119.  
  120. Halt:
  121.   rc = SysDropFuncs()
  122.   say "Installation of RexxPhone halted."
  123.   Exit
  124.  
  125.