home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / PEG110.ZIP / PEGASUS.ZIP / PINSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  3KB  |  115 lines

  1. /*****************************************************************
  2.  * Pegasus Resource Monitor                                      *
  3.  * Version 1 Release 10                                          *
  4.  * (c) 1993,1994 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 10'
  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.  
  69. Say;
  70. Say 'Creating Pegasus Desktop objects.';
  71. Say;
  72.  
  73. r = Call SysCreateObject("WPFolder","Pegasus","<WP_DESKTOP>","OBJECTID=<PEGFOLDER>","update")
  74.                      
  75. if (r <> 0 ) then do
  76.  
  77.       r = Call SysCreateObject("WPProgram","Pegasus 1.10","<PEGFOLDER>",,
  78.                "EXENAME="||InstallDir||"\PEGASUS.EXE;STARTUPDIR="||InstallDir,"replace" );
  79.  
  80.       r = Call SysCreateObject("WPProgram","Pegasus Reference","<PEGFOLDER>",,
  81.                "EXENAME=VIEW.EXE;PARAMETERS="||InstallDir||"\PEGASUS.INF;STARTUPDIR="||InstallDir,"replace" );
  82.    end;
  83.  
  84. else do
  85.    say;
  86.    say   'An error occured during the creation of the Pegasus Folder ';
  87.    say   'and program objects. Contact C.O.L. Systems Inc. ';
  88.    end;
  89.  
  90. Say 'Pegasus Resource Monitor 1.10 has been installed!'
  91. Say
  92. olddir = directory();
  93. f = directory(InstallDir);
  94. 'view pegasus License And Warranty';
  95. f = directory(olddir);
  96.  
  97. Exit
  98.  
  99. /* Instructions on installation procedure */
  100.  
  101. Instructions:
  102.       Say
  103.       Say
  104.       Say '     Pegasus Resource Monitor Installation Instructions: '
  105.       Say
  106.       Say
  107.       Say 'Directions:    To install Pegasus, you must choose a target'
  108.       Say '               directory on your hard drive.'
  109.       Say
  110.       Say
  111.       Say 'Example:       PINSTALL C:\PEGASUS '
  112.       Say
  113.  
  114. Return 0;
  115.