home *** CD-ROM | disk | FTP | other *** search
/ ProPhone: National Telephone Directory 1993 / PCD93C2.ISO / install2 / install / inscript.eng next >
Encoding:
Text File  |  1993-07-01  |  12.0 KB  |  530 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 = PR6
  101. SET Product_Name = PROCDB
  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 \n                             ProPhone 1993\n\n
  141. ----                           Business Directory\n\n
  142. ----                          Software Version 2.2\n\n\n\n\n\n
  143. ----                    Installation (Part 2 - Business):
  144. WAIT
  145.  
  146. RETURN
  147.  
  148.  
  149.  
  150. ;****************************************************************************
  151. :Install_Where
  152.  
  153.  
  154. CLEAR
  155. TEXT The retrieval software must be installed on your hard disk or on a
  156. ---- formatted floppy disk. The standard values are drive <DestDrive> (normally
  157. ---- the hard disk), and a subdirectory named <DestDir>. To use these values,
  158. ---- press the ┘ (Enter) key twice. To alter them, type the new drive or
  159. ---- subdirectory at the appropriate prompt, then type ┘ (Enter).
  160.  
  161. INPUT 6,6,5 DestDrive = Install on drive     ?
  162. INPUT 6,8,40 DestDir = Install in directory ?
  163. SET DestPath = <DestDrive><DestDir>
  164.  
  165. IF "<DestDrive>"=="" GOTO BadDestDir
  166. IF "<DestDir>"=="\" GOTO BadDestDir
  167. IF "<DestDir>"=="" GOTO BadDestDir
  168. IF NOT DIREXISTS <DestDrive>\ GOTO BadDestDir
  169.  
  170. RETURN
  171.  
  172.  
  173.  
  174. ;****************************************************************************
  175. :BadDestDir
  176.  
  177.  
  178. CLEAR
  179. TEXT \nError -\n\n
  180. ----  The path "<DestDrive><DestDir>" is not allowed!\n
  181. ----There must be both a drive and a valid subdirectory name in order
  182. ---- to install the software.
  183. WAIT
  184.  
  185. GOTO Install_Where
  186.  
  187.  
  188.  
  189. ;****************************************************************************
  190. :PreExistsMenu
  191.  
  192.  
  193. CLEAR
  194. TEXT The directory "<DestPath>" already exists.
  195. NEWMENU ?, 3, 54
  196. MENU Remove the old version; install new version
  197. MENU Remove the old version; do not install new software
  198. MENU Alter configuration; do not copy software
  199. MENU Stop the installation without making any changes
  200.  
  201.  
  202. CHOICE 1
  203. GOSUB Replace_Delete
  204. GOTO DestDirExists
  205.  
  206. CHOICE 2
  207. GOSUB Total_Delete
  208. GOTO Script_Exit
  209.  
  210. CHOICE 3
  211. SET alter = Y
  212. IF NOT EXISTS <DestPath>\<CfgFileName> GOTO no_config
  213. DISP 5,14 Reading configuration...
  214. READCONFIG <DestPath>\<CfgFileName>
  215. :no_config
  216. GOTO DestDirExists
  217.  
  218. CHOICE 4
  219. GOTO Script_Exit
  220. ENDCHOICES
  221.  
  222.  
  223.  
  224. ;****************************************************************************
  225. :Replace_Delete
  226.  
  227.  
  228. CLEAR
  229. TEXT Deleting previous contents of <DestPath>...
  230. ; DEL <DestPath>\*.*
  231. ; DEL <DestPath>\*.
  232.  DEL <DestPath>\<Product_Name>.EXE
  233.  DEL <DestPath>\<Product_ID>HELP.HLP
  234.  DEL <DestPath>\<Product_ID>MSGS.*
  235. ; DEL <DestPath>\<Product_ID>DIAL.*
  236. ; DEL <DestPath>\<Product_ID>PRINT.*
  237.  DEL <DestPath>\FS_*.DRV
  238.  DEL <DestPath>\SC_*.DRV
  239.  
  240. RETURN
  241.  
  242.  
  243.  
  244. ;****************************************************************************
  245. :Total_Delete
  246.  
  247.  
  248. CLEAR
  249. TEXT Removing <DestPath> directory...
  250. ; DEL <DestPath>\*.*
  251. ; DEL <DestPath>\*.
  252.  DEL <DestPath>\<Product_Name>.*
  253.  DEL <DestPath>\<Product_ID>HELP.*
  254.  DEL <DestPath>\<Product_ID>MSGS.*
  255.  DEL <DestPath>\<Product_ID>*.CFG
  256. ; DEL <DestPath>\<Product_Name>.EXE
  257. ; DEL <DestPath>\<Product_ID>HELP.HLP
  258. ; DEL <DestPath>\<Product_ID>MSGS.*
  259. ; DEL <DestPath>\<Product_ID>DIAL.CFG
  260. ; DEL <DestPath>\<Product_ID>PRINT.CFG
  261. ; DEL <DestPath>\<Product_ID>SETUP.CFG
  262.  DEL <DestPath>\FS_*.DRV
  263.  DEL <DestPath>\SC_*.DRV
  264. ; SD only; DEL <DestPath>\NOTES\*.*
  265. ; SD only; DEL <DestPath>\NOTES\*.
  266. ; SD only; DEL <DestPath>\SWAP\*.*
  267. ; SD only; DEL <DestPath>\SWAP\*.
  268. ; SD only; RD <DestPath>\NOTES
  269. ; SD only; RD <DestPath>\SWAP
  270. IF NOT EXISTS <DestPath>\*.* GOTO remdest
  271.  
  272. TEXT <DestPath> directory has unknown files, directory not removed!!
  273. WAIT
  274. GOTO norem
  275.  
  276. :remdest
  277. RD <DestPath>
  278.  
  279. :norem
  280. DEL <DestDrive>\<Product_Name>.BAT
  281.  
  282. RETURN
  283.  
  284.  
  285.  
  286. ;****************************************************************************
  287. :Alter_Only
  288.  
  289.  
  290. CLEAR
  291. TEXT Updating Configuration
  292. WRITECONFIG <DestPath>\<CfgFileName>
  293. TEXT \n  Configuration Update complete!\n\n
  294. WAIT
  295. GOTO Script_Exit
  296.  
  297.  
  298.  
  299. ;****************************************************************************
  300. ; Create the destination directory
  301.  
  302. :MakeDir
  303.  
  304.  
  305. MD <DestPath>
  306. IF DIREXISTS <DestPath> GOTO okpath
  307.  
  308. ; Invalid destination directory -> ask again
  309. ; Will this work? - BadDestDir has no return but GOTO's a GOSUB with a return
  310. GOSUB BadDestDir
  311. GOTO MakeDir
  312.  
  313. :okpath
  314. ; SD only; MD <DestPath>\NOTES
  315. ; SD only; MD <DestPath>\SWAP
  316.  
  317. RETURN
  318.  
  319.  
  320.  
  321. ;****************************************************************************
  322. ; Device Driver Selection
  323.  
  324. :DevDrivers
  325.  
  326.  
  327. HSCOUNT hs
  328. IF NOT <hs>==0 GOTO have_hs
  329.  
  330. ; No CDROM device drivers are loaded
  331. GOSUB DevDrivers_None
  332.  
  333. :have_hs
  334.  
  335. SET msg =
  336. IF <hs>==1 GOTO instOne
  337.  
  338. ; SET multi_drivers = Y
  339.  
  340. TEXT A selection of CD-ROM device drivers are installed (see CONFIG.SYS):\n\n
  341. ----Select the desired CD-ROM device driver from this list of available
  342. ---- device drivers using the  and  keys. Press ┘ (Enter) when ready.\n
  343. ----Press Esc to abort installation.
  344. GOTO instMore
  345.  
  346. :instOne
  347. SET msg = A CD-ROM device driver is installed (see CONFIG.SYS):\n\n
  348.  
  349. :instMore
  350. HSDRIVER hsname = 25, 6
  351. CONFIG Driver = "<def_driver>=<hsname>"
  352. CLEAR
  353. TEXT <msg>The CD-ROM device driver selected is named "<hsname>". If this is not
  354. ---- correct, press Esc to abort the installation and check your CONFIG.SYS
  355. ---- file.\n\n
  356. WAIT
  357.  
  358. ; IF NOT "<multi_drivers>" == "Y"  GOTO done_multi_drivers
  359. ; CLEAR
  360. ; TEXT This product is a multiple disc product.  Do you wish to use additional
  361. ; ---- CD-ROM drives
  362.  
  363. ; :done_multi_drivers
  364.  
  365. RETURN
  366.  
  367.  
  368.  
  369. ;****************************************************************************
  370. :DevDrivers_None
  371.  
  372.  
  373. CLEAR
  374. TEXT  Problem -  You have no CD-ROM device drivers installed.\n\n
  375. ----Please use the install disk supplied by your CD-ROM drive manufacturer
  376. ---- to install the device driver software, and then repeat this install
  377. ---- program.\n\n
  378. ----Note: The CD-ROM drive install disk will copy some files to your system
  379. ---- disk and modify the CONFIG.SYS and AUTOEXEC.BAT files.\n
  380. ----Unless you have other programs which use the MSCDEX program, it is
  381. ---- recommended that you remove the line calling this program from your
  382. ---- AUTOEXEC.BAT file, since this software does not require it.\n\n
  383. ----Be sure to reboot after the CD-ROM drivers are installed.
  384. WAIT
  385. ABORT
  386.  
  387.  
  388.  
  389. ;****************************************************************************
  390. ; Use MSCDEX or Dataware driver instead?
  391.  
  392. :Mscdex_Option
  393. BREAK Abort_Install
  394.  
  395. CLEAR
  396. TEXT Microsoft CD-ROM Extensions (MSCDEX.EXE) may be used to communicate
  397. ---- with the CD-ROM drive.  However 'MSCDEX' is generally not necessary for this
  398. ---- product.  Since it uses more memory than would otherwise be required it
  399. ---- is recommended that it not be used unless necessary.  It is necessary if
  400. ---- you have multiple CD-ROM drive sub-units and you wish to run the product
  401. ---- on a sub-unit other than sub-unit '0'.  If you do not require it, you may
  402. ---- remove MSCDEX.EXE from your \AUTOEXEC.BAT file (where the drive's
  403. ---- INSTALL program may have put it).
  404.  
  405. NEWMENU ?, 11, 40
  406. MENU Do NOT use Microsoft CD-ROM Extensions
  407. MENU Use Microsoft CD-ROM Extensions
  408.  
  409. CHOICE 1
  410. RETURN
  411.  
  412. CHOICE 2
  413. BREAK Mscdex_Option
  414. :Mscdex_Only
  415. CLEAR
  416. TEXT When MSCDEX.EXE is executed it responds with a DOS drive letter that
  417. ---- corresponds to the CD-ROM drive.  Enter this drive letter.
  418. SET MscdexDrive =
  419. :must_have
  420. INPUT 8,6,1 MscdexDrive = CD-ROM's drive letter?
  421. IF "<MscdexDrive>" == ""  GOTO must_have
  422. BREAK Abort_Install
  423. CONFIG Driver = "FS_STD=<MscdexDrive>:\"
  424. SET DriverOk = Y
  425. RETURN
  426.  
  427. ENDCHOICES
  428.  
  429.  
  430.  
  431. ;****************************************************************************
  432. :CopyDisks
  433.  
  434.  
  435. GOSUB Disk_Insert
  436.  
  437. CLEAR
  438. TEXT Installing Application files...
  439. COPY_OPT <FromDrive>\DISK<curdisk>\<Product_Name>.* <DestPath>
  440. COPY_OPT <FromDrive>\DISK<curdisk>\<Product_ID>*.* <DestPath>
  441. COPY_OPT <FromDrive>\DISK<curdisk>\*.DRV <DestPath>
  442.  
  443. CALC curdisk = <curdisk> + 1
  444. IF EXISTS <FromDrive>MORE GOTO CopyDisks
  445.  
  446. RETURN
  447.  
  448.  
  449.  
  450. ;****************************************************************************
  451. ; Request Disk Insertion
  452.  
  453.  
  454. :disk_retry
  455. CLEAR
  456. TEXT Insert Install Disk Number <curdisk> and press ┘ (Enter) when ready.
  457. WAIT
  458.  
  459.  
  460.  
  461. :Disk_Insert
  462.  
  463. IF DIREXISTS <FromDrive>\DISK<curdisk> DO RETURN
  464.  
  465. CLEAR
  466. TEXT The disk inserted is not Installation Disk Number <curdisk> !
  467. NEWMENU ?, 3, 15
  468. MENU Retry
  469. MENU Abort
  470.  
  471. CHOICE 1
  472. GOTO disk_retry
  473. ENDCHOICES
  474.  
  475. ABORT
  476.  
  477.  
  478.  
  479. ;****************************************************************************
  480. ; Installation Success
  481.  
  482. :Config_And_Message
  483.  
  484.  
  485. CLEAR
  486. TEXT Updating Configuration
  487. WRITECONFIG <DestPath>\<CfgFileName>
  488. WRITEFILE <DestDrive>\<Product_Name>.BAT = <DestDrive>\ncd <DestDir>\n<DestPath>\<Product_Name>\ncd \\n
  489.  
  490.  
  491. CLEAR
  492. TEXT \n  Installation complete!\n\n
  493. ----A batch file was created in the <DestDrive>\ directory with the name <Product_Name>.\n\n
  494. ----To execute the program, type:\n\n
  495. ----  <Product_Name> ┘ (Enter)\n\n
  496. ----Important: In order for this command to work as shown, you must be in
  497. ---- the <DestDrive>\ directory or have it in your PATH variable.
  498.  
  499. RETURN
  500.  
  501.  
  502.  
  503. ;****************************************************************************
  504. :Abort_Install
  505.  
  506.  
  507. if "<DestPath>"=="" GOTO nofiles
  508. if "<alter>"=="Y" GOTO nofiles
  509.  
  510. CLEAR
  511. TEXT \n\n!!! Installation Aborted !!!\n\n
  512. ----   Removing any copied files...
  513. UNCOPY
  514.  
  515. :nofiles
  516. CLEAR
  517. TEXT \n\n!!! Installation Aborted !!!\n\n
  518.  
  519. WAIT
  520. GOTO Script_Exit
  521.  
  522.  
  523.  
  524. ;****************************************************************************
  525. ; Exit INSTALL.EXE
  526.  
  527.  
  528. :Script_Exit
  529. CD <$CurDir>
  530.