home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 33 VDrivers / 33-VDrivers.zip / winn1000.zip / INSTD.CMD < prev    next >
OS/2 REXX Batch file  |  1996-03-25  |  7KB  |  308 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.  
  25.  
  26. readmefile = 'liesmich.txt'
  27. readmename = 'Lies mich'
  28. bDeu = "1 "
  29. fWinMan = 0
  30.  
  31.  
  32.  
  33.   /* Go search for the OS2.INI file, this will be our bootdrive */
  34.   testos2path = SysSearchPath('PATH', 'OS2.INI');
  35.   bootdrive = FILESPEC("drive", testos2path);
  36.   os2path = FILESPEC("path",testos2path);
  37.   ver = SysOS2Ver()
  38.  
  39. /*-- get dest dir --*/
  40. if destdir = '' then do
  41.   say ''
  42.   say 'Bitte geben Sie das Ziel-Verzeichnis '
  43.   say 'fuer die ELSA Bildschirmtreiber an'
  44.   say '(Standardeinstellung: 'bootdrive'\WINOS232):'
  45.   /*-- if error --*/
  46.   parse pull destdir
  47.   if destdir = ' ' then do
  48.     destdir = bootdrive'\WINOS232'
  49.   end
  50. end
  51.  
  52.  
  53.   DestDrive = FILESPEC("drive", destdir)
  54. if sourcedir = '' then do
  55.   thisdir = directory()
  56.   say ''
  57.   say 'Bitte geben Sie das Quell-Verzeichniss an'
  58.   say '(Standardeinstellung: 'thisdir'):'
  59.   parse pull sourcedir
  60.   /*-- if another error --*/
  61.   if sourcedir = ' ' then do
  62.     sourcedir = thisdir
  63. end
  64.  
  65. /*-- make sure path is good --*/
  66. If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
  67.     sourcedir = sourcedir||'\'
  68.  
  69. SourcePath  = substr( sourcedir, 1 ,length(sourcedir) - 1 )
  70.  
  71. /*-- do main screen --*/
  72. call SysCls
  73. say
  74. say '                   ELSA Bildschirmtreiber Installation'
  75. say
  76. say 'Der ELSA Bildschirmtreiber wird mit folgenden '
  77. say 'Einstellungen installiert:'
  78. say
  79. say 'Quell-Verszeichnis: "'sourcedir'"'
  80. say 'Ziel-Verzeichnis  : "'destdir'"'
  81. say
  82. say 'Einstellungen in Ordnung (J/n)?'
  83. k = SysGetKey('NOECHO')
  84. if k = 'N' | k = 'n' then do
  85.   say
  86.   say 'Installation abgebrochen.'
  87.   exit
  88. end
  89.  
  90.   SourceDrive = FILESPEC("drive", sourcedir)
  91.  
  92.      ScreenSys = SysSearchPath('PATH', 'screen01.sys');
  93.      "@attrib -r -h -s "||ScreenSys
  94.      if ScreenSys > ' ' then
  95.         "@copy "||ScreenSys||" "||bootdrive||os2path||"*.ibm"
  96.      call CopyDriverFiles sourcedir , destdir
  97.      "@"||DestDrive
  98.      "@CD "||destdir
  99.      DosSys = SysSearchPath('PATH', 'doskrnl');
  100.      DosPath = FILESPEC("PATH", DosSys);
  101.      VsvgaSys = bootdrive||DosPath||"vsvga.*"
  102.      call SysFileTree VsvgaSys , 'file' , 'F'
  103.      if file.0 > 0 then do
  104.         "@attrib -r -h -s "||bootdrive||DosPath||"vsvga.sys"
  105.      end
  106.      "@attrib -r -h -s "||bootdrive||os2path||"dll\*.dll"
  107.      if DosSys > " " then
  108.         "@copy "||destdir||"\vsvga.sys "||bootdrive||DosPath||"*.*"
  109.      if (COMPARE(ver,'2.1') < 4) then do
  110.         "@copy "||destdir||"\elsainst.dll "||bootdrive||os2path||"dll"
  111.         "@copy "||bootdrive||os2path||"install\dspinstl.exe"||" "||destdir
  112.      end
  113.      call SaveWinIni DestDrive destdir
  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 'Der ELSA Resolution Manager kann als Objekt '
  123. say 'auf Ihrer Arbeitsoberflaeche installiert werden.'
  124. say 'Soll dies erfolgen (J/n) ?'
  125. k = SysGetKey('NOECHO')
  126. if k = 'N' | k = 'n' then call WinMan
  127.  
  128. say
  129. say 'Erstelle den Programm-Ordner,'
  130. x = SysCreateObject("WPFolder",,
  131.                     "ELSA Video Configuration",,
  132.                     "<WP_DESKTOP>",,
  133.                     "OBJECTID=<ELSAFLDR>;ICONFILE="||destdir||"\wininst.ICO", "replace")
  134. if x = 0 then do
  135.   say 'Fehler beim Erstellen des Programm-Ordners.'
  136.   say 'Abbruch der Installation !'
  137.   exit
  138. end
  139.  
  140.  
  141. say readmefile||' Datei,'
  142. x = SysCreateObject("WPProgram",,
  143.                     readmename,,
  144.                     "<ELSAFLDR>",,
  145.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\"||readmefile)
  146.  
  147. say 'und die Programm Datei.'
  148. x = SysCreateObject("WPProgram",,
  149.                     "ELSA Resolution Manager",,
  150.                     "<ELSAFLDR>",,
  151.                     "EXENAME="||destdir||"\WININST.EXE;STARTUPDIR="||destdir)
  152.  
  153.  
  154. WinMan:
  155.  
  156.   winpath = strip(SysIni('USER' , 'PM_INSTALL', 'WINOS2_LOCATION'),'T',x2c('00'))
  157.  
  158.   if  winpath  = "ERROR:"  then
  159.    do
  160.        winpath = os2path||'mdos\winos2'
  161.      end
  162.  
  163.  
  164.  
  165. WinManMsg:
  166. say
  167. say
  168. say
  169. say
  170. say 'Bitte legen Sie die Diskette/CD '
  171. say 'mit den ELSA Windows Treibern '
  172. say 'in das entsprechende Laufwerk ein.'
  173. say '(Diskette in Laufwerk A:)'
  174. say 'Vorgang fortsetzen ? (J/n)'
  175. k = SysGetKey('NOECHO')
  176. if k = 'N' | k = 'n' then call GoodBye
  177.  
  178. param = bDeu||winpath
  179.  
  180.  
  181. call SysFileTree sourcedir||'..\win31\winman.ex_', 'file' , 'F'
  182.  
  183. if file.0 = 0 then
  184.   do
  185.    call SysFileTree 'a:\winman.ex_', 'file' , 'F'
  186.    if file.0 = 0 then
  187.     do
  188.       BEEP(250,250)
  189.       BEEP(250,250)
  190.       call WinManMsg
  191.     end
  192.    else
  193.       "@call wmancopy.bat "||param
  194.   end
  195. else
  196.   do
  197.     "@"||SourceDrive
  198.     "@"||SourcePath
  199.     "@call wcdcopy.bat "||param
  200.     "@"||DestDrive
  201.   end
  202.  
  203.  
  204. say 'Bitte warten, die Windows Treiber '
  205. say 'werden kopiert und expandiert...'
  206. say
  207.  
  208. fWinMan = 1
  209.  
  210. call GoodBye
  211.  
  212.  
  213.  
  214.  
  215. GoodBye:
  216. /*-- exit with a goodbye --*/
  217.      call RestoreWinIni fWinMan DestDrive destdir
  218. call SysCls
  219. say
  220. say
  221. say
  222.      if fWinMan = 0 then do
  223.         say 'ELSA Windows Resolution Manager (WINMan) wurde nicht installiert.'
  224.      end
  225.  
  226. say
  227. say 'Die ELSA Bildschirmtreiber (V 03.18.14) wurden erfolgreich installiert .'
  228. say 'Bitte starten Sie ihr System neu.'
  229. say
  230. say 'Unter Verwendung des ELSA Resolution Manager '
  231. say 'kann die gewuenschte Bildschirm-Aufloesung '
  232. say 'ausgewaehlt werden.'
  233. say
  234. say 'Letzte Neuerungen und Informationen sind in '
  235. say 'der Liesmich Datei beschrieben.'
  236. say
  237. exit
  238.  
  239.  
  240. INST_EXIT:
  241.   EXIT
  242.  
  243.  
  244.  
  245. CopyDriverFiles: Arg SrcDrive , DestDir
  246.  
  247.   DestDrive = FILESPEC("drive",DestDir)
  248.   /*-- create the dest. dir --*/
  249.   "@"||DestDrive
  250.   rc = SysMkDir(DestDir)
  251.   if rc = 0 then do
  252.     say 'The directory ' DestDir ' was created successfully.'
  253.   end
  254.   else do
  255.     if SysFileTree(DestDir,file,D)>0 then
  256.     do
  257.        say 'The directory ' DestDir ' could not be created successfully; cancelling.'
  258.        exit
  259.     end
  260.   end
  261.   say 'Please wait ....'
  262.   "@xcopy "||SrcDrive||"*.* "||DestDir
  263.   return
  264.  
  265. SaveWinIni: arg backdr backcd
  266.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  267.   winpath = result
  268.   windrive = FILESPEC("drive", result);
  269.   if result = "ERROR:"  then
  270.      do
  271.      winpath = os2path||'mdos\winos2'
  272.      windrive = bootdrive
  273.      end
  274.  
  275.   "@"||windrive
  276.   "@cd "||winpath
  277.   "@copy win.ini win.tmp"
  278.  
  279.   "@"||backdr
  280.   "@cd "||backcd
  281.  
  282.  
  283.   return
  284.  
  285.  
  286. RestoreWinIni: arg fRestore backdr backcd
  287.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  288.   winpath = result
  289.   windrive = FILESPEC("drive", result);
  290.   if result = "ERROR:"  then
  291.      do
  292.      winpath = os2path||'mdos\winos2'
  293.      windrive = bootdrive
  294.      end
  295.  
  296.   "@"||windrive
  297.   "@cd "||winpath
  298.   if fRestore = 0 then do
  299.      "@copy win.tmp win.ini"
  300.   end
  301.   "@del win.tmp"
  302.  
  303.   "@"||backdr
  304.   "@cd "||backcd
  305.  
  306.   return
  307.  
  308.