home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / elsa_drv.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1994-06-08  |  5KB  |  178 lines

  1. /*
  2. @echo off
  3. cls
  4. echo.
  5. echo.
  6. echo ERROR:
  7. echo REXX support not installed
  8. echo You must have REXX support installed to run this
  9. echo program.
  10. echo.
  11. echo To run this program, run Selective Install from
  12. echo your System Setup folder, and install REXX or
  13. echo run install2.cmd .
  14. exit
  15. */
  16.  
  17. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  18. call SysLoadFuncs
  19. /*-- get the command line --*/
  20. parse arg sourcedir destdir
  21.  
  22.   /* Go search for the OS2.INI file, this will be our bootdrive */
  23.   testos2path = SysSearchPath('PATH', 'OS2.INI');
  24.   bootdrive = FILESPEC("drive", testos2path);
  25.   os2path = FILESPEC("path",testos2path);
  26.  
  27. /*-- get dest dir --*/
  28. if destdir = '' then do
  29.   say ''
  30.   say 'Please enter a directory name for ELSA Video Driver'
  31.   say '(Default: 'bootdrive'\WINOS232):'
  32.   /*-- if error --*/
  33.   parse pull destdir
  34.   if destdir = ' ' then do
  35.     destdir = bootdrive'\WINOS232'
  36.   end
  37. end
  38.  
  39.  
  40.   DestDrive = FILESPEC("drive", destdir)
  41. if sourcedir = '' then do
  42.   thisdir = directory()
  43.   say ''
  44.   say 'Please enter the directory where the program is being installed'
  45.   say 'from(Default: 'thisdir'):'
  46.   parse pull sourcedir
  47.   /*-- if another error --*/
  48.   if sourcedir = ' ' then do
  49.     sourcedir = thisdir
  50.     say 'using the current directory as the source directory.'
  51. end
  52.  
  53. /*-- make sure path is good --*/
  54. If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
  55.     sourcedir = sourcedir||'\'
  56.  
  57. /*-- do main screen --*/
  58. call SysCls
  59. say
  60. say '                   ELSA Video Driver Installation'
  61. say
  62. say 'The ELSA Video Driver will be Installed with the following settings:'
  63. say
  64. say 'Source directory: "'sourcedir'"'
  65. say 'Destination directory: "'destdir'"'
  66. say
  67. say 'Okay to continue(Y/n)?'
  68. k = SysGetKey('NOECHO')
  69. if k = 'N' | k = 'n' then do
  70.   say
  71.   say 'Installation cancelled.'
  72.   exit
  73. end
  74.  
  75.  
  76.      ScreenSys = SysSearchPath('PATH', 'screen01.sys');
  77.      "@attrib -r -h -s "||ScreenSys
  78.      if ScreenSys > ' ' then
  79.         "@copy "||ScreenSys||" "||bootdrive||os2path||"*.ibm"
  80.      call CopyDriverFiles sourcedir , destdir
  81.      DestDrive
  82.      "@CD "||destdir
  83.      DosSys = SysSearchPath('PATH', 'command.com');
  84.      DosPath = FILESPEC("PATH", DosSys);
  85.      "@attrib -r -h -s "||bootdrive||DosPath||"vsvga.sys"
  86.      "@attrib -r -h -s "||bootdrive||os2path||"dll\*.dll"
  87.      if DosSys > " " then
  88.         "@copy "||destdir||"\vsvga.sys "||bootdrive||DosPath||"*.*"
  89.      DSPINSTL.EXE                       /* go execute DSPINSTL */
  90.      say ""
  91. /*-- create a program object --*/
  92. call SysCls
  93. say
  94. say
  95. say
  96. say
  97. say 'ELSA Video Configuration Editor can be installed as an object on your desktop.'
  98. say 'Do you want to create it now(Y/n)?'
  99. k = SysGetKey('NOECHO')
  100. if k = 'N' | k = 'n' then call GoodBye
  101.  
  102. say
  103. say 'Creating the program folder,'
  104. x = SysCreateObject("WPFolder",,
  105.                     "ELSA Video Configuration",,
  106.                     "<WP_DESKTOP>",,
  107.                     "OBJECTID=<ELSAFLDR>;ICONFILE="||destdir||"\wininst.ICO", "replace")
  108. if x = 0 then do
  109.   say 'Unable to create folder; cancelling.'
  110.   exit
  111. end
  112.  
  113.  
  114. say 'ReadMe file,'
  115. x = SysCreateObject("WPProgram",,
  116.                     "Read Me",,
  117.                     "<ELSAFLDR>",,
  118.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\README")
  119.  
  120. say 'Liesmich file,'
  121. x = SysCreateObject("WPProgram",,
  122.                     "Lies mich",,
  123.                     "<ELSAFLDR>",,
  124.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\LIESMICH")
  125.  
  126. say 'and the Program file.'
  127. x = SysCreateObject("WPProgram",,
  128.                     "ELSA Video Configuration Editor",,
  129.                     "<ELSAFLDR>",,
  130.                     "EXENAME="||destdir||"\WININST.EXE;STARTUPDIR="||destdir)
  131.  
  132.  
  133. GoodBye:
  134. /*-- exit with a goodbye --*/
  135. call SysCls
  136. say
  137. say
  138. say
  139. say
  140. say 'ELSA Video Adapter File  was installed successfully.'
  141. say 'Please reboot your system.'
  142. say
  143. say 'ELSA Video Configuration Editor has been installed on your system.'
  144. say
  145. say 'Be sure to read the file README for up-to-date information.'
  146. say
  147. say 'Press any key to exit installation...'
  148. k = SysGetKey('NOECHO')
  149. call SysCls
  150. "@start e.exe "||destdir||"\readme"
  151. exit
  152.  
  153.  
  154. INST_EXIT:
  155.   EXIT
  156.  
  157.  
  158.  
  159. CopyDriverFiles: Arg SrcDrive , DestDir
  160.  
  161.   DestDrive = FILESPEC("drive",DestDir)
  162.   /*-- create the dest. dir --*/
  163.   DestDrive
  164.   rc = SysMkDir(DestDir)
  165.   if rc = 0 then do
  166.     say 'The directory ' DestDir ' was created successfully.'
  167.   end
  168.   else do
  169.     if SysFileTree(DestDir,file,D)>0 then
  170.     do
  171.        say 'The directory ' DestDir ' could not be created successfully; cancelling.'
  172.        exit
  173.     end
  174.   end
  175.   say 'Please wait ....'
  176.   "@xcopy "||SrcDrive||"*.* "||DestDir
  177.   return
  178.