home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / moviemgr.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-02-13  |  5KB  |  138 lines

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