home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / internet / snuupm21 / install.bat next >
Encoding:
DOS Batch File  |  1993-11-29  |  11.6 KB  |  321 lines

  1. @if "%debug%"=="" echo off
  2. rem -------------------------------------------------------------
  3. rem  install.bat 
  4. rem  Installs the SNUUPM package.
  5. rem  Creates directories and some newsgroups
  6. rem  Does not destroy or stomp on anything outside the snuupm system
  7. rem  without first asking. If the snuupm working directories already
  8. rem  exist, then ignore the errors from the md commands.
  9. rem -------------------------------------------------------------
  10.  
  11. Rem set snu_pku=
  12. Rem if exist pkzunzip.exe goto got_pku
  13. Rem for %%d in ( %path% ) do if exist %%d\pkunzip.exe set snu_pku=y
  14. Rem for %%d in ( %path% ) do if exist %%dpkunzip.exe set snu_pku=y
  15. Rem if "%snu_pku%"=="y" goto got_pku
  16. Rem echo PKUNZIP.EXE is not accessible on your computer. It is impossible to
  17. Rem echo install SNUUPM without this program. Install PKUNZIP.EXE so that it is
  18. Rem echo accessible via the PATH environment variable.
  19. Rem pause > nul
  20. Rem goto end
  21. Rem :got_pku
  22. Rem set snu_pku=
  23.  
  24. :get_drv
  25. if not "%sndrive%"=="" goto got_drv
  26. echo The environment variable SNDRIVE is not set. Double-check that you
  27. echo have followed the instructions in the QUICKSTART section of the 
  28. echo SNUUPMxx.DOC file correctly.
  29. pause
  30. goto end
  31. :got_drv
  32.  
  33. :chk_drv
  34. if exist %sndrive%\nul goto drv_ok
  35. echo The SNDRIVE environment variable is set to "%sndrive%" which does not
  36. echo appear to be a disk drive on your computer.
  37. pause
  38. goto end
  39. :drv_ok
  40.  
  41. set snu_p1=%sndrive%\etc\uupc
  42. set snu_p2=%sndrive%\usr\lib\snuupm
  43. set snu_f1=dmenu168.zip pmail301.zip snews191.zip
  44. set snu_f2=upc12bad.zip upc12bd1.zip upc12bd2.zip upc12bd3.zip
  45.  
  46. rem -------------------------------------------------------------
  47. rem  Check for the presence of the various packages
  48. for %%i in ( %snu_f1% ) do if not exist %%i goto no_fil
  49. for %%i in ( %snu_f2% ) do if not exist %%i goto no_fil
  50. goto got_pkgs
  51.  
  52. :no_fil
  53. echo One or more of the following files are missing:-
  54. echo %snu_f1% %snu_f2%
  55. pause
  56. goto end
  57.  
  58. :got_pkgs
  59. set snu_f1=
  60. set snu_f2=
  61. rem -------------------------------------------------------------
  62. rem  Install the snuupm files.
  63. pkunzip -d snuupm.zip %sndrive%\
  64. if errorlevel 0 goto makedirs
  65. goto badunzip
  66.  
  67. :makedirs
  68. rem if "%debug%"=="" del snuupm.zip
  69.  
  70. echo +--------------------------------------------------+
  71. echo +       Making some directories for snuupm.        +
  72. echo +..................................................+
  73. if not exist %sndrive%\usr\spool\nul md %sndrive%\usr\spool
  74. if not exist %sndrive%\usr\spool\archive\nul md %sndrive%\usr\spool\archive
  75. if not exist %sndrive%\usr\spool\mail\nul md %sndrive%\usr\spool\mail
  76. if not exist %sndrive%\usr\spool\news\nul md %sndrive%\usr\spool\news
  77. if not exist %sndrive%\usr\spool\news\incoming\nul md %sndrive%\usr\spool\news\incoming
  78. if not exist %sndrive%\usr\spool\public\nul md %sndrive%\usr\spool\public
  79. if not exist %sndrive%\usr\root\mail\nul md %sndrive%\usr\root\mail
  80. if not exist %sndrive%\tmp\nul md %sndrive%\tmp
  81. echo +       Directories made                           +
  82. echo +--------------------------------------------------+
  83.  
  84. rem -------------------------------------------------------------
  85. rem Making the history file - essentially a dummy file.
  86. echo x > %sndrive%\usr\spool\news\history
  87.  
  88. rem -------------------------------------------------------------
  89. rem Extract the required programs from each package.
  90.  
  91. pkunzip dmenu168.zip %snu_p2% dougmenu.exe
  92. if not errorlevel 0 goto badunzip
  93. pkunzip pmail301.zip %snu_p2% pmail.exe pegasus.rsc common.pmd pmdict3.pmd
  94. if not errorlevel 0 goto badunzip
  95. pkunzip snews191.zip %snu_p2% addgroup.exe compress.exe expire.exe rmgroup.exe snews.exe unbatch.exe
  96. if not errorlevel 0 goto badunzip
  97. pkunzip upc12bad.zip %snu_p2%\mdm *.mdm
  98. if not errorlevel 0 goto badunzip
  99. pkunzip upc12bad.zip %snu_p2% aliases.txt
  100. if not errorlevel 0 goto badunzip
  101. pkunzip upc12bd1.zip %snu_p2% mail.exe rmail.exe uucico.exe uuxqt.exe
  102. if not errorlevel 0 goto badunzip
  103. pkunzip upc12bd2.zip %snu_p2% uux.com uucp.com uustat.com
  104. if not errorlevel 0 goto badunzip
  105. pkunzip upc12bd3.zip %snu_p2% rnews.exe
  106. if not errorlevel 0 goto badunzip
  107.  
  108. goto goodunzip
  109. :badunzip
  110. echo.
  111. echo.
  112. echo Some files have failed to unzip. Maybe this is because you are using
  113. echo a version of pkunzip earlier than 2.04g.
  114. echo.
  115. exit
  116.  
  117. :goodunzip
  118.  
  119. rem -------------------------------------------------------------
  120. rem  Let's have a go at setting up the configuration for this computer
  121. rem -------------------------------------------------------------
  122. echo.
  123. echo.
  124. echo.
  125. echo.
  126. echo +------------------------------------------------------------------+
  127. echo + Please provide configuration information regarding your computer +
  128. echo +------------------------------------------------------------------+
  129. :get_host
  130. echo You need to provide a name for your computer. This should be
  131. echo at most 7 characters long, and should start with a letter.
  132. %sndrive%\usr\lib\snuupm\askenv Enter the name of this computer ---- /l
  133. if "%askenv%"=="" goto get_host
  134. set snu_host=%askenv%
  135.  
  136. :get_dom
  137. echo.
  138. echo You need to provide a domain name, such as "ru.ac.za", "alt.za"
  139. echo or the artificial domain "uucp".
  140. %sndrive%\usr\lib\snuupm\askenv Enter the domain name -------------- /l
  141. if "%askenv%"=="" goto get_dom
  142. set snu_dom=%askenv%
  143.  
  144. :get_org
  145. echo.
  146. echo Select a name for your setup, like "Bloggs's SNUUPM System"
  147. %sndrive%\usr\lib\snuupm\askenv Name your organization -------------
  148. if "%askenv%"=="" goto get_org
  149. set snu_org=%askenv%
  150.  
  151. :get_mdm
  152. echo.
  153. echo Choose a modem configuration file from one of these. You might have
  154. echo to edit this file (as %sndrive%\etc\uupc\modem.mdm) once the installation
  155. echo is complete.
  156. dir %sndrive%\usr\lib\snuupm\mdm\*.mdm | sort | more
  157. %sndrive%\usr\lib\snuupm\askenv Which .MDM file do you want -------- /l
  158. if "%askenv%"=="" goto get_mdm
  159. if exist %sndrive%\usr\lib\snuupm\mdm\%askenv%.mdm goto got_mdm
  160. echo You have made a mistake - try again.
  161. echo Type only the stem of the modem filename, do not type the full path
  162. echo and do not type the trailing .MDM
  163. pause
  164. goto get_mdm
  165. :got_mdm
  166. set snu_mdm=%askenv%
  167.  
  168. :get_baud
  169. echo.
  170. %sndrive%\usr\lib\snuupm\askenv What is the PC-to-Modem baud rate --
  171. if "%askenv%"=="" goto get_baud
  172. set snu_baud=%askenv%
  173.  
  174. :get_mailserver
  175. echo.
  176. echo Provide the name of the mailserver to which you will connect. This would
  177. echo be something like "kudu".
  178. %sndrive%\usr\lib\snuupm\askenv Enter the name of the mailserver --- /l
  179. if "%askenv%"=="" goto get_mailserver
  180. set snu_mailserver=%askenv%
  181.  
  182. :get_phone
  183. echo.
  184. echo Provide the phone number of the mailserver %snu_mailserver%, complete
  185. echo with any international and area codes that are necessary.
  186. echo For example, if you connect to kudu
  187. echo                               from within Grahamstown   311081
  188. echo                              from within South Africa   0461311081
  189. echo                             from outside South Africa   +27461311081
  190. %sndrive%\usr\lib\snuupm\askenv Enter the phone number -------------
  191. if "%askenv%"=="" goto get_phone
  192. set snu_phone=%askenv%
  193.  
  194. :get_passwd
  195. echo.
  196. echo Your computer has to be registered on the mailing host, and so has a
  197. echo password on that mailing host.
  198. %sndrive%\usr\lib\snuupm\askenv Enter the password on mailing host -
  199. if "%askenv%"=="" goto get_passwd
  200. set snu_passwd=%askenv%
  201.  
  202. rem -------------------------------------------------------------
  203. :check
  204. cls
  205. echo Please confirm that the following is correct:-
  206. echo ---------------------------------------------------------------------
  207. echo.    
  208. echo   Your computer is called......................... %snu_host%
  209. echo.    
  210. echo   It is registered in domain...................... %snu_dom%
  211. echo.    
  212. echo   It operates in the organization................. %snu_org%
  213. echo.    
  214. echo   Your modem is................................... %snu_mdm%
  215. echo.    
  216. echo       and it operates at a baud rate of........... %snu_baud%
  217. echo.    
  218. echo   You will connect to the mailserver called....... %snu_mailserver%
  219. echo.    
  220. echo       at telephone number......................... %snu_phone%
  221. echo.    
  222. echo   The password of your computer on the server is.. %snu_passwd%
  223. echo.    
  224. echo ---------------------------------------------------------------------
  225. %sndrive%\usr\lib\snuupm\askenv Is the above correct (y/n) /l
  226. if not "%askenv%"=="y" goto get_host
  227. echo ---------------------------------------------------------------------
  228.  
  229. echo Creating the systems file
  230. call %sndrive%\usr\lib\snuupm\utl\systems.bat
  231.  
  232. echo Creating the modem file
  233. copy %sndrive%\usr\lib\snuupm\mdm\%snu_mdm%.mdm %sndrive%\etc\uupc\modem.mdm
  234.  
  235. echo Creating the permissn file
  236. call %sndrive%\usr\lib\snuupm\utl\permissn.bat
  237.  
  238. echo Creating the uupc.rc file
  239. call %sndrive%\usr\lib\snuupm\utl\uupcrc.bat
  240.  
  241. echo Creating the passwd file
  242. call %sndrive%\usr\lib\snuupm\utl\passwd.bat
  243.  
  244. echo Creating the user called "root"
  245. call %sndrive%\usr\lib\snuupm\utl\root.bat
  246.  
  247. echo Creating a few news groups.
  248. call %sndrive%\usr\lib\snuupm\active
  249.  
  250. echo Creating callout.bat
  251. call %sndrive%\usr\lib\snuupm\utl\calloutx.bat
  252.  
  253. echo Creating the login banner
  254. call %sndrive%\usr\lib\snuupm\utl\banner.bat
  255.  
  256. echo Creating snuupm.bat
  257. call %sndrive%\usr\lib\snuupm\utl\snuupm1.bat
  258.  
  259. rem -------------------------------------------------------------
  260. rem  Compress the SNUUPM executable programs using PKLITE
  261. rem -------------------------------------------------------------
  262.  
  263. echo You will save about 330 Kb of disk space if you use PKLITE to
  264. echo compress the .COM and .EXE file of SNUUPM. You need to supply
  265. echo PKLITE.EXE yourself (ie it is not part of the SNUUPM package)
  266. %sndrive%\usr\lib\snuupm\askenv Do you want to compress the executables? (y/n) /l
  267. if not "%askenv%"=="y" goto no_pkl
  268.  
  269. set snu_pkf1=addgroup compress dougmenu expire pmail rmgroup mail
  270. set snu_pkf2=rmail rnews snews unbatch uucico uucp uustat uux uuxqt
  271. for %%f in ( %snu_pkf1% ) do pklite %sndrive%\usr\lib\snuupm\%%f
  272. for %%f in ( %snu_pkf2% ) do pklite %sndrive%\usr\lib\snuupm\%%f
  273. set snu_pkf1=
  274. set snu_pkf2=
  275.  
  276. :no_pkl
  277. echo ---------------------------------------------------------------------
  278.  
  279. rem -------------------------------------------------------------
  280. rem  Make the spool directories for the mailserver
  281. rem -------------------------------------------------------------
  282. if not exist %sndrive%\usr\spool\%snu_mailserver%/nul md %sndrive%\usr\spool\%snu_mailserver%
  283. if not exist %sndrive%\usr\spool\%snu_mailserver%\c/nul md %sndrive%\usr\spool\%snu_mailserver%\c
  284. if not exist %sndrive%\usr\spool\%snu_mailserver%\d/nul md %sndrive%\usr\spool\%snu_mailserver%\d
  285. if not exist %sndrive%\usr\spool\%snu_mailserver%\x/nul md %sndrive%\usr\spool\%snu_mailserver%\x
  286.  
  287. set snu_host=
  288. set snu_dom=
  289. set snu_org=
  290. set snu_mdm=
  291. set snu_baud=
  292. set snu_mailserver=
  293. set snu_phone=
  294. set snu_passwd=
  295. set askenv=
  296.  
  297. if "%editor%"=="" goto noedit
  298. if not exist %editor% goto noedit
  299. echo You will have to edit the file %sndrive%\etc\uupc\modem.mdm to ensure
  300. echo that the correct COM port is being used, that the DIALPREFIX (ATDP or
  301. echo ATDT) is set for pulse or tone dialing, and that the INSPEED value
  302. echo is set correctly. I will try to invoke your favourite editor if you
  303. echo will press any key for me.........
  304. pause > nul
  305. %editor% %sndrive%\etc\uupc\modem.mdm
  306. goto edited
  307.  
  308. :noedit
  309. echo Edit the file %sndrive%\etc\uupc\modem.mdm to check that the correct COM
  310. echo port is being used and that the INSPEED value is set correctly.
  311.  
  312. :edited
  313. echo ---------------------------------------------------------------------
  314. echo If the COM port is correct, then type SNUUPM and the package should run.
  315. echo ---------------------------------------------------------------------
  316.  
  317. :end
  318. set snu_p1=
  319. set snu_p2=
  320. rem ----ends-----------------------------------------------------
  321.