home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 25 Icons / 25-Icons.zip / theicn07.zip / Install.CMD < prev    next >
OS/2 REXX Batch file  |  1995-02-25  |  3KB  |  122 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 #7 Installation'
  13. say ''
  14. say 'THE OS/2 Icon Collection requires Icon Heaven 1.05 to be installed, as well as'
  15. say '3.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', '<WP_DESKTOP>', 'ICONFILE='instdir'\Folder.ICO;OBJECTID=<OS2_ICONS>', 'R')
  64. say 'Done.'
  65. say ''
  66.  
  67. 'del 'instdir'\Folder.ICO'
  68.  
  69. call instlibs '.'
  70.  
  71. say 'Installation has been successfully completed.'
  72. say 'Do you wish to have the installation directory cleaned up? [N/y]'
  73. pull reply
  74. if left(reply, 1) = 'Y' then do
  75.   call cleanup
  76. end
  77.  
  78. exit
  79.  
  80. instlibs:
  81.  
  82. dir=ARG(1)
  83.  
  84. call SysFileTree dir'\*.FIM', 'file.', 'FO'
  85.  
  86. say 'Installing icon libraries...'
  87.  
  88. do i=1 to file.0
  89.   targ = instdir'\'filespec('n',file.i)
  90.   'copy' file.i targ '>nul'
  91.   cookie1 = charin(targ)
  92.   cookie2 = charin(targ)
  93.   if cookie1 = 'L' & cookie2 = 'I' then do
  94.     dum = charin(targ,,8)
  95.     n = ''
  96.     c = charin(targ)
  97.     do until c2d(c) = 0
  98.       n = n''c
  99.       c= charin(targ)
  100.     end
  101.     retval = SysCreateObject('FIMFolder', n, '<OS2_ICONS>', 'ICONLIBRARY='targ, 'R')
  102.     say 'Library 'n' added'
  103.     call stream targ,'C','CLOSE'
  104.   end
  105.   else do
  106.     call stream targ,'C','CLOSE'
  107.     'del 'targ
  108.   end
  109. end
  110.  
  111. say 'Done.'
  112. say ''
  113.  
  114. return
  115.  
  116.  
  117. cleanup:
  118.  
  119. 'del *.FIM Folder.ICO ReadMe.txt Install.CMD'
  120.  
  121. return
  122.