home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / PEG008.ZIP / PEGASUS.ZIP / PINSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-29  |  3KB  |  118 lines

  1. /*****************************************************************
  2.  * Pegasus Resource Monitor                                      *
  3.  * Version 1 Release 7                                           *
  4.  * (c) Copyright 1993 by C.O.L. Systems Inc. All Rights Reserved.*
  5. ******************************************************************/
  6.  
  7. /* Register with REXX API extensions. */
  8.  
  9. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  10. Call SysLoadFuncs
  11.  
  12. /* Initializers                 */
  13.  
  14. iFound = 0;
  15.  
  16. /* Get command line parameters. */
  17.  
  18. Parse Arg InstallDir
  19.  
  20. if InstallDir = "" then do
  21.    r=Instructions();
  22.    exit;
  23.    end;
  24.  
  25. else do
  26.  
  27.    Call SysFileTree InstallDir , "Cfiles" , "SD"
  28.    do i = 1 to Cfiles.0
  29.       if pos( translate(InstallDir) , translate(Cfiles.i) ) > 0 then do
  30.          iFound = 1;
  31.          i = Cfiles.0
  32.          end;
  33.       end;
  34.    end;
  35.  
  36. /* If the directory pointed to was not found, then create it   */
  37.  
  38. if iFound = 0 then do
  39.    r = Call SysMkDir( InstallDir );
  40.    r = delword(r,1,1);
  41.    if( r <> 0 ) then do
  42.       say;
  43.       say 'An error occured creating the specified directory rc = 'r;
  44.       'helpmsg 'r;
  45.       say 'Pegasus installation aborting due to error in pathname';
  46.       r=Instructions();
  47.       exit;
  48.       end;
  49.    end;
  50.  
  51. /* Copy files. */
  52.  
  53. Call SysCls
  54.  
  55. Say
  56. Say 'Installing Pegasus Resource Monitor Version 1 Release 7'
  57.  
  58. 'copy pegasus.exe '||InstallDir
  59. 'copy pegasus.hlp '||InstallDir
  60. 'copy pegasus.inf '||InstallDir
  61. 'copy pegasus.ico '||InstallDir
  62. 'copy os2dcf.exe '||InstallDir
  63. 'copy dcfapi.dll '||InstallDir
  64. 'copy os2com.dll '||InstallDir
  65. 'copy readme.1st '||InstallDir
  66. 'copy register.doc '||InstallDir
  67. 'copy os2share.doc '||InstallDir
  68. 'copy pyramid2.doc '||InstallDir
  69.  
  70. Say;
  71. Say 'Creating Pegasus Desktop objects.';
  72. Say;
  73.  
  74. r = Call SysCreateObject("WPFolder","Pegasus","<WP_DESKTOP>","OBJECTID=<PEGFOLDER>")
  75.                      
  76. if (r <> 0 ) then do
  77.  
  78.       r = Call SysCreateObject("WPProgram","Pegasus 1.8","<PEGFOLDER>",,
  79.                "EXENAME="||InstallDir||"\PEGASUS.EXE;STARTUPDIR="||InstallDir );
  80.  
  81.       r = Call SysCreateObject("WPProgram","Pegasus Reference","<PEGFOLDER>",,
  82.                "EXENAME=VIEW.EXE;PARAMETERS="||InstallDir||"\PEGASUS.INF;STARTUPDIR="||InstallDir );
  83.  
  84.    end;
  85.  
  86. else do
  87.    say;
  88.    say   'An error occured during the creation of the Pegasus Folder ';
  89.    say   'and program objects. Contact C.O.L. Systems Inc. ';
  90.    end;
  91.  
  92. Say 'Pegasus Resource Monitor has been installed!'
  93. Say
  94. olddir = directory();
  95. f = directory(InstallDir);
  96. 'view pegasus License And Warranty';
  97. f = directory(olddir);
  98.  
  99. Exit
  100.  
  101. /* Instructions on installation procedure */
  102.  
  103. Instructions:
  104.       Say
  105.       Say
  106.       Say '     Pegasus Resource Monitor Installation Instructions: '
  107.       Say
  108.       Say
  109.       Say 'Directions:    To install Pegasus, you must choose a target'
  110.       Say '               directory on your hard drive.'
  111.       Say
  112.       Say
  113.       Say 'Example:       PINSTALL C:\PEGASUS '
  114.       Say
  115.  
  116. Return 0;
  117.  
  118.