home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / autobmp.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-09-04  |  6KB  |  172 lines

  1. /* */
  2. '@echo off'
  3. cls
  4. say 'Starting The OS/2 RexxUtil Functions Please Wait...'
  5. say ''
  6. Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  7. Call SysLoadFuncs
  8. if RxFuncQuery('SysCls') <> 0 then do
  9.     say 'RexxUtil Functions Not Installed On This System!!!!!'
  10.     say 'AutoBMP must be installed manually, see AutoBMP installation'
  11.     say 'instructions for this procedure.'
  12.     say ' '
  13.     exit
  14. end
  15. call SySCLs
  16. say 'INSTALLING AutoBMP'
  17. say ''
  18. say 'Determining System Configuration Please Wait...'
  19. map = sysdrivemap()
  20. say ''
  21. say 'Available Drives: ' map
  22. say ''
  23. maxdrive = words(map)
  24. vxdll.0 = 0
  25. env             = 'OS2ENVIRONMENT'
  26. tst_path        = value('PATH',,env)
  27. os2             = pos(':\OS2',tst_path)
  28. os2             = os2 - 1
  29. os2drv          = substr(tst_path,os2,1)
  30. configfile      = os2drv||':\config.sys'
  31. vxdll. = 0
  32. ok              = sysfiletree(configfile,'vxdll','F')
  33.  
  34. if vxdll = 0 then do
  35.     say 'Can not locate OS/2 Config.Sys file, to determine LIBPATH,'
  36.     say 'VROBJ.DLL, must be manually installed into a directory'
  37.     say 'in the current OS/2 LIBPATH'
  38.     end
  39. else do
  40.     found = 'no'
  41.     say 'Searching system for VROBJ.DLL'
  42.     say ''
  43.     do until found = 'yes'
  44.         dllpath    = linein(configfile)
  45.         test       = lines(configfile)
  46.         parse value dllpath with one '=' foundlibpath
  47.             select
  48.                 when translate(one) = 'LIBPATH' then do
  49.                     curr = setlocal()
  50.                     os2drv||':'
  51.                     'cd \os2\dll'
  52.                     'set testpath='||foundlibpath
  53.                     filedll = syssearchpath('TESTPATH','VROBJ.DLL')
  54.                     curr = endlocal()
  55.                     if filedll = '' then do
  56.                             say 'Copying VrObj.dll to' os2drv||':\os2\dll'
  57.                             say ''
  58.                             say 'This DLL is required for AutoBMP to function, by copying'
  59.                             say 'it to this directory, AutoBMP will be able to be started'
  60.                             say 'without rebooting the system to initialize the dll location.'
  61.                             say ''
  62.                             say 'After AutoBMP is installed you may move this DLL to any'
  63.                             say 'directory that is in your OS/2 LIBPATH, if you wish.'
  64.                             say ''
  65.                             'copy vrobj.dll' os2drv||':\os2\dll'
  66.                             say ''
  67.                             end
  68.                     else do
  69.                         say 'VROBJ.DLL is already installed on this system.  If after'
  70.                         say 'AutoBMP installation is completed, if AutoBMP does not run correctly,'
  71.                         say 'then the VROBJ.DLL that you have may not be the latest version'
  72.                         say 'that is available.  You should replace your current VROBJ.DLL'
  73.                         say 'with the one that is included with AutoBMP.  This change was'
  74.                         say 'not done automaticly by this install program, to insure that'
  75.                         say 'any programs that you currently use that depend upon this DLL'
  76.                         say 'can be tested by you to determine if they can use the newer'
  77.                         say 'version of this DLL that is supplied with AutoBMP.'
  78.                         say ''
  79.                         say ''
  80.                         end
  81.                     leave
  82.                     end
  83.                 when test = 0 then do
  84.                     call lineout configfile
  85.                     say 'Can not locate LIBPATH in Config.Sys file,'
  86.                     say 'use manual install method for VROBJ.DLL file'
  87.                     end
  88.                 otherwise
  89.                     nop
  90.             end
  91.     end
  92. call lineout configfile
  93.  
  94. say 'The drive/directory that AutoBMP is installed on will also contain the'
  95. say 'archive file containing all of the BitMaps that are stored by AutoBMP.'
  96. say ''
  97. say 'Select a drive that has sufficient space for this archive.'
  98. say ''
  99. say 'Enter Drive Letter To Install AutoBMP On: (do not include the colon)'
  100. say 'Exampl:e   D'
  101. baddrive = 1
  102. do while baddrive = 1
  103.     pull instldrive
  104.     select
  105.         when length(instldrive) > 1 then
  106.             say 'Drive letter incorrect, do not include the colon'
  107.         otherwise do
  108.             status = sysdriveinfo(instldrive||':')
  109.             if status \= '' then
  110.                 baddrive = 0
  111.             else
  112.                 say 'Drive selection is not valid, select a valid drive to continue'
  113.         end
  114.     end
  115. end
  116. call SySCLs
  117. say 'Creating AutoBMP Directory & Installing Files'
  118. md instldrive||':\autobmp > nul'
  119. say ''
  120. copy 'autobmp.exe' instldrive||':\autobmp'
  121. copy 'autobmp.ico' instldrive||':\autobmp'
  122. copy '*.txt'       instldrive||':\autobmp > nul'
  123. say ''
  124. say 'Creating AutoBMP DesKTop OBject'
  125. classname='WPProgram'
  126. title=    'AutoBMP '
  127. location= '<WP_DESKTOP>'
  128. setup=    'OBJECTID=<AutoBMP>;'||,
  129.           'EXENAME='instldrive||':\autobmp\autobmp.EXE;'||,
  130.           'STARTUPDIR='instldrive||':\autobmp;'
  131. Call BldObj
  132. say ''
  133. say 'Creating AutoBMP StartUp Folder OBject'
  134. classname='WPProgram'
  135. title=    'AutoBMP Chg DeskTop'
  136. location= '<WP_START>'
  137. setup=    'OBJECTID=<AutoBMP_Change>;'||,
  138.           'EXENAME='instldrive||':\autobmp\autobmp.EXE;'||,
  139.           'PARAMETERS=CHANGE;'||,
  140.           'STARTUPDIR='instldrive||':\autobmp;'
  141. Call BldObj
  142.  
  143. say ''
  144. say 'AutoBMP has been installed, starting AutoBMP and creating AutoBMP.INI'
  145. say ''
  146. instldrive||':'
  147. cd instldrive||':\autobmp'
  148. autobmp
  149. say 'AutoBMP installation complete...'
  150. say ''
  151. Return
  152.  
  153.  
  154.  
  155. /* Build Object(s), this builds the objects and displays the completion
  156.    status of each build.*/
  157.  
  158. BldObj:
  159.  
  160. call charout,'Building: 'title
  161.  
  162. /* Build object using REPLACE as duplicateflag */
  163.  
  164. result = SysCreateObject(classname, title, location, setup, 'R')
  165.  
  166. If result=1 Then call charout ,'...   Object created!'
  167.   Else           call charout ,'...   Not created! Return code='result
  168.  
  169. Say '';
  170. Return
  171.  
  172.