home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / PMP207.ZIP / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-23  |  4KB  |  124 lines

  1. /*********************************************************************
  2. PM Patrol installation
  3. *********************************************************************/
  4. trace 'O'
  5. address CMD
  6.  
  7. '@ECHO OFF'
  8. 'cls'
  9. say "PM Patrol Installation"
  10. say "----------------------"
  11.  
  12. /*********************************************************************
  13. Initialization
  14. *********************************************************************/
  15. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  16. call sysloadfuncs
  17.  
  18. instdrive = ''
  19. instpath = ''
  20. bootdrive = Substr(Translate(Value('PATH',,'OS2ENVIRONMENT')),Pos('\OS2\SYSTEM',Translate(Value('PATH',,'OS2ENVIRONMENT')))-2,2)
  21.  
  22. /*********************************************************************
  23. Get the installation drive
  24. *********************************************************************/
  25. say ""
  26. say "Please enter the drive to install upon: (ie. C:)"
  27. parse Upper Pull instdrive
  28. if instdrive == '' then do
  29.   instdrive=bootdrive
  30. end
  31. if right(instdrive, 1)<>':' then do
  32.   instdrive=instdrive||':'
  33. end 
  34.  
  35. /*********************************************************************
  36. Get the installation path
  37. *********************************************************************/
  38. say ""
  39. say "PM Patrol creates a subdirectory called PMP for it's files."
  40. say "Please enter the directory where PMP should be placed: (blank for root)"
  41. parse Upper Pull intpath
  42. if intpath <> '' then do
  43.   if left(intpath, 1) <> '\' then do
  44.     intpath='\'||intpath
  45.   end
  46. end
  47. intpath=instdrive||intpath
  48. instpath=intpath||"\PMP"
  49.  
  50. /*********************************************************************
  51. verify installation drive and path
  52. *********************************************************************/
  53. say ""
  54. say "PM Patrol will be installed in: " instpath
  55. say "Is this correct? (Y/N)"
  56. parse Upper Pull response
  57. if response <> 'Y' then do
  58.   say "PM Patrol installation aborted.  Nothing installed."
  59.   exit 1
  60. end
  61.  
  62. /*********************************************************************
  63. ask about wps objects
  64. *********************************************************************/
  65. say ""
  66. say "Create the desktop PM Patrol Workplace Shell objects? (Y/N)"
  67. parse Upper Pull wpsind
  68.  
  69. say ""
  70. 'md ' intpath  ' 1>nul 2>nul'
  71. 'md ' instpath ' 1>nul 2>nul'
  72. say "Installing PM Patrol files..."
  73. 'copy * ' instpath ' 1>nul'
  74. if rc <> 0 then do
  75.   say "Problem copying files to " instpath
  76.   exit 1
  77. end
  78.  
  79. /*********************************************************************
  80. Define and Create the Folder
  81. *********************************************************************/
  82. if wpsind == 'Y' then do
  83.   say "Creating WorkPlace objects..."
  84.  
  85.   foldobj='<PMPatrol>'
  86.   foldtitle='PM Patrol'
  87.   foldicon='pmpfoldr.ico'
  88.  
  89.   call SysCreateObject 'WPFolder', foldtitle,'<WP_DESKTOP>','OBJECTID='||foldobj||';ICONFILE='||instpath||'\'||foldicon||';','R'
  90.  
  91.   /*********************************************************************
  92.   Create Reference Program ICONs in the Folder
  93.   *********************************************************************/
  94.   progobj='PMP_Info'
  95.   progname='view.exe'
  96.   progtitle='Information'
  97.   progpath=bootdrive||'\os2'
  98.   progtype='PM'
  99.   progparm='pmpatrol.inf'
  100.   call CreateProgram
  101.  
  102.   progobj='PMP_Patrol'
  103.   progname='pmpatrol.exe'
  104.   progtitle='PM Patrol'
  105.   progpath=instpath
  106.   progtype='PM'
  107.   progparm=''
  108.   call CreateProgram
  109. end
  110.  
  111. /*********************************************************************
  112. let em know everything ok
  113. *********************************************************************/
  114. say ""
  115. say "PM Patrol sucessfully installed."
  116. exit 0
  117.  
  118. /*********************************************************************
  119. create a program object in a folder
  120. *********************************************************************/
  121. CreateProgram:
  122.   call SysCreateObject 'WPProgram',progtitle,foldobj,'OBJECTID='||progobj||';EXENAME='||progpath||'\'||progname||';PROGTYPE='||progtype||';PARAMETERS='||progparm||';STARTUPDIR='||instpath||';','R'
  123.   return
  124.