home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac_os2 / osundel1.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-05-19  |  2KB  |  104 lines

  1. /*****************************************************************
  2.  * Osundel Install Program                                       *
  3.  * Version 1.0                                                   *
  4. ******************************************************************/
  5.  
  6. /* Register with REXX API extensions. */
  7.  
  8. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9. Call SysLoadFuncs
  10.  
  11. /* Initializers                 */
  12.  
  13. iFound = 0;
  14.  
  15. /* Get command line parameters. */
  16.  
  17. Parse Arg InstallDir
  18.  
  19. if InstallDir = "" then do
  20.    r=Instructions();
  21.    exit;
  22.    end;
  23.  
  24. else do
  25.  
  26.    Call SysFileTree InstallDir , "Cfiles" , "SD"
  27.    do i = 1 to Cfiles.0
  28.       if pos( translate(InstallDir) , translate(Cfiles.i) ) > 0 then do
  29.          iFound = 1;
  30.          i = Cfiles.0
  31.          end;
  32.       end;
  33.    end;
  34.  
  35. /* If the directory pointed to was not found, then create it   */
  36.  
  37. if iFound = 0 then do
  38.    r = Call SysMkDir( InstallDir );
  39.    r = delword(r,1,1);
  40.    if( r <> 0 ) then do
  41.       say;
  42.       say 'An error occured creating the specified directory rc = 'r;
  43.       'helpmsg 'r;
  44.       say 'Osundel installation aborting due to error in pathname';
  45.       r=Instructions();
  46.       exit;
  47.       end;
  48.    end;
  49.  
  50. /* Copy files. */
  51.  
  52. Call SysCls
  53.  
  54. Say
  55. Say 'Installing Osundel Version 1.0'
  56.  
  57. 'copy osundel.exe ' || InstallDir
  58. 'copy osundel.hlp ' || InstallDir
  59. 'copy osundel.ico ' || InstallDir
  60. 'copy file.lst ' || InstallDir
  61. 'copy install.cmd ' || InstallDir
  62. 'copy fileid.diz ' || InstallDir
  63.  
  64.  
  65. Say;
  66. Say 'Creating Osundel Desktop objects.';
  67. Say;
  68.  
  69. r = Call SysCreateObject("WPFolder","Osundel","<WP_DESKTOP>","OBJECTID=<OSUFOLDER>","update")
  70.                      
  71. if (r <> 0 ) then do
  72.  
  73.       r = Call SysCreateObject("WPProgram","Osundel 1.0","<OSUFOLDER>",,
  74.                "EXENAME="||InstallDir||"\OSUNDEL.EXE;STARTUPDIR="||InstallDir,"replace" );
  75.  
  76.    end;
  77.  
  78. else do
  79.    say;
  80.    say   'An error occured during the creation of the Osundel Folder ';
  81.    say   'and program objects.';
  82.    end;
  83.  
  84. Say 'Osundel has been installed!'
  85.  
  86. Exit
  87.  
  88. /* Instructions on installation procedure */
  89.  
  90. Instructions:
  91.       Say
  92.       Say
  93.       Say '     Osundel Installation Instructions: '
  94.       Say
  95.       Say
  96.       Say 'Directions:    To install Osundel, you must choose a target'
  97.       Say '               directory on your hard drive.'
  98.       Say
  99.       Say
  100.       Say 'Example:       INSTALL C:\OSUNDEL'
  101.       Say
  102.  
  103. Return 0;
  104.