home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ptdem3.zip / PTINST.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  4KB  |  126 lines

  1. /*****************************************************************
  2.  * Pegasus Tools and PegRexx                                     *
  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 tools 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 Tools Version 1 Release 10'
  57.  
  58. 'copy *.dll '||InstallDir
  59. 'copy *.exe '||InstallDir
  60. 'copy *.hlp '||InstallDir
  61. 'copy *.ico '||InstallDir
  62. 'copy *.inf '||InstallDir
  63. 'copy *.cmd '||InstallDir
  64. 'copy *.log '||InstallDir
  65. 'copy *.doc '||InstallDir
  66. 'copy readme.1st '||InstallDir
  67.  
  68. Say;
  69. Say 'Creating Pegasus Tools Desktop objects.';
  70. Say;
  71.  
  72. r = Call SysCreateObject("WPFolder","Pegasus","<WP_DESKTOP>","OBJECTID=<PEGFOLDER>","update")
  73.                      
  74. if (r <> 0 ) then do
  75.  
  76.       r = Call SysCreateObject("WPProgram","AppMon 1.10","<PEGFOLDER>",,
  77.                "EXENAME="||InstallDir||"\APPMON.EXE;STARTUPDIR="||InstallDir, "replace" );
  78.  
  79.       r = Call SysCreateObject("WPProgram","FileMon 1.10","<PEGFOLDER>",,
  80.                "EXENAME="||InstallDir||"\FILEMON.EXE;STARTUPDIR="||InstallDir, "replace" );
  81.                
  82.       r = Call SysCreateObject("WPProgram","CacheMon 1.10","<PEGFOLDER>",,
  83.                "EXENAME="||InstallDir||"\CACHEMON.EXE;STARTUPDIR="||InstallDir, "replace" );
  84.                
  85.       r = Call SysCreateObject("WPProgram","Pegasus Tools Reference","<PEGFOLDER>",,
  86.                "EXENAME=VIEW.EXE;PARAMETERS="||InstallDir||"\PEGTOOLS.INF;STARTUPDIR="||InstallDir, "replace"  );
  87.                
  88.       r = Call SysCreateObject("WPProgram","Pegasus Rexx Extension Reference","<PEGFOLDER>",,
  89.                "EXENAME=VIEW.EXE;PARAMETERS="||InstallDir||"\PEGREXX.INF;STARTUPDIR="||InstallDir, "replace"  );
  90.    end;
  91.  
  92. else do
  93.    say;
  94.    say   'An error occured during the creation of the Pegasus Folder ';
  95.    say   'and program objects. Contact C.O.L. Systems Inc. ';
  96.    end;
  97.  
  98. Say 'Pegasus Tools and PegRexx 1.10 has been installed!'
  99. Say
  100. olddir = directory();
  101. f = directory(InstallDir);
  102. 'view pegtools License And Warranty';
  103. f = directory(olddir);
  104.  
  105. Exit
  106.  
  107. /* Instructions on installation procedure */
  108.  
  109. Instructions:
  110.       Say
  111.       Say
  112.       Say '     Pegasus Tools Installation Instructions: '
  113.       Say
  114.       Say
  115.       Say 'Directions:    To install Pegasus tools, you must choose a target'
  116.       Say '               directory on your hard drive.'
  117.       Say
  118.       Say '               If you have the Pegasus Resource Monitor Installed'
  119.       Say '               you should install to that directory.'
  120.       Say
  121.       Say
  122.       Say 'Example:       PTINST C:\PEGASUS '
  123.       Say
  124.  
  125. Return 0;
  126.