home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / upsmange.zip / CLIENT / INSTALL.BAT < prev    next >
DOS Batch File  |  1996-09-13  |  9KB  |  286 lines

  1. @echo off
  2. rem ****************************************************************************
  3. rem *                            UM-Client OS/2
  4. rem ***************************************************************************
  5. cls
  6. echo UM-Client 2.0 for OS/2 - Installation program V2.02
  7. echo ---------------------------------------------------
  8. echo.
  9. echo.
  10.  
  11. rem verifying if the current drive and directory is Ok
  12. rem --------------------------------------------------
  13. set BFNAME=INSTALL
  14. set BFEXT=.BAT
  15. if exist %BFNAME%%BFEXT% goto rightdr
  16. echo *************************  W A R N I N G  ******************************
  17. echo The current drive and directory must be that where %BFNAME%%BFEXT% is located.
  18. echo The command you typed is :
  19. echo %0
  20. echo To set the right current drive, type :
  21. echo X:
  22. echo where X is the drive letter of the drive where %BFNAME%%BFEXT% is located
  23. echo (most of the times, floppy drives are A: or B:, and CD-ROM drive is E:).
  24. echo After changing to the right drive, you must set the current directory :
  25. echo CD dirname
  26. echo where dirname is the entire path to the directory where %BFNAME%%BFEXT% is
  27. echo located, begining with the character \.
  28. echo You can then re-run %BFNAME% by typing :
  29. echo %BFNAME%
  30. echo ************************************************************************
  31. echo 
  32. goto abort
  33.  
  34. rem the current drive & directory is Ok
  35. rem -----------------------------------
  36. :rightdr
  37.  
  38. rem * Vérification de l'existence des utilitaires
  39. rem * -------------------------------------------
  40. if exist GETVAR.EXE if exist RECH_LIG.EXE goto copytmp
  41. echo.
  42. echo 
  43. echo Installation program cannot be run from this drive,
  44. echo set distribution disk as current disk.
  45. goto abort
  46.  
  47. rem * Tentative de copie de getvar.exe et rech_lig.exe sur disque
  48. rem * -----------------------------------------------------------
  49. :copytmp
  50. if "%temp%"=="" goto tryc
  51. xcopy GETVAR.EXE %temp%\ >nul
  52. if errorlevel 1 goto tryc
  53. set UMCT=%temp%
  54. goto drivok
  55.  
  56. :tryc
  57. xcopy GETVAR.EXE C:\ >nul
  58. if errorlevel 1 goto tryd
  59. set UMCT=C:
  60. goto drivok
  61.  
  62. :tryd
  63. xcopy GETVAR.EXE D:\ >nul
  64. if errorlevel 1 goto notmp
  65. set UMCT=D:
  66. :drivok
  67. if "%UMCT%"=="" goto enverr
  68.  
  69. rem * Demande le produit à installer
  70. rem * ------------------------------
  71. echo.
  72. echo.
  73. echo Enter your OS/2 configuration :
  74. echo  1- OS/2
  75. echo  2- LAN Server
  76. echo.
  77. echo  3- Exit installation program
  78. echo.
  79. %UMCT%\getvar.exe UMVERS %UMCT%
  80. call %UMCT%\setenv.bat
  81. if not "%UMVERS%" == "1" if not "%UMVERS%" == "2" goto abort
  82.  
  83. rem * Demande le nom du disque d'installation
  84. rem * ---------------------------------------
  85. echo Enter OS/2 system disk drive [ C: ] :
  86. %UMCT%\getvar.exe UMCD %UMCT%
  87. call %UMCT%\setenv.bat
  88. if "%UMCD%"=="" set UMCD=C:
  89. if "%UMCD%"=="" goto enverr
  90.  
  91. rem * Demande le répertoire d'installation
  92. rem * ------------------------------------
  93. echo Enter path where UM-Client is to be loaded [ \UPSMAN ] :
  94. %UMCT%\getvar.exe UMCP %UMCT%
  95. call %UMCT%\setenv.bat
  96. if "%UMCP%"=="" set UMCP=\UPSMAN
  97. if "%UMCP%"=="" goto enverr
  98.  
  99. rem * Vérifie l'existence d'une précédente installation
  100. rem * -------------------------------------------------
  101. if not exist %UMCD%%UMCP%\UMCLIENT\UMC.EXE goto language
  102. echo UM-Client is already installed. Continue (Y/N) ?
  103. %UMCT%\getvar.exe REPONS %UMCT%
  104. call %UMCT%\setenv.bat
  105. if not "%REPONS%" == "Y" if not "%REPONS%" == "y" goto abort
  106.  
  107. rem * Demande la langue des messages
  108. rem * ------------------------------
  109. :language
  110. echo The available languages for messages are :
  111. echo     FRENCH
  112. echo     ENGLISH
  113. echo Enter the language (or Q to Quit) :
  114. :retype
  115. %UMCT%\getvar.exe UMCL %UMCT%
  116. call %UMCT%\setenv.bat
  117. if "%UMCL%" == "Q" goto abort
  118. if "%UMCL%" == "q" goto abort
  119. if "%UMCL%" == "french" goto french
  120. if "%UMCL%" == "FRENCH" goto french
  121. if "%UMCL%" == "f" goto french
  122. if "%UMCL%" == "F" goto french
  123. if "%UMCL%" == "english" goto english
  124. if "%UMCL%" == "ENGLISH" goto english
  125. if "%UMCL%" == "e" goto english
  126. if "%UMCL%" == "E" goto english
  127. echo This language is not available, please retype (Q to Quit) :
  128. goto retype
  129.  
  130. rem Langue Francaise
  131. rem ----------------
  132. :french
  133. set LANGUAGE=FRA
  134. goto confirm
  135.  
  136. rem Langue Anglaise
  137. rem ---------------
  138. :english
  139. set LANGUAGE=ENG
  140. goto confirm
  141.  
  142. rem * Demande confirmation
  143. rem * --------------------
  144. :confirm
  145. echo UM-Client will be loaded to %UMCD%%UMCP%. Continue (Y/N) ?
  146. %UMCT%\getvar.exe REPONS %UMCT%
  147. call %UMCT%\setenv.bat
  148. if not "%REPONS%" == "Y" if not "%REPONS%" == "y" goto abort
  149.  
  150. rem * Sauvegarde des fichiers UMC_PAR, UMC_MESG et scripts s'ils existent
  151. rem * -------------------------------------------------------------------
  152. if not exist %UMCD%%UMCP%\UMCLIENT\*.* goto copyfiles
  153.   echo Saving existing initialization files and scripts
  154.   echo to directory %UMCD%%UMCP%\UMCLIENT\SAVE ...
  155.   if exist %UMCD%%UMCP%\UMCLIENT\UMC_*. xcopy %UMCD%%UMCP%\UMCLIENT\UMC_*. %UMCD%%UMCP%\UMCLIENT\SAVE\ >nul
  156.   if errorlevel 1 goto coperr
  157.   if exist %UMCD%%UMCP%\UMCLIENT\*.CMD xcopy %UMCD%%UMCP%\UMCLIENT\*.CMD %UMCD%%UMCP%\UMCLIENT\SAVE\ >nul
  158.   if errorlevel 1 goto coperr
  159.  
  160. :copyfiles
  161. rem * Copie des fichiers
  162. echo Copying files to directory %UMCD%%UMCP%\UMCLIENT ...
  163.  
  164. xcopy *.EXE %UMCD%%UMCP%\UMCLIENT\ >nul
  165. if errorlevel 1 goto coperr
  166. xcopy *.CMD %UMCD%%UMCP%\UMCLIENT\ >nul
  167. if errorlevel 1 goto coperr
  168. xcopy DESINST*.BAT %UMCD%%UMCP%\UMCLIENT\ >nul
  169. if errorlevel 1 goto coperr
  170. xcopy UMC_REF %UMCD%%UMCP%\UMCLIENT\ >nul
  171. if errorlevel 1 goto coperr
  172. xcopy UMC_PAR %UMCD%%UMCP%\UMCLIENT\ >nul
  173. if errorlevel 1 goto coperr
  174. xcopy UMC_PAR.TXT %UMCD%%UMCP%\UMCLIENT\ >nul
  175. if errorlevel 1 goto coperr
  176.  
  177. xcopy %LANGUAGE%\UMC_MESG %UMCD%%UMCP%\UMCLIENT\ >nul
  178. if errorlevel 1 goto coperr
  179.  
  180. if "%UMVERS%" == "1" xcopy WORKSTN\*.* %UMCD%%UMCP%\UMCLIENT\ > nul
  181. if errorlevel 1 goto error
  182. if "%UMVERS%" == "2" xcopy SERVER\*.*  %UMCD%%UMCP%\UMCLIENT\ > nul
  183. if errorlevel 1 goto error
  184.  
  185.  
  186. :sReadme2
  187. echo Copying default initialization files and scripts
  188. echo to directory %UMCD%%UMCP%\UMCLIENT\DEFAULT ...
  189. xcopy %UMCD%%UMCP%\UMCLIENT\UMC_PAR %UMCD%%UMCP%\UMCLIENT\DEFAULT\ >nul
  190. if errorlevel 1 goto coperr
  191. xcopy %UMCD%%UMCP%\UMCLIENT\UMC_MESG %UMCD%%UMCP%\UMCLIENT\DEFAULT\ >nul
  192. if errorlevel 1 goto coperr
  193. xcopy %UMCD%%UMCP%\UMCLIENT\*.CMD %UMCD%%UMCP%\UMCLIENT\DEFAULT\ >nul
  194. if errorlevel 1 goto coperr
  195.  
  196. rem * Création du fichier ETC\UMC_PATH avec création du répertoire ETC si besoin
  197. rem * --------------------------------------------------------------------------
  198. echo Creating  %UMCD%\ETC\UMC_PATH file ...
  199. if not exist %UMCD%\ETC\*.* md %UMCD%\ETC
  200. echo %UMCP%\UMCLIENT> %UMCD%\ETC\UMC_PATH
  201. if not exist %UMCD%\ETC\UMC_PATH goto coperr
  202.  
  203. rem * Installation du démarrage automatique de UM-Client
  204. rem * -------------------------------------------------
  205. echo Modifying %UMCD%\STARTUP.CMD for automatic startup...
  206. if exist %UMCD%\STARTUP.CMD goto modify
  207. echo File could not be found, automatic startup not installed.
  208. goto complete
  209.  
  210. :modify
  211. copy %UMCD%\STARTUP.CMD %UMCD%\STARTUP.UMC >nul
  212. copy %UMCD%\STARTUP.CMD %UMCD%\STARTUP.$UM >nul
  213. if not exist %UMCD%\STARTUP.UMC goto coperr
  214. if not exist %UMCD%\STARTUP.$UM goto coperr
  215. echo (Original STARTUP.CMD as been saved to STARTUP.UMC)
  216. rech_lig.exe %UMCD%\STARTUP.$UM \UMC.EXE %UMCT%
  217.  
  218. echo START /B /N /MIN %UMCP%\UMCLIENT\UMC.EXE -s>%UMCD%\STARTUP.CMD
  219. copy %UMCD%\STARTUP.CMD+%UMCD%\STARTUP.$UM %UMCD%\STARTUP.CMD >nul
  220. erase %UMCD%\STARTUP.$UM
  221.  
  222. rem * Installation terminée
  223. rem * ---------------------
  224. :complete
  225. rem  * Installation de l'UM-Editor
  226. if not exist ..\..\WIN\EDITOR\INSTALL.BAT goto fin
  227. cd ..\..\WIN\EDITOR
  228. call INSTALL.BAT %UMCD% %UMCP%
  229. cd ..\..\OS2\CLIENT
  230. echo.
  231. echo.
  232. echo UM-Client installation procedure completed.
  233. echo You must now run the UM-Client configuration utility.
  234. echo.
  235.  
  236. goto fin
  237.  
  238. rem * Pas de repertoire temporaire
  239. rem * ----------------------------
  240. :notmp
  241.   echo.
  242.   echo 
  243.   echo No temporary directory was found.
  244.   echo Set TEMP environment variable with the name of a
  245.   echo temporary working directory (ex : SET TEMP=C:\TMP).
  246.   goto abort
  247.  
  248. rem * Erreur d'environnement DOS
  249. rem * --------------------------
  250. :enverr
  251.   echo.
  252.   echo 
  253.   echo DOS environment error,
  254.   goto abort
  255.  
  256. rem * Erreur de copie
  257. rem * ---------------
  258. :coperr
  259.   echo.
  260.   echo 
  261.   echo Copy error,
  262.  
  263. :abort
  264.   echo Installation procedure aborted.
  265.   goto fin
  266.  
  267. rem * Fin des traitements
  268. rem * -------------------
  269. :fin
  270.   if not "%UMCT%"=="" if exist %UMCT%\getvar.exe erase %UMCT%\getvar.exe >nul
  271.   if not "%UMCT%"=="" if exist %UMCT%\setenv.bat erase %UMCT%\setenv.bat >nul
  272.   set UMVERS=
  273.   set UMCP=
  274.   set UMCT=
  275.   set UMCD=
  276.   set UMCL=
  277.   set REPONS=
  278.   set BFNAME=
  279.   set BFEXT=
  280.   set LANGUAGE=
  281.  
  282.   echo.
  283.   echo.
  284.   pause
  285.  
  286.