home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 33 VDrivers / 33-VDrivers.zip / winn1000.zip / INSTE.CMD < prev    next >
OS/2 REXX Batch file  |  1996-03-25  |  7KB  |  309 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.  
  23. call SysCls
  24. readmefile = 'readme.txt'
  25. readmename = 'Read me'
  26. bDeu = "2 "
  27. fWinMan = 0
  28.  
  29.  
  30.   /* Go search for the OS2.INI file, this will be our bootdrive */
  31.   testos2path = SysSearchPath('PATH', 'OS2.INI');
  32.   bootdrive = FILESPEC("drive", testos2path);
  33.   os2path = FILESPEC("path",testos2path);
  34.   ver = SysOS2Ver()
  35.  
  36. /*-- get dest dir --*/
  37. if destdir = '' then do
  38.   say ''
  39.   say 'Please enter a directory name for ELSA Video Driver'
  40.   say '(Default: 'bootdrive'\WINOS232):'
  41.   /*-- if error --*/
  42.   parse pull destdir
  43.   if destdir = ' ' then do
  44.     destdir = bootdrive'\WINOS232'
  45.   end
  46. end
  47.  
  48.  
  49.   DestDrive = FILESPEC("drive", destdir)
  50. if sourcedir = '' then do
  51.   thisdir = directory()
  52.   say ''
  53.   say 'Please enter the directory where the program is being installed'
  54.   say 'from(Default: 'thisdir'):'
  55.   parse pull sourcedir
  56.   /*-- if another error --*/
  57.   if sourcedir = ' ' then do
  58.     sourcedir = thisdir
  59.     say 'using the current directory as the source directory.'
  60. end
  61.  
  62. /*-- make sure path is good --*/
  63. If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
  64.     sourcedir = sourcedir||'\'
  65.  
  66. SourcePath  = substr( sourcedir, 1 ,length(sourcedir) - 1 )
  67.  
  68.  
  69. /*-- do main screen --*/
  70. call SysCls
  71. say
  72. say '                   ELSA Video Driver Installation'
  73. say
  74. say 'The ELSA Video Driver will be Installed with the following settings:'
  75. say
  76. say 'Source directory: "'sourcedir'"'
  77. say 'Destination directory: "'destdir'"'
  78. say
  79. say 'Okay to continue(Y/n)?'
  80. k = SysGetKey('NOECHO')
  81. if k = 'N' | k = 'n' then do
  82.   say
  83.   say 'Installation cancelled.'
  84.   exit
  85. end
  86.  
  87.   SourceDrive = FILESPEC("drive", sourcedir)
  88.  
  89.      ScreenSys = SysSearchPath('PATH', 'screen01.sys');
  90.      "@attrib -r -h -s "||ScreenSys
  91.      if ScreenSys > ' ' then
  92.         "@copy "||ScreenSys||" "||bootdrive||os2path||"*.ibm"
  93.      call CopyDriverFiles sourcedir , destdir
  94.      "@"||DestDrive
  95.      "@CD "||destdir
  96.      DosSys = SysSearchPath('PATH', 'doskrnl');
  97.      DosPath = FILESPEC("PATH", DosSys);
  98.  
  99.      VsvgaSys = bootdrive||DosPath||"vsvga.*"
  100.      call SysFileTree VsvgaSys , 'file' , 'F'
  101.      if file.0 > 0 then do
  102.         "@attrib -r -h -s "||bootdrive||DosPath||"vsvga.sys"
  103.      end
  104.      "@attrib -r -h -s "||bootdrive||os2path||"dll\*.dll"
  105.      if DosSys > " " then
  106.         "@copy "||destdir||"\vsvga.sys "||bootdrive||DosPath||"*.*"
  107.      if (COMPARE(ver,'2.1') < 4) then do
  108.         "@copy "||destdir||"\elsainst.dll "||bootdrive||os2path||"dll"
  109.         "@copy "||bootdrive||os2path||"install\dspinstl.exe"||" "||destdir
  110.      end
  111.  
  112.      call SaveWinIni DestDrive destdir
  113.  
  114.      DSPINSTL.EXE                       /* go execute DSPINSTL */
  115.      say ""
  116. /*-- create a program object --*/
  117. call SysCls
  118. say
  119. say
  120. say
  121. say
  122. say 'ELSA Resolution Manager can be installed as an object on your desktop.'
  123. say 'Do you want to create it now(Y/n)?'
  124. k = SysGetKey('NOECHO')
  125. if k = 'N' | k = 'n' then call WinMan
  126.  
  127. say
  128. say 'Creating the program folder,'
  129. x = SysCreateObject("WPFolder",,
  130.                     "ELSA Video Configuration",,
  131.                     "<WP_DESKTOP>",,
  132.                     "OBJECTID=<ELSAFLDR>;ICONFILE="||destdir||"\wininst.ICO", "replace")
  133. if x = 0 then do
  134.   say 'Unable to create folder; cancelling.'
  135.   exit
  136. end
  137.  
  138.  
  139. say readmefile||' file,'
  140. x = SysCreateObject("WPProgram",,
  141.                     readmename,,
  142.                     "<ELSAFLDR>",,
  143.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\"||readmefile)
  144.  
  145. say 'and the Program file.'
  146. x = SysCreateObject("WPProgram",,
  147.                     "ELSA Resolution Manager",,
  148.                     "<ELSAFLDR>",,
  149.                     "EXENAME="||destdir||"\WININST.EXE;STARTUPDIR="||destdir)
  150.  
  151.  
  152. WinMan:
  153.  
  154.   winpath = strip(SysIni('USER' , 'PM_INSTALL', 'WINOS2_LOCATION'),'T',x2c('00'))
  155.  
  156.   if  winpath  = "ERROR:"  then
  157.    do
  158.        winpath = os2path||'mdos\winos2'
  159.      end
  160.  
  161.  
  162.  
  163.  
  164. winlen = length(winpath)
  165. if substr( winpath, winlen, 1 ) \= '' then do
  166.    winlen = length(winpath) - 1
  167. end
  168.  
  169.  
  170. WinManMsg:
  171. say
  172. say
  173. say
  174. say
  175. say 'Please insert the WINGUI diskette/CD '
  176. say '(diskette into drive a:) '
  177. say 'Continue ? (Y/n)'
  178. k = SysGetKey('NOECHO')
  179. if k = 'N' | k = 'n' then call GoodBye
  180.  
  181. param = bDeu||winpath
  182.  
  183. call SysFileTree sourcedir||'..\win31\winman.ex_', 'file' , 'F'
  184.  
  185. if file.0 = 0 then
  186.   do
  187.    call SysFileTree 'a:\winman.ex_', 'file' , 'F'
  188.    if file.0 = 0 then
  189.     do
  190.       BEEP(250,250)
  191.       BEEP(250,250)
  192.       call WinManMsg
  193.     end
  194.    else
  195.       "@call wmancopy.bat "||param
  196.   end
  197. else
  198.   do
  199.     "@"||SourceDrive
  200.     "@"||SourcePath
  201.     "@call wcdcopy.bat "||param
  202.     DestDrive
  203.   end
  204.  
  205.  
  206.  
  207.  
  208.  
  209. say 'Please wait, while coping and expanding the windows driver...'
  210. say
  211.  
  212. fWinMan = 1
  213.  
  214. call GoodBye
  215.  
  216.  
  217.  
  218.  
  219. GoodBye:
  220. /*-- exit with a goodbye --*/
  221.      call RestoreWinIni fWinMan DestDrive destdir
  222. call SysCls
  223. say
  224. say
  225. say
  226.      if fWinMan = 0 then do
  227.         say 'ELSA Windows Resolution Manager (WINMan) was not installed.'
  228.      end
  229.  
  230. say
  231. say 'ELSA Video Adapter Driver (V 03.18.14) was installed successfully.'
  232. say 'Please reboot your system.'
  233. say
  234. say 'ELSA Video Configuration Editor has been installed on your system.'
  235. say
  236. say 'Be sure to read the file README for up-to-date information.'
  237. say
  238. exit
  239.  
  240.  
  241. INST_EXIT:
  242.   EXIT
  243.  
  244.  
  245.  
  246. CopyDriverFiles: Arg SrcDrive , DestDir
  247.  
  248.   DestDrive = FILESPEC("drive",DestDir)
  249.   /*-- create the dest. dir --*/
  250.   "@"||DestDrive
  251.   rc = SysMkDir(DestDir)
  252.   if rc = 0 then do
  253.     say 'The directory ' DestDir ' was created successfully.'
  254.   end
  255.   else do
  256.     if SysFileTree(DestDir,file,D)>0 then
  257.     do
  258.        say 'The directory ' DestDir ' could not be created successfully; cancelling.'
  259.        exit
  260.     end
  261.   end
  262.   say 'Please wait ....'
  263.   "@xcopy "||SrcDrive||"*.* "||DestDir
  264.   return
  265.  
  266. SaveWinIni: arg backdr backcd
  267.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  268.   winpath = result
  269.   windrive = FILESPEC("drive", result);
  270.   if result = "ERROR:"  then
  271.      do
  272.      winpath = os2path||'mdos\winos2'
  273.      windrive = bootdrive
  274.      end
  275.  
  276.   "@"||windrive
  277.   "@cd "||winpath
  278.   "@copy win.ini win.tmp"
  279.  
  280.   backdr
  281.   "@cd "||backcd
  282.  
  283.  
  284.   return
  285.  
  286.  
  287. RestoreWinIni: arg fRestore backdr backcd
  288.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  289.   winpath = result
  290.   windrive = FILESPEC("drive", result);
  291.   if result = "ERROR:"  then
  292.      do
  293.      winpath = os2path||'mdos\winos2'
  294.      windrive = bootdrive
  295.      end
  296.  
  297.   "@"||windrive
  298.   "@cd "||winpath
  299.   if fRestore = 0 then do
  300.      "@copy win.tmp win.ini"
  301.   end
  302.   "@del win.tmp"
  303.  
  304.   "@"||backdr
  305.   "@cd "||backcd
  306.  
  307.   return
  308.  
  309.