home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / upsmange.zip / EDITOR / INSTALL.BAT < prev    next >
DOS Batch File  |  1996-08-29  |  6KB  |  245 lines

  1. @echo off
  2. rem ****************************************************************************
  3. rem *             UM-Editor installation program (version 1.01)
  4. rem ****************************************************************************
  5.  
  6. rem Initialisations
  7. rem ---------------
  8. set UMEDPE=
  9.  
  10. rem Installation interactive en l'absence des parametres
  11. rem ----------------------------------------------------
  12. if "%1"=="" goto inter
  13. if "%2"=="" goto inter
  14.  
  15. rem Entete installation non interactive et prise en compte des parametres
  16. rem ---------------------------------------------------------------------
  17.  
  18. set UMEDII=0
  19.  
  20. echo.
  21. echo Starting UM-Editor installation program
  22. echo.
  23.  
  24. set UMEDD=%1
  25. if "%UMEDD%"=="" goto enverr
  26. set UMEDPA=%2\UMEDITOR
  27. if "%UMEDPA%"=="" goto enverr
  28.  
  29. goto verdisk
  30.  
  31. rem Entete installation interactive
  32. rem -------------------------------
  33. :inter
  34.  
  35. set UMEDII=1
  36. cls
  37. echo.
  38. echo.
  39. echo UM-Editor - Installation program
  40. echo --------------------------------
  41. echo.
  42. echo.
  43.  
  44. rem Verification du disque courant
  45. rem ------------------------------
  46. :verdisk
  47. if not exist INSTALL.BAT goto baddir
  48.  
  49. rem Verification de l'existence des utilitaires
  50. rem -------------------------------------------
  51. if not exist GETVAR.EXE goto noutil
  52.  
  53. rem Tentative de copie de GETVAR.EXE sur disque
  54. rem -------------------------------------------
  55. if "%temp%"=="" goto tryc
  56. xcopy GETVAR.EXE %temp%\ >nul
  57. if errorlevel 1 goto tryc
  58. set UMEDT=%temp%
  59. goto drivok
  60.  
  61. :tryc
  62. xcopy GETVAR.EXE C:\ >nul
  63. if errorlevel 1 goto tryd
  64. set UMEDT=C:
  65. goto drivok
  66.  
  67. :tryd
  68. xcopy GETVAR.EXE D:\ >nul
  69. if errorlevel 1 goto notmp
  70. set UMEDT=D:
  71.  
  72. :drivok
  73. if "%UMEDII%"=="1" goto dialint
  74.  
  75. rem Verifications installation non interactive
  76. rem ==========================================
  77.  
  78. rem Verifie l'existence d'une precedente installation
  79. rem pour la mettre a jour
  80. rem -------------------------------------------------
  81. if not exist %UMEDD%\ETC\UMEDPATH goto copyfiles
  82.  
  83. %UMEDT%\getvar.exe UMEDPE %UMEDT% <%UMEDD%\ETC\UMEDPATH
  84. call %UMEDT%\setenv.bat
  85. if "%UMEDPE" == "" goto copyfiles
  86.  
  87. if not exist %UMEDD%%UMEDPE%\UMED.EXE goto copyfiles
  88.  
  89. set UMEDPA=%UMEDPE%
  90. goto copyfiles
  91.  
  92. rem Dialogue Installation interactive
  93. rem =================================
  94. :dialint
  95. rem Demande le nom du disque d'installation
  96. rem ---------------------------------------
  97. echo Enter disk where UM-Editor is to be loaded [ C: ] :
  98. %UMEDT%\getvar.exe UMEDD %UMEDT%
  99. call %UMEDT%\setenv.bat
  100. if "%UMEDD%"=="" set UMEDD=C:
  101. if "%UMEDD%"=="" goto enverr
  102.  
  103. rem Verifie l'existence d'une precedente installation
  104. rem -------------------------------------------------
  105. if not exist %UMEDD%\ETC\UMEDPATH goto askdir
  106. %UMEDT%\getvar.exe UMEDPE %UMEDT% <%UMEDD%\ETC\UMEDPATH
  107. call %UMEDT%\setenv.bat
  108. if "%UMEDPE%" == "" goto askdir
  109. if not exist %UMEDD%%UMEDPE%\UMED.EXE goto askdir
  110.  
  111. echo UM-Editor is already installed in directory %UMEDD%%UMEDPE%.
  112. echo Continue and update currently installed UM-Editor (Y/N) ?
  113. %UMEDT%\getvar.exe REPONS %UMEDT%
  114. call %UMEDT%\setenv.bat
  115. if not "%REPONS%" == "Y" if not "%REPONS%" == "y" goto abort
  116.  
  117. set UMEDPA=%UMEDPE%
  118. goto copyfiles
  119.  
  120. rem Demande le repertoire d'installation
  121. rem ------------------------------------
  122. :askdir
  123. echo Enter path where UM-Editor is to be loaded [ \UPSMAN ] :
  124. %UMEDT%\getvar.exe UMEDP %UMEDT%
  125. call %UMEDT%\setenv.bat
  126. if "%UMEDP%"=="" set UMEDP=\UPSMAN
  127. if "%UMEDP%"=="" goto enverr
  128.  
  129. set UMEDPA=%UMEDP%\UMEDITOR
  130.  
  131. rem Demande confirmation
  132. rem --------------------
  133. echo UM-Editor will be loaded from distribution disk to %UMEDD%%UMEDP%.
  134. echo Continue (Y/N) ?
  135. %UMEDT%\getvar.exe REPONS %UMEDT%
  136. call %UMEDT%\setenv.bat
  137. if not "%REPONS%" == "Y" if not "%REPONS%" == "y" goto abort
  138.  
  139. rem Copie des fichiers
  140. rem ==================
  141. :copyfiles
  142.  
  143. rem Creation du fichier ETC\UMEDPATH avec creation du repertoire ETC si besoin
  144. rem --------------------------------------------------------------------------
  145. echo Writing to file %UMEDD%\ETC\UMEDPATH ...
  146. echo.
  147. if not exist %UMEDD%\ETC\*.* md %UMEDD%\ETC >nul
  148. echo %UMEDPA%>%UMEDD%\ETC\UMEDPATH
  149. if not exist %UMEDD%\ETC\UMEDPATH goto coperr
  150.  
  151. rem Copie des fichiers
  152. rem ------------------
  153. echo Copying files to directory %UMEDD%%UMEDPA%\ ...
  154. echo.
  155. xcopy GETVAR.EXE %UMEDD%%UMEDPA%\
  156. if errorlevel 1 goto coperr
  157. xcopy XWM*.DLL %UMEDD%%UMEDPA%\
  158. if errorlevel 1 goto coperr
  159. xcopy DESINST.BAT %UMEDD%%UMEDPA%\
  160. if errorlevel 1 goto coperr
  161. xcopy DESINST1.BAT %UMEDD%%UMEDPA%\
  162. if errorlevel 1 goto coperr
  163. xcopy UMED.HLP %UMEDD%%UMEDPA%\
  164. if errorlevel 1 goto coperr
  165. xcopy UMED.EXE %UMEDD%%UMEDPA%\
  166. if errorlevel 1 goto coperr
  167.  
  168. if exist DESINST.PIF xcopy DESINST.PIF %UMEDD%%UMEDPA%\
  169. if errorlevel 1 goto coperr
  170.  
  171.  
  172. rem Installation terminee
  173. rem =====================
  174. :complete
  175. echo.
  176. if not "%UMEDPE%" == "" echo UM-Editor has been updated in directory %UMEDD%%UMEDPA%.
  177. echo UM-Editor installation procedure completed.
  178. echo.
  179. goto fin
  180.  
  181. rem Mauvais repertoire de lancement
  182. rem -------------------------------
  183. :baddir
  184.   echo.
  185.   echo 
  186.   echo Error : current directory must be directory where INSTALL.BAT is located.
  187.   goto abort
  188.  
  189. rem Utilitaires manquants
  190. rem ---------------------
  191. :noutil
  192. echo.
  193. echo 
  194. echo Error : utilities are missing on the distribution disk.
  195. goto abort
  196.  
  197. rem Pas de repertoire temporaire
  198. rem ----------------------------
  199. :notmp
  200. echo.
  201. echo 
  202. echo Error : no temporary directory was found.
  203. echo Set TEMP environment variable with the name of a
  204. echo temporary working directory (ex : SET TEMP=C:\TMP).
  205. goto abort
  206.  
  207. rem Erreur d'environnement DOS
  208. rem --------------------------
  209. :enverr
  210. echo.
  211. echo 
  212. echo Environment error,
  213. goto abort
  214.  
  215. rem Erreur de copie
  216. rem ---------------
  217. :coperr
  218. echo.
  219. echo 
  220. echo Copy error,
  221.  
  222. :abort
  223. echo Installation procedure aborted.
  224. goto fin
  225.  
  226. rem Fin des traitements
  227. rem -------------------
  228. :fin
  229.  
  230. if not "%UMEDT%"=="" if exist %UMEDT%\getvar.exe erase %UMEDT%\getvar.exe >nul
  231. if not "%UMEDT%"=="" if exist %UMEDT%\setenv.bat erase %UMEDT%\setenv.bat >nul
  232.  
  233. set UMEDT=
  234. set UMEDD=
  235. set UMEDP=
  236. set UMEDPA=
  237. set UMEDPE=
  238. set REPONS=
  239.  
  240. echo.
  241.  
  242. if "%UMEDII%"=="1" pause
  243.  
  244. set UMEDII=
  245.