home *** CD-ROM | disk | FTP | other *** search
/ ProPhone: National Telephone Directory 1993 / PCD93CB.ISO / install1 / install / inscript.eng next >
Encoding:
Text File  |  1993-07-01  |  12.3 KB  |  533 lines

  1. ; ProCD (PR1) Installation Script
  2. ; <<DPR>> Sep 04 1991 SPD angepaßt an DPR                               hg
  3. ; <<SPD>> Dec 07 1990;1.00                                              dw
  4. ; <<SPD>> Nov 11 1990;1.00                                              ak
  5. ; Modified From:
  6. ; CD Answer Installation Script - Generic                               jdk
  7. ; <<CDA>> Aug 15 1990;2.02
  8.  
  9. ; single/multiple disk version
  10. ;
  11. ;    The first disk must contain the \INSTALL directory.
  12. ;    This contains the general system files for the install
  13. ;    process and may be repeated on disk #2, etc.
  14. ;    The application specific files are kept in a directory
  15. ;    named 'DISK1'. If additional disks are required, create
  16. ;    an (empty) file on the current disk named '\MORE' and
  17. ;    put the overflow files in a directory named \DISK2 (3, 4, ...).
  18.  
  19.  
  20.  
  21. BREAK Abort_Install
  22.  
  23.  
  24.  
  25. ;>>> Initialization/Defaults Setup
  26. GOSUB Initialize
  27.  
  28.  
  29.  
  30. ;>>> Start-up screen
  31. GOSUB TitleScreen
  32.  
  33.  
  34.  
  35. ;>>> Get installation destination path
  36. GOSUB Install_Where
  37.  
  38.  
  39.  
  40. CD <DestDrive>\
  41. IF NOT DIREXISTS <DestPath> GOTO skipMenu
  42. IF NOT EXISTS <DestPath>\<Product_Name>.EXE GOTO skipMenu
  43.  
  44.  
  45.  
  46. ;>>> Install menu - install, remove, alter, abort
  47. GOTO PreExistsMenu
  48.  
  49.  
  50.  
  51. :skipMenu
  52.  
  53. ;>>> Create Product Destination Directory
  54. GOSUB MakeDir
  55.  
  56.  
  57.  
  58. :DestDirExists
  59.  
  60.  
  61. SET DriverOk = N
  62. ;>>> Use Microsoft Extensions?
  63. ;GOSUB Mscdex_Option
  64. GOSUB Mscdex_Only
  65.  
  66.  
  67.  
  68.  
  69. ;>>> Device Drivers Menu
  70. ;>>> use menu only, if mscdex not used
  71. IF "<DriverOk>"=="Y" GOTO use_msc
  72. GOSUB DevDrivers
  73. :use_msc
  74.  
  75.  
  76. IF "<alter>"=="Y" GOTO Alter_Only
  77.  
  78.  
  79.  
  80. ;>>> Copy all product files and report when finished
  81. GOSUB CopyDisks
  82. GOSUB Config_And_Message
  83. WAIT
  84.  
  85.  
  86.  
  87. ;>>> All done
  88. GOTO Script_Exit
  89.  
  90.  
  91.  
  92. ;****************************************************************************
  93. ;Initialization/Defaults
  94.  
  95. :Initialize
  96.  
  97.  
  98. ; here are some defaults:
  99.  
  100. SET Product_ID = PR5
  101. SET Product_Name = PROCD
  102. ;  default CD-ROM interface (FS_HSGEN {High Sierra} or FS_ISGEN {ISO})
  103. SET def_driver = FS_STD
  104. SET scr_type = SC_STD
  105. CONFIG Screen = "<scr_type>=<extra>"
  106. SET def_lang = <$Language>
  107. CONFIG Language = "<def_lang>"
  108. SET CfgFileName = <Product_ID>SETUP.CFG
  109.  
  110.  
  111. ; install disk
  112. PARSE_PATH <$ProgDir>
  113. SET FromDrive = <$Drive>
  114. SET curdisk = 1
  115. GOSUB Disk_Insert
  116.  
  117.  
  118. ;  default destination drive
  119. PARSE_PATH <$CurDir>
  120. SET DestDrive = C:
  121. ;what is the purpose of this (following line)???
  122. ;;;;IF NOT "<$Drive>"=="<FromDrive>" DO SET def_def = <$Drive>
  123.  
  124. ; default dest directory
  125. PARSE_PATH <DestDrive>\<Product_Name>
  126. SET DestDir = <$Dir>
  127.  
  128.  
  129. RETURN
  130.  
  131.  
  132.  
  133. ;****************************************************************************
  134. ; Display Initial Installation Screen
  135.  
  136. :TitleScreen
  137.  
  138.  
  139. CLEAR
  140. TEXT                              ProPhone 1993\n\n
  141. ----                          Telephone Directory\n\n
  142. ----                         Software Version 2.2\n\n\n
  143. ---- NOTE: The install consists of two parts:\n
  144. ----    1 - Regional (or residential) Software Install\n
  145. ----    2 - Business Software Install\n\n\n
  146. ----                    Installation (Part 1 - Regional):
  147. WAIT
  148.  
  149. RETURN
  150.  
  151.  
  152.  
  153. ;****************************************************************************
  154. :Install_Where
  155.  
  156.  
  157. CLEAR
  158. TEXT The retrieval software must be installed on your hard disk or on a
  159. ---- formatted floppy disk. The standard values are drive <DestDrive> (normally
  160. ---- the hard disk), and a subdirectory named <DestDir>. To use these values,
  161. ---- press the ┘ (Enter) key twice. To alter them, type the new drive or
  162. ---- subdirectory at the appropriate prompt, then type ┘ (Enter).
  163.  
  164. INPUT 6,6,5 DestDrive = Install on drive     ?
  165. INPUT 6,8,40 DestDir = Install in directory ?
  166. SET DestPath = <DestDrive><DestDir>
  167.  
  168. IF "<DestDrive>"=="" GOTO BadDestDir
  169. IF "<DestDir>"=="\" GOTO BadDestDir
  170. IF "<DestDir>"=="" GOTO BadDestDir
  171. IF NOT DIREXISTS <DestDrive>\ GOTO BadDestDir
  172.  
  173. RETURN
  174.  
  175.  
  176.  
  177. ;****************************************************************************
  178. :BadDestDir
  179.  
  180.  
  181. CLEAR
  182. TEXT \nError -\n\n
  183. ----  The path "<DestDrive><DestDir>" is not allowed!\n
  184. ----There must be both a drive and a valid subdirectory name in order
  185. ---- to install the software.
  186. WAIT
  187.  
  188. GOTO Install_Where
  189.  
  190.  
  191.  
  192. ;****************************************************************************
  193. :PreExistsMenu
  194.  
  195.  
  196. CLEAR
  197. TEXT The directory "<DestPath>" already exists.
  198. NEWMENU ?, 3, 54
  199. MENU Remove the old version; install new version
  200. MENU Remove the old version; do not install new software
  201. MENU Alter configuration; do not copy software
  202. MENU Stop the installation without making any changes
  203.  
  204.  
  205. CHOICE 1
  206. GOSUB Replace_Delete
  207. GOTO DestDirExists
  208.  
  209. CHOICE 2
  210. GOSUB Total_Delete
  211. GOTO Script_Exit
  212.  
  213. CHOICE 3
  214. SET alter = Y
  215. IF NOT EXISTS <DestPath>\<CfgFileName> GOTO no_config
  216. DISP 5,14 Reading configuration...
  217. READCONFIG <DestPath>\<CfgFileName>
  218. :no_config
  219. GOTO DestDirExists
  220.  
  221. CHOICE 4
  222. GOTO Script_Exit
  223. ENDCHOICES
  224.  
  225.  
  226.  
  227. ;****************************************************************************
  228. :Replace_Delete
  229.  
  230.  
  231. CLEAR
  232. TEXT Deleting previous contents of <DestPath>...
  233. ; DEL <DestPath>\*.*
  234. ; DEL <DestPath>\*.
  235.  DEL <DestPath>\<Product_Name>.EXE
  236.  DEL <DestPath>\<Product_ID>HELP.HLP
  237.  DEL <DestPath>\<Product_ID>MSGS.*
  238. ; DEL <DestPath>\<Product_ID>DIAL.*
  239. ; DEL <DestPath>\<Product_ID>PRINT.*
  240.  DEL <DestPath>\FS_*.DRV
  241.  DEL <DestPath>\SC_*.DRV
  242.  
  243. RETURN
  244.  
  245.  
  246.  
  247. ;****************************************************************************
  248. :Total_Delete
  249.  
  250.  
  251. CLEAR
  252. TEXT Removing <DestPath> directory...
  253. ; DEL <DestPath>\*.*
  254. ; DEL <DestPath>\*.
  255.  DEL <DestPath>\<Product_Name>.*
  256.  DEL <DestPath>\<Product_ID>HELP.*
  257.  DEL <DestPath>\<Product_ID>MSGS.*
  258.  DEL <DestPath>\<Product_ID>*.CFG
  259. ; DEL <DestPath>\<Product_Name>.EXE
  260. ; DEL <DestPath>\<Product_ID>HELP.HLP
  261. ; DEL <DestPath>\<Product_ID>MSGS.*
  262. ; DEL <DestPath>\<Product_ID>DIAL.CFG
  263. ; DEL <DestPath>\<Product_ID>PRINT.CFG
  264. ; DEL <DestPath>\<Product_ID>SETUP.CFG
  265.  DEL <DestPath>\FS_*.DRV
  266.  DEL <DestPath>\SC_*.DRV
  267. ; SD only; DEL <DestPath>\NOTES\*.*
  268. ; SD only; DEL <DestPath>\NOTES\*.
  269. ; SD only; DEL <DestPath>\SWAP\*.*
  270. ; SD only; DEL <DestPath>\SWAP\*.
  271. ; SD only; RD <DestPath>\NOTES
  272. ; SD only; RD <DestPath>\SWAP
  273. IF NOT EXISTS <DestPath>\*.* GOTO remdest
  274.  
  275. TEXT <DestPath> directory has unknown files, directory not removed!!
  276. WAIT
  277. GOTO norem
  278.  
  279. :remdest
  280. RD <DestPath>
  281.  
  282. :norem
  283. DEL <DestDrive>\<Product_Name>.BAT
  284.  
  285. RETURN
  286.  
  287.  
  288.  
  289. ;****************************************************************************
  290. :Alter_Only
  291.  
  292.  
  293. CLEAR
  294. TEXT Updating Configuration
  295. WRITECONFIG <DestPath>\<CfgFileName>
  296. TEXT \n  Configuration Update complete!\n\n
  297. WAIT
  298. GOTO Script_Exit
  299.  
  300.  
  301.  
  302. ;****************************************************************************
  303. ; Create the destination directory
  304.  
  305. :MakeDir
  306.  
  307.  
  308. MD <DestPath>
  309. IF DIREXISTS <DestPath> GOTO okpath
  310.  
  311. ; Invalid destination directory -> ask again
  312. ; Will this work? - BadDestDir has no return but GOTO's a GOSUB with a return
  313. GOSUB BadDestDir
  314. GOTO MakeDir
  315.  
  316. :okpath
  317. ; SD only; MD <DestPath>\NOTES
  318. ; SD only; MD <DestPath>\SWAP
  319.  
  320. RETURN
  321.  
  322.  
  323.  
  324. ;****************************************************************************
  325. ; Device Driver Selection
  326.  
  327. :DevDrivers
  328.  
  329.  
  330. HSCOUNT hs
  331. IF NOT <hs>==0 GOTO have_hs
  332.  
  333. ; No CDROM device drivers are loaded
  334. GOSUB DevDrivers_None
  335.  
  336. :have_hs
  337.  
  338. SET msg =
  339. IF <hs>==1 GOTO instOne
  340.  
  341. ; SET multi_drivers = Y
  342.  
  343. TEXT A selection of CD-ROM device drivers are installed (see CONFIG.SYS):\n\n
  344. ----Select the desired CD-ROM device driver from this list of available
  345. ---- device drivers using the  and  keys. Press ┘ (Enter) when ready.\n
  346. ----Press Esc to abort installation.
  347. GOTO instMore
  348.  
  349. :instOne
  350. SET msg = A CD-ROM device driver is installed (see CONFIG.SYS):\n\n
  351.  
  352. :instMore
  353. HSDRIVER hsname = 25, 6
  354. CONFIG Driver = "<def_driver>=<hsname>"
  355. CLEAR
  356. TEXT <msg>The CD-ROM device driver selected is named "<hsname>". If this is not
  357. ---- correct, press Esc to abort the installation and check your CONFIG.SYS
  358. ---- file.\n\n
  359. WAIT
  360.  
  361. ; IF NOT "<multi_drivers>" == "Y"  GOTO done_multi_drivers
  362. ; CLEAR
  363. ; TEXT This product is a multiple disc product.  Do you wish to use additional
  364. ; ---- CD-ROM drives
  365.  
  366. ; :done_multi_drivers
  367.  
  368. RETURN
  369.  
  370.  
  371.  
  372. ;****************************************************************************
  373. :DevDrivers_None
  374.  
  375.  
  376. CLEAR
  377. TEXT  Problem -  You have no CD-ROM device drivers installed.\n\n
  378. ----Please use the install disk supplied by your CD-ROM drive manufacturer
  379. ---- to install the device driver software, and then repeat this install
  380. ---- program.\n\n
  381. ----Note: The CD-ROM drive install disk will copy some files to your system
  382. ---- disk and modify the CONFIG.SYS and AUTOEXEC.BAT files.\n
  383. ----Unless you have other programs which use the MSCDEX program, it is
  384. ---- recommended that you remove the line calling this program from your
  385. ---- AUTOEXEC.BAT file, since this software does not require it.\n\n
  386. ----Be sure to reboot after the CD-ROM drivers are installed.
  387. WAIT
  388. ABORT
  389.  
  390.  
  391.  
  392. ;****************************************************************************
  393. ; Use MSCDEX or Dataware driver instead?
  394.  
  395. :Mscdex_Option
  396. BREAK Abort_Install
  397.  
  398. CLEAR
  399. TEXT Microsoft CD-ROM Extensions (MSCDEX.EXE) may be used to communicate
  400. ---- with the CD-ROM drive.  However 'MSCDEX' is generally not necessary for this
  401. ---- product.  Since it uses more memory than would otherwise be required it
  402. ---- is recommended that it not be used unless necessary.  It is necessary if
  403. ---- you have multiple CD-ROM drive sub-units and you wish to run the product
  404. ---- on a sub-unit other than sub-unit '0'.  If you do not require it, you may
  405. ---- remove MSCDEX.EXE from your \AUTOEXEC.BAT file (where the drive's
  406. ---- INSTALL program may have put it).
  407.  
  408. NEWMENU ?, 11, 40
  409. MENU Do NOT use Microsoft CD-ROM Extensions
  410. MENU Use Microsoft CD-ROM Extensions
  411.  
  412. CHOICE 1
  413. RETURN
  414.  
  415. CHOICE 2
  416. BREAK Mscdex_Option
  417. :Mscdex_Only
  418. CLEAR
  419. TEXT When MSCDEX.EXE is executed it responds with a DOS drive letter that
  420. ---- corresponds to the CD-ROM drive.  Enter this drive letter.
  421. SET MscdexDrive =
  422. :must_have
  423. INPUT 8,6,1 MscdexDrive = CD-ROM's drive letter?
  424. IF "<MscdexDrive>" == ""  GOTO must_have
  425. BREAK Abort_Install
  426. CONFIG Driver = "FS_STD=<MscdexDrive>:\"
  427. SET DriverOk = Y
  428. RETURN
  429.  
  430. ENDCHOICES
  431.  
  432.  
  433.  
  434. ;****************************************************************************
  435. :CopyDisks
  436.  
  437.  
  438. GOSUB Disk_Insert
  439.  
  440. CLEAR
  441. TEXT Installing Application files...
  442. COPY_OPT <FromDrive>\DISK<curdisk>\<Product_Name>.* <DestPath>
  443. COPY_OPT <FromDrive>\DISK<curdisk>\<Product_ID>*.* <DestPath>
  444. COPY_OPT <FromDrive>\DISK<curdisk>\*.DRV <DestPath>
  445.  
  446. CALC curdisk = <curdisk> + 1
  447. IF EXISTS <FromDrive>MORE GOTO CopyDisks
  448.  
  449. RETURN
  450.  
  451.  
  452.  
  453. ;****************************************************************************
  454. ; Request Disk Insertion
  455.  
  456.  
  457. :disk_retry
  458. CLEAR
  459. TEXT Insert Install Disk Number <curdisk> and press ┘ (Enter) when ready.
  460. WAIT
  461.  
  462.  
  463.  
  464. :Disk_Insert
  465.  
  466. IF DIREXISTS <FromDrive>\DISK<curdisk> DO RETURN
  467.  
  468. CLEAR
  469. TEXT The disk inserted is not Installation Disk Number <curdisk> !
  470. NEWMENU ?, 3, 15
  471. MENU Retry
  472. MENU Abort
  473.  
  474. CHOICE 1
  475. GOTO disk_retry
  476. ENDCHOICES
  477.  
  478. ABORT
  479.  
  480.  
  481.  
  482. ;****************************************************************************
  483. ; Installation Success
  484.  
  485. :Config_And_Message
  486.  
  487.  
  488. CLEAR
  489. TEXT Updating Configuration
  490. WRITECONFIG <DestPath>\<CfgFileName>
  491. WRITEFILE <DestDrive>\<Product_Name>.BAT = <DestDrive>\ncd <DestDir>\n<DestPath>\<Product_Name>\ncd \\n
  492.  
  493.  
  494. CLEAR
  495. TEXT \n  Regional installation complete!\n\n
  496. ----A batch file was created in the <DestDrive>\ directory with the name <Product_Name>.\n\n
  497. ----To execute the program, type:\n\n
  498. ----  <Product_Name> ┘ (Enter)\n\n
  499. ----Important: In order for this command to work as shown, you must be in
  500. ---- the <DestDrive>\ directory or have it in your PATH variable.\n\n
  501. ---- NOTE: Now proceeding with the Business installation.
  502. RETURN
  503.  
  504.  
  505.  
  506. ;****************************************************************************
  507. :Abort_Install
  508.  
  509.  
  510. if "<DestPath>"=="" GOTO nofiles
  511. if "<alter>"=="Y" GOTO nofiles
  512.  
  513. CLEAR
  514. TEXT \n\n!!! Installation Aborted !!!\n\n
  515. ----   Removing any copied files...
  516. UNCOPY
  517.  
  518. :nofiles
  519. CLEAR
  520. TEXT \n\n!!! Installation Aborted !!!\n\n
  521.  
  522. WAIT
  523. GOTO Script_Exit
  524.  
  525.  
  526.  
  527. ;****************************************************************************
  528. ; Exit INSTALL.EXE
  529.  
  530.  
  531. :Script_Exit
  532. CD <$CurDir>
  533.