home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / base32pr.zip / Install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-05-28  |  2KB  |  100 lines

  1. /* REXX Base32 install script */
  2. /* 14/03/97  Kelvin Ussher */
  3. '@echo off'
  4.  
  5. Base32Drive = ''
  6. OS2Drive =    '' 
  7. parse upper arg Base32Drive OS2Drive 
  8. if Base32Drive = '' then Base32Drive = 'C:'
  9. if OS2Drive    = '' then OS2Drive    = 'C:'
  10.  
  11.  
  12. SAY 'Installing base32 to ' || base32Drive || '\base32. Please wait...'
  13.  
  14. Base32Drive 
  15. 'if not exist \base32 md \base32'
  16. 'cd \base32'
  17. 'copy a:\*.zip \base32' 
  18. 'a:\unzip \base32\*.zip *'
  19.  
  20.  
  21.  
  22. /* change to the drive where os2 is installed */
  23. OS2Drive
  24.  
  25. 'copy \config.sys \config.bak'
  26.  
  27. call lineout "\config.sys",,1
  28.  
  29. do until lines('\config.bak') = 0
  30.  
  31.   curline = linein('\config.bak')
  32.   subline = translate( substr(curline,1,8) )
  33.  
  34.   select
  35.  
  36.     /* Make sure FROOT\DLL is in the LIBPATH */
  37.     when subline = "LIBPATH=" then
  38.       do
  39.  
  40.         if right(curline,1) <> ";" then do
  41.           /* append a semicolon */
  42.           curline = curline';'
  43.         end
  44.  
  45.         if pos("BASE32",curline) = 0 then
  46.         do
  47.           parse var curline "LIBPATH="rest
  48.           call lineout "\config.sys", "LIBPATH="|| Base32Drive || "\BASE32;" || rest
  49.           say "Added "|| Base32Drive || "\BASE32; to LIBPATH"
  50.         end
  51.         else
  52.         do
  53.           call lineout "\config.sys", curline
  54.         end
  55.       end
  56.  
  57.     when subline = "SET PATH" then
  58.       do
  59.  
  60.         if right(curline,1) <> ";" then do
  61.           /* append a semicolon */
  62.           curline = curline';'
  63.         end
  64.  
  65.         if pos( "BASE32",curline) = 0 then
  66.         do
  67.           call lineout "\config.sys", curline || base32Drive || "\base32;"
  68.           say "Appended " || base32Drive || "\base32; to PATH"
  69.         end
  70.         else
  71.         do
  72.           call lineout "\config.sys", curline
  73.         end
  74.       end
  75.  
  76.     /* For all other lines leave it alone */
  77.     otherwise
  78.       do
  79.         call lineout "\config.sys", curline
  80.       end
  81.   end
  82. end
  83.  
  84. call lineout "\config.sys"
  85.  
  86.  
  87. /* now put a folder and program icon on the desktop */
  88.  
  89. CALL RxFuncAdd 'SysCreateObject','RexxUtil','SysCreateObject' 
  90.  
  91. If SysCreateObject( "WPFolder" , "Base32" , "<WP_DESKTOP>" , "OBJECTID=<BASE32>" ) Then
  92.  
  93.   IF SysCreateObject( "WPProgram" , "Base32" , "<BASE32>" ,"EXENAME="||Base32Drive||"\BASE32\BASE32.EXE" ) then 
  94.     SAY 'All complete, please re-start OS/2 to effect the changes to config.sys'
  95.   else 
  96.     SAY 'could not create base32 program icon' 
  97.  
  98. ELSE 
  99.    SAY 'Could not create base32 folder'
  100.