home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 25 Icons / 25-Icons.zip / ticn10ih.zip / Install.CMD < prev    next >
OS/2 REXX Batch file  |  1996-03-23  |  3KB  |  125 lines

  1. /* THE OS/2 Icon Collection Installation Script */
  2. /* Modified by Fred Ng, based on the Icon Heaven installation script */
  3. /* Copyright(c) 1993-1994 by The Frobozz Magic Software Company */
  4.  
  5. call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6. call SysLoadFuncs
  7.  
  8. '@echo off'
  9.  
  10. call SysCls
  11.  
  12. say '        THE OS/2 Icon Collection #10 (Icon Heaven Edition) Installation'
  13. say ''
  14. say 'THE OS/2 Icon Collection requires Icon Heaven 1.10 to be installed, as well as'
  15. say '5MB of free space.  If you are not sure about either requirement, press "Y"'
  16. say 'followed by <Enter> to abort installation now.  Otherwise, press <Enter> to'
  17. say 'continue...'
  18. pull noih
  19.  
  20. if left(noih, 1) = 'Y' then do
  21.   say ''
  22.   say 'Installation aborted.  Install Icon Heaven, and run Install.CMD again.'
  23.   exit
  24. end
  25.  
  26. ini = value('USER_INI',,'OS2ENVIRONMENT')
  27.  
  28. tDrive = left(ini,1)
  29.  
  30. instdir=tDrive':\OS2Icons'
  31.  
  32. say 'Enter the path where THE OS/2 Icon Collection will be installed, or press'
  33. say '<Enter> to select the default path ['instdir']...'
  34. pull newdir
  35.  
  36. if newdir <> '' then
  37.   instdir = newdir
  38.  
  39. if length(instdir) = 3 then do
  40.   if substr(instdir,3,1) ='\' then
  41.     instdir = left(instdir,2)
  42. end
  43.  
  44. say 'THE OS/2 Icon Collection will be installed in ['instdir']'
  45. 'pause'
  46.  
  47. res = SysMkDir(instdir)
  48.  
  49. if res <> 0 then do
  50.   say 'The directory ['instdir'] you specified cannot be created!'
  51.   say 'Installation aborted.'
  52.   exit
  53. end
  54.  
  55. say 'Copying files to 'instdir', please wait...'
  56. 'copy *.FIM 'instdir' >nul'
  57. 'copy Folder.ICO 'instdir' >nul'
  58. 'copy ReadMe.TXT 'instdir' >nul'
  59. say 'Done.'
  60. say ''
  61.  
  62. say 'Creating THE OS/2 Icon Collection folder on your desktop...'
  63. retval = SysCreateObject('WPFolder', 'THE OS/2 Icon Collection #10;'||,
  64.                          '<WP_DESKTOP>', 'ICONFILE='instdir'\Folder.ICO;'||,
  65.                          'ICONNFILE=1,'instdir'\Folder1.ICO;'||,
  66.                          OBJECTID=<THEICNIH>', 'R')
  67. say 'Done.'
  68. say ''
  69.  
  70. 'del 'instdir'\Folder*.ICO'
  71.  
  72. call instlibs '.'
  73.  
  74. say 'Installation has been successfully completed.'
  75. say 'Do you wish to have the installation directory cleaned up? [N/y]'
  76. pull reply
  77. if left(reply, 1) = 'Y' then do
  78.   call cleanup
  79. end
  80.  
  81. exit
  82.  
  83. instlibs:
  84.  
  85. dir=ARG(1)
  86.  
  87. call SysFileTree dir'\*.FIM', 'file.', 'FO'
  88.  
  89. say 'Installing icon libraries...'
  90.  
  91. do i=1 to file.0
  92.   targ = instdir'\'filespec('n',file.i)
  93.   'copy' file.i targ '>nul'
  94.   cookie1 = charin(targ)
  95.   cookie2 = charin(targ)
  96.   if cookie1 = 'L' & cookie2 = 'I' then do
  97.     dum = charin(targ,,8)
  98.     n = ''
  99.     c = charin(targ)
  100.     do until c2d(c) = 0
  101.       n = n''c
  102.       c= charin(targ)
  103.     end
  104.     retval = SysCreateObject('FIMFolder', n, '<THEICNIH>', 'ICONLIBRARY='targ, 'R')
  105.     say 'Library 'n' added'
  106.     call stream targ,'C','CLOSE'
  107.   end
  108.   else do
  109.     call stream targ,'C','CLOSE'
  110.     'del 'targ
  111.   end
  112. end
  113.  
  114. say 'Done.'
  115. say ''
  116.  
  117. return
  118.  
  119.  
  120. cleanup:
  121.  
  122. 'del *.FIM Folder*.ICO ReadMe.TXT Install.CMD'
  123.  
  124. return
  125.