home *** CD-ROM | disk | FTP | other *** search
- /* This cmd file will copy the Builder/2 runtime parts. */
- /* It does this as follows */
- /* 1. Initialization */
- /* 2. Ask for source path. */
- /* 3. Ask for the target path. */
- /* 4. Check state of target disk */
- /* 5. Create directories if needed */
- /* 6. Copy each part from source to destination. */
- /* 7. Exit */
- /************************************************************************/
-
- Abort = 'No'; /* Flag to control aborting */
- "@ECHO OFF"
- /* Initialize the RexxUtil environment */
-
- Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
- Call SysLoadFuncs;
-
- /* Initialize the Parts List */
-
- rc = Initialize();
-
- /* Give introductory message */
-
- rc = SayIntro();
- If Abort = 'Yes' then Exit;
-
- /* Determine the current directory */
-
- currdir = Directory();
- If Abort = 'Yes' then Exit;
-
- /* Determine the source disk */
-
- sdisk = GetSource();
- If Abort = 'Yes' then Exit;
-
- /* Determine the target disk */
-
- tdisk = GetTarget();
- If Abort = 'Yes' then Exit;
-
- /* If diskette, get a clean one */
-
- rc = Getdisk(tdisk);
-
- /* Make target directories */
-
- rc = Builddir(tdisk)
-
- /* Process the parts list */
-
- rc = ProcessParts(sdisk tdisk);
- If rc <> 0 then Do;
- Say " "
- Say "TELLCOPY failed."
- End;
- else Do;
- Say " "
- Say "TELLCOPY completed successfully."
- End;
-
- /* Exit */
-
- Exit 0
-
- /***********************************************************************/
- /* Gives the introductory message. */
- /***********************************************************************/
- SayIntro: Procedure Expose Abort;
- Call SysCls;
- Say " "
- Say " "
- Say " This CMD file allows you to copy the Builder/2 Runtime Player "
- Say " files from the product directory to another directory. These "
- Say " files are required to execute a Builder/2 application. "
- Say " "
- Say " You will be prompted for the following: "
- Say " "
- Say " 1. The path for the source (for example, C:\BUILDER) "
- Say " 2. The path for the target (for example, A:\RUNTIME) "
- Say " "
- Say " This command file will: "
- Say " "
- Say " 1. Ask for the above information. "
- Say " 2. Create the specified directory. "
- Say " 3. Copy the needed files into the directory. "
- Say " "
- Say " You may cancel execution by responding with ENTER to any question. "
- Say " "
- Say " Would you like to proceed (Y/N)?"
- Pull choice .
- If (choice = "") | (choice = "N") then Do;
- Abort = 'Yes'
- Return 2;
- End;
- Return 0
- /***********************************************************************/
- /* Asks for the directory for the source disk. */
- /***********************************************************************/
- GetSource: Procedure Expose Abort;
- Say " "
- Say "Enter the source directory (for example, C:\BUILDER)"
- Pull sdisk
- If sdisk = "" then Do;
- Abort = 'Yes'
- Return 2;
- End;
- ll = Length(sdisk);
- If "\" = Substr(sdisk,ll,1) then sdisk = Substr(sdisk,1,ll-1);
- Return sdisk
- /***********************************************************************/
- /* Asks for the directory for the target disk. */
- /***********************************************************************/
- GetTarget: Procedure Expose Abort;
- Say " "
- Say "Enter the target directory (for example, A:\RUNTIME)"
- Pull tdisk
- If tdisk = "" then Do;
- Abort = 'Yes'
- Return 2;
- End;
- ll = Length(tdisk);
- If "\" = Substr(tdisk,ll,1) then tdisk = Substr(tdisk,1,ll-1);
- Return tdisk
- /***********************************************************************/
- /* Copies the parts. */
- /***********************************************************************/
- ProcessParts:
-
- Parse upper arg sdisk tdisk .
-
- currentdisk = 1;
- Say " "
- Say "Copying files..."
-
- Do i = 1 to in.0
- /* Check if it is time to change diskettes */
- If diskette = "Yes" & disk.i <> currentdisk then Do;
- Say " "
- Say "Copy to diskette completed."
- Say " "
- Say "Does your application include TIFF, TARGA, PCX, or GIF images? (Y or N)"
- Pull choice;
- If (choice = "") | (choice = "N") then Do;
- Return 0;
- End;
- rc = Getdisk(tdisk);
- rc = Builddir(tdisk);
- currentdisk = disk.i;
- end /* Do */
-
- /* Put together COPY command */
-
- part1 = "\"||sub.i||"\"||in.i
- part2 = "\"||in.i
- fromname = sdisk||part1
- toname = tdisk||part2
- rc = SysFileTree(fromname,'lookf','FT')
- Parse var lookf.1 fstamp rest
- rc = SysFileTree(toname,'lookt','FT')
- Parse var lookt.1 tstamp rest
- If (lookf.0 = 0) then Do; /* can't copy if source not there */
- Return 8
- End;
- If (lookt.0 = 0 & lookf.0 = 1) |, /* copy if not already there */
- (lookt.0 = 1 & (fstamp > tstamp)) then Do; /* copy if there and older */
- "@COPY" fromname toname
- If rc <> 0 Then Do;
- Abort = 'Yes'
- Return 8;
- End;
- End; /* If not already there */
-
- end /* do */
-
- Return 0;
- /***********************************************************************/
- /* Asks for a diskette, if needed */
- /***********************************************************************/
- Getdisk:
-
- Parse upper arg tdisk .
-
- tdrive = Substr(tdisk,1,1);
- If tdrive = "A" | tdrive = "B" then diskette = "Yes"
- else diskette = "No";
- If diskette = "Yes" Then Do;
- Say " "
- Say "Insert a blank formatted high-density diskette into the diskette drive"
- Say "Press ENTER when ready..."
- Pull choice
- End;
- Return rc
- /***********************************************************************/
- /* Creates target directories. */
- /***********************************************************************/
- Builddir:
- Parse arg tdisk .
-
- dirname = tdisk
- rc = SysMkDir(dirname)
-
- Return rc;
- /***********************************************************************/
- /* Initializes the parts array. */
- /***********************************************************************/
- Initialize:
-
- in.1 = "AVCSQL.DLL" ; sub.1 = "DLL" ; disk.1 = 1 ;
- in.2 = "PLTELLE.HLP" ; sub.2 = "HELP" ; disk.2 = 1 ;
- in.3 = "TELLPM.EXE" ; sub.3 = "BIN" ; disk.3 = 1 ;
- in.4 = "UTSAPI.DLL" ; sub.4 = "DLL" ; disk.4 = 1 ;
- in.5 = "UTSMPLDB.DLL" ; sub.5 = "DLL" ; disk.5 = 1 ;
- in.6 = "UTTLMAIN.DLL" ; sub.6 = "DLL" ; disk.6 = 1 ;
- in.7 = "UTUBCLIB.DLL" ; sub.7 = "DLL" ; disk.7 = 1 ;
- in.8 = "UTTLENG.DLL" ; sub.8 = "DLL" ; disk.8 = 1 ;
- in.9 = "REPLACE._DS" ; sub.9 = "DATA" ; disk.9 = 1 ;
- in.10 = "BOOKB._FN" ; sub.10 = "DATA" ; disk.10 = 1 ;
- in.11 = "SYSLEVEL.UB2" ; sub.11 = "INSTALL" ; disk.11 = 1 ;
- in.12 = "PCXPROC.DLL" ; sub.12 = "UTIOPROC" ; disk.12 = 2 ;
- in.13 = "TGAPROC.DLL" ; sub.13 = "UTIOPROC" ; disk.13 = 2 ;
- in.14 = "TIFPROC.DLL" ; sub.14 = "UTIOPROC" ; disk.14 = 2 ;
- in.15 = "GIFPROC.DLL" ; sub.15 = "UTIOPROC" ; disk.15 = 2 ;
- in.16 = "IOPROC.DLL" ; sub.16 = "UTIOPROC" ; disk.16 = 2 ;
- in.17 = "MMIOINI.EXE" ; sub.17 = "INSTALL" ; disk.17 = 2 ;
- in.0 = 17
-
- Return 0