home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 November / PCO1197.ISO / FilesBBS / OS2 / 4OS2300.ARJ / 4OS2300.ZIP / _4INST.BTM (.txt) next >
Encoding:
4DOS Compressed Batch-To-Memory File  |  1997-07-24  |  21.8 KB  |  950 lines

  1. @*echo off
  2. *setlocal
  3. *unalias *
  4. on errormsg goto on_error
  5. on break goto on_break
  6. goto start
  7.  
  8. text > nul
  9.  
  10.              _4INST.BTM -- 4DOS, 4OS2, and 4NT Self-Install
  11.  
  12.          Copyright 1997, JP Software Inc., All Rights Reserved.
  13.           Author:  Tom Rawson   Last Revision:  July 21, 1997
  14.  
  15. This file is used to install a downloaded copy of 4DOS, 4OS2, or 4NT.
  16. It performs basic installation functions once, then renames itself so it
  17. will not be run automatically a second time.
  18.  
  19. DO NOT MODIFY THIS FILE UNLESS INSTRUCTED TO DO SO BY OUR SUPPORT STAFF.
  20. We cannot provide support for the installation process if you have
  21. modified the installation batch file!
  22.  
  23. The primary functions provided by this file are:
  24.  
  25.    * Check that required files appear to have been extracted OK,
  26.      and perform other similar tests for proper version, operating
  27.      system, etc.
  28.  
  29.    * Locate the previous copy of the product, if any.
  30.  
  31.    * If there was a previous copy:
  32.       - Copy over the old .INI and 4START files.
  33.       - Update the old .INI file for the new path, and (in 4DOS) remove
  34.         the old HelpPath directive and replace it with InstallPath.
  35.       - Allow branding of the new version if appropriate.
  36.  
  37.    * For 4DOS:
  38.       - Update CONFIG.SYS so the SHELL= line points to the new version
  39.       - Update AUTOEXEC.BAT to include KEYSTACK (except in Win95).
  40.       - If running in OS/2, start an OS/2 .CMD file to create a desktop
  41.         folder for 4DOS.
  42.       - If running in Win95, create a shortcut for 4DOS, and add registry
  43.         extensions.
  44.  
  45.    * For 4OS2:
  46.       - Call a REXX script to update CONFIG.SYS (updates OS2_SHELL, COMSPEC,
  47.         BOOKSHELF, DPATH, and LIBPATH).
  48.       - Call a REXX script to create a desktop object for 4OS2.
  49.  
  50.    * For 4NT:
  51.       - If running in NT 4.0+, create a shortcut for 4NT, and add registry
  52.         entries.
  53. endtext
  54.  
  55.  
  56. :start
  57. if %_dos eq DOS if %_4ver ge 6.0 goto verok
  58. if %_dos eq OS2 if %_4ver ge 3.0 goto verok
  59. iff %_dos eq NT then
  60.    set w95flag=0
  61.    if exist %[_cwds]insthelp.exe (insthelp Win95Test %+ set w95flag=%?)
  62.    iff %w95flag ne 0 then
  63.       cls
  64.       text
  65.  
  66. 4NT is not designed to run under Windows 95, and we do not recommend
  67. installing it there.  For a native Windows 95 version of our command
  68. line tools use 4DOS, our DOS command processor with full Windows 95
  69. and long filename support.
  70.  
  71. (This is a one-time message which will not be repeated.)
  72.  
  73.       endtext
  74.       set qq=Y
  75.       goto exit_noretry
  76.    endiff
  77.    if %_4ver ge 3.0 goto verok
  78. cls
  79. text
  80.  
  81. This automated installation batch file is for use under 4DOS 6.0 or
  82. above, 4OS2 3.0 or above, or 4NT 3.0 or above.  It will not work for
  83. other products, or earlier versions.
  84.  
  85. endtext
  86. pause
  87. goto done
  88.  
  89. :verok
  90.  
  91. setdos /c%=^ 
  92. setdos /p%=& 
  93. setdos /e%= 
  94.  
  95. cls
  96. echo.
  97. echo.
  98. echo Welcome to 4%_dos!
  99. echo.
  100. echo This installation procedure is run automatically the first time
  101. echo you start a new downloaded or trial copy of 4%_dos.  It is written
  102. echo entirely in the 4%_dos batch language.
  103. echo.
  104. echo If you are new to 4%_dos, this procedure will install 4%_dos on your
  105. echo system.  No system files will be modified without your permission.
  106. echo.
  107. echo If you already have a previous version of 4%_dos installed, this
  108. echo procedure will copy the settings (4%_dos.INI and 4START) and
  109. echo registration information (if available) from the previous version,
  110. echo and -- after requesting your permission -- will update the
  111. echo appropriate configuration files.
  112. echo.
  113. echo If you have already installed this new version of 4%_dos, or prefer to
  114. echo perform the installation manually as described in the %docname file, you
  115. echo can exit now, and this installation program will not be run again.
  116. echo.
  117. inkey /k"yn" Proceed with installation (Y/N)? %%yn
  118. if "%yn" ne "Y" goto exit_noretry
  119.  
  120. iff %_dos eq DOS then
  121.    if %@len[%@full[%0]] lt 150 goto pathok
  122.    echo.
  123.    echo The 4DOS directory name is too long for automated installation.
  124.    goto fatalerr
  125. endiff
  126.  
  127.  
  128. :pathok
  129.  
  130. cdd %@path[%@full[%0]] || (echo Cannot switch to the product directory! %+ goto fatalerr)
  131.  
  132. iff not exist 4%_dos.%@if[%_dos eq DOS,com,exe] then
  133.    cls
  134.    echo.
  135.    echo The 4%_dos automated installation batch file is not in the
  136.    echo directory where the product files are stored.  Please put all
  137.    echo the new 4%_dos files in the same directory and try again.
  138.    goto done
  139. endiff
  140.  
  141. iff %_dos eq DOS .and. (%_env lt 512 .or. %_alias lt 256) then
  142.    iff "%_jprr" eq "Y" then
  143.       exit 16
  144.    else
  145.       text
  146.  
  147. =========================================================================
  148.  
  149. The free environment or alias space is not adequate for automated
  150. installation.  The installation software will start a temporary copy of
  151. 4DOS with larger environment and alias space, and try again.
  152.  
  153.       endtext
  154.       pause
  155.       set _jprr=Y
  156.       .\4dos.com //envfree=768 //alias=%@eval[%_alias + 384] /c %@full[%0]
  157.       iff %? eq 16 then
  158.          text
  159.  
  160. =========================================================================
  161.  
  162. The free environment or alias space is still inadequate for automated
  163. installation.
  164.          endtext
  165.          goto fatalerr
  166.       else
  167.          set qq=y
  168.          goto done
  169.       endiff
  170.    endiff
  171. endiff
  172.  
  173.  
  174. alias fatalerr `(echo %& %+ goto fatalerr)`
  175. alias wait `echo. %+ pause Press any key to continue ...`
  176. alias yesno `echo. %+ inkey /k"yn" %2& (Y/N)? %%%1`
  177. alias retry `(beep %+ iff "%2&" ne "" then %+ echo. %+ echo %2& %+ endiff %+ goto %1)`
  178. alias addslash `if "%@right[1,%[%1]]" ne "\" set %1=%[%1]\`
  179. alias insthelp `pushd %+ .\insthelp.exe %& %+ set result=%? %+ popd`
  180. alias callrexx `pushd %+ call %& %+ set result=%? %+ popd`
  181. alias instinf `pushd %+ %instinf %& %+ popd`
  182. alias sep `echo. %+ echo %@repeat[%1,72] %+ echo.`
  183. alias clear `cls %+ echo. %+ echo.`
  184.  
  185. set product=4%_dos
  186. set cd=%_cwds
  187. if %product eq 4DOS .or. %product eq 4OS2 set cd=%@upper[%cd]
  188. set instinf=rem
  189. iff %product eq 4DOS then
  190.    iff %_win ge 40 then
  191.       set cd=%@sfn[%cd]
  192.       set instinf=rundll.exe
  193.       if "%windir" ne ""  .and. exist %windir\rundll.exe set instinf=%windir\rundll.exe
  194.       set instinf=%instinf setupx.dll,InstallHinfSection DefaultInstall 132
  195.    endiff
  196. elseiff %product eq 4NT .and. %_dosver ge 4.00 then
  197.    set instinf=%SystemRoot\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
  198. endiff
  199.  
  200. switch %product
  201.    case 4DOS
  202.       set reqfiles=4DOS.COM OPTION.EXE 4HELP.EXE 4DOS.HLP INSTHELP.EXE
  203.       set exefile=4DOS.COM
  204.       set batext=BTM BAT
  205.       set oldver=5.52
  206.       set verlist=4.0 5.0 5.5
  207.       set opsys=DOS
  208.       if %_win ge 40 set opsys=Windows 95
  209.    case 4OS2
  210.       set reqfiles=4OS2.EXE JPOS2DLL.DLL KEYSTACK.EXE OPTION2.EXE 4OS2.INF 4OS2H.MSG JPOS2INS.CMD
  211.       set exefile=4OS2.EXE
  212.       set batext=BTM CMD
  213.       set oldver=2.52
  214.       set verlist=2.0 2.5
  215.       set opsys=OS/2
  216.       option //execwait=Yes
  217.    case 4NT
  218.       set reqfiles=4NT.EXE 4NT.HLP 4NT.CNT SHRALIAS.EXE INSTHELP.EXE
  219.       set exefile=4NT.EXE
  220.       set batext=BTM CMD BAT
  221.       set oldver=2.52
  222.       set verlist=2.0 2.5
  223.       set opsys=Windows NT
  224.       option //execwait=Yes
  225. endswitch
  226.  
  227. for %f in (%reqfiles) if not exist %f (set errname=%f %+ goto missing_file)
  228. goto filesok
  229.  
  230. :missing_file
  231. sep =
  232. echo The %errname file is missing.  This file is required to install %product.
  233. echo Please check that all downloaded files were placed in the same directory.
  234. goto nonfatalerr
  235.  
  236.  
  237. :filesok
  238.  
  239. clear
  240. echo This procedure installs %product version %_4ver.
  241. yesno pver Are you currently using an earlier version of %product on your system
  242.  
  243. if "%pver" ne "Y" goto noprev
  244.  
  245. :getpdir
  246. sep -
  247. echo Please enter the directory where your previous
  248. input version of %product is installed:  %%prevdir
  249. addslash prevdir
  250.  
  251. if not isdir %prevdir retry getpdir That is not a valid directory
  252. iff not exist %[prevdir]%exefile then
  253.    echo This directory does not appear to contain a previous version of
  254.    echo %product.  Please try again.
  255.    retry getpdir
  256. endiff
  257.  
  258. set prevtime=%@filetime[%[prevdir]%exefile]
  259. set prevver=%@left[2,%prevtime].%@instr[3,1,%prevtime]
  260. unset prevtime
  261. if "%@left[1,%prevver]" eq "0" set prevver=%@right[3,%prevver]
  262. iff %@index[%verlist,%prevver] ne -1 then
  263.    set newupg=%@if[%@eval[%prevver - %@left[%oldver,3]] ge 0.5,Y,N]
  264.    set upgdist=%@eval[%@left[%_4ver,3] - %prevver]
  265. else
  266.    sep -
  267.    iff %product eq 4DOS then
  268.       echo The installation software cannot identify your previous version of 4DOS.
  269.       echo Installation can proceed, but a few prompts may be incorrect, or the branding
  270.       echo step may not work properly.  You can choose to proceed with the installation,
  271.       echo re-enter the installation directory, or stop and perform the installation
  272.       echo manually, using the instructions in %product.TXT.
  273.    else
  274.       echo The installation software cannot identify your previous version of %product.
  275.       echo Installation can proceed, but a few prompts may be incorrect.  You can
  276.       echo choose to proceed with the installation, re-enter the installation directory,
  277.       echo or stop and perform the installation manually, using the instructions
  278.       echo in %product.TXT
  279.    endiff
  280.    echo.
  281.    inkey /k"ydn" Enter Y to proceed, D to change the installation directory, or N to stop: %%yn
  282.    if "%yn" eq "D" goto getpdir
  283.    if "%yn" ne "Y" goto exit_noretry
  284.    set newupg=N
  285.    set upgdist=9.0
  286. endiff
  287. unset prevver
  288.  
  289. clear
  290. echo Your current %product.INI, 4START, and 4EXIT files (if any) will now be
  291. echo copied from the previous %product directory.  If these files already
  292. echo exist in the new %product directory you will be prompted for whether to
  293. echo replace the file in the new directory with the file from the old
  294. echo directory.
  295. echo.
  296. yesno yn Copy the %product.INI, 4START, and 4EXIT files
  297. iff "%yn" eq "Y" then
  298.  
  299.    :: Copy the files
  300.    if exist %[prevdir]%[product].ini copy /r %[prevdir]%[product].ini .\
  301.    for %f in (4START 4EXIT) for %e in (%batext) if exist %[prevdir]%f.%e copy /r %[prevdir]%f.%e .\
  302.  
  303.    :: Update paths in INI file
  304.    iff exist %product.INI then
  305.       sep -
  306.       echo Paths in the new copy of %product.INI will now be updated to point to your
  307.       echo new %product directory.  The old .INI file will be saved as %product.JPS.
  308.       echo If you do not allow this update, you must perform it manually, or %product
  309.       echo may not work properly.
  310.       iff %product eq 4DOS then
  311.          echo.
  312.          echo During the update process any old HelpPath directive will be removed from
  313.          echo 4DOS.INI (this directive is now obsolete), and an InstallPath directive
  314.          echo will be added.
  315.       endiff
  316.       yesno yn Update %product.INI
  317.       set jptemp=%@unique[.]
  318.       iff "%yn" eq "Y" then
  319.          iff %product eq 4OS2 then
  320.             callrexx jpos2ins.cmd "4OS2" "%cd" "UpdateINI" "4OS2.INI" "%jptemp"
  321.          else
  322.             insthelp IniFile /d"%cd" /o"4DOS.INI" /t"%jptemp"
  323.          endiff
  324.          iff %result eq 0 then
  325.             copy %product.INI %product.JPS > nul
  326.             copy %jptemp %product.INI > nul
  327.          else
  328.             sep -
  329.             echo Paths in %product.INI could not be updated due to the above error.  Be sure
  330.             echo to manually update any settings in %product.INI which point to the %product
  331.             echo directory.  If you do not, %product may not work properly.
  332.          endiff
  333.          wait
  334.       endiff
  335.       del /q %jptemp > nul
  336.    endiff
  337.  
  338. else
  339.    sep -
  340.    echo You chose not to copy existing startup files from your previous %product
  341.    echo directory.  You may want to copy these files manually at a later time,
  342.    echo and update them for the new version.
  343.    wait
  344. endiff
  345.  
  346.  
  347. clear
  348. echo The next part of the installation process varies depending on whether
  349. echo you own a purchased or "registered" version of %product, as opposed to a
  350. echo trial or "shareware" version.
  351. yesno yn Are you upgrading from a previously purchased copy of %product
  352. if "%yn" ne "Y" goto trialver
  353.  
  354.  
  355. iff %newupg eq Y then
  356.  
  357.    :: Previous version is 6.0 / 3.0 or later
  358.    iff %upgdist gt 0.1 then
  359.       :: Major update, order is probably required
  360.       sep -
  361.       echo The installation software has determined that you are installing a
  362.       echo major update to %product (as opposed to a minor or maintenance update).
  363.       echo.
  364.       echo Normally such updates must be purchased; please contact JP Software
  365.       echo or your dealer for details.  If you order an upgrade you can use the
  366.       echo trial version while you wait for your upgrade to arrive.
  367.       echo.
  368.       echo If you believe you are eligible for a free registered copy of this
  369.       echo version even though it is a major update (for example, because you
  370.       echo purchased a special offer which included the next version), you can try
  371.       echo to "brand" %product with your name and serial number manually; for
  372.       echo instructions see the README.TXT file.  If branding fails with the
  373.       echo message "Contact JP Software or your dealer for an upgrade" then you
  374.       echo must purchase the upgrade.
  375.       goto branddone
  376.    endiff
  377.  
  378.    :: Minor update
  379.    iff %product eq 4DOS then
  380.       :: Minor update to 4DOS, try to brand it
  381.       sep -
  382.       echo The installation software has determined that you are installing a
  383.       echo minor or maintenance update to 4DOS.  This portion of the installation
  384.       echo process will assist you in "branding" this update with your name and
  385.       echo serial number.
  386.    
  387.       iff exist %[prevdir]br4dos.exe then
  388.          yesno yn Brand the new version of 4DOS with your name and serial number
  389.          iff "%yn" eq "y" then
  390.             copy /u %[prevdir]br4dos.exe
  391.             do forever
  392.                .\br4dos.exe
  393.                if %? eq 0 leave
  394.                echo.
  395.                yesno yn Branding failed ... try again
  396.                if "%yn" ne "Y" leave
  397.             enddo
  398.          endiff
  399.       else
  400.          :: Oops, missing brand program.
  401.          wait
  402.          sep -
  403.          echo You cannot brand 4DOS now, because the BR4DOS program from the previous
  404.          echo version is not available in your old 4DOS directory.
  405.          echo.
  406.          echo The installation process will continue with the downloaded trial version.
  407.          echo To brand this version at a later time, see the README.TXT file.
  408.       endiff
  409.    else
  410.       :: Minor update to 4OS2 / 4NT
  411.       sep -
  412.       echo The installation software has determined that you are installing a
  413.       echo minor or maintenance update to %product.  The "branding" (name and
  414.       echo serial number) information should already be stored on your system,
  415.       echo and will be transferred automatically to the new version.
  416.       echo.
  417.       echo If the information does not transfer properly, or you need to
  418.       echo reinstall your branding information for any other reason, see the
  419.       echo manual branding instructions in the README.TXT file.
  420.       echo.
  421.    endiff
  422.  
  423. else
  424.  
  425.    :: Updating from 5.5 / 2.5 or earlier
  426.    sep -
  427.    iff %product eq 4DOS then
  428.       text
  429. This portion of the installation process will assist you in "branding"
  430. 4DOS with your name and serial number.  Branding the program converts it
  431. from a trial (shareware) copy to one registered to you.
  432.  
  433. You are only eligible to brand this upgrade if your FIRST purchase of
  434. 4DOS was a version 5.5 or later diskette, and you are upgrading to
  435. version 6.0.  If your original purchase was for version 5.0 or earlier,
  436. or you obtained 4DOS on our CD Suite, in most cases you must purchase
  437. the version 6.0 upgrade (once you order the upgrade you can continue to
  438. use this trial version until your order arrives).  For more information
  439. on upgrades see PRODUCTS.TXT and UPGFORM.TXT.
  440.  
  441. Branding also requires the brand program and brand information (name,
  442. serial number, and validation code) from 4DOS 5.5 or later.  If you are
  443. eligible for the upgrade at no charge but have lost your brand
  444. information, contact JP Software to obtain a replacement (there is a
  445. small charge for this service).
  446.       endtext
  447.       iff exist %[prevdir]brand.exe then
  448.          yesno yn Brand the new version of 4DOS with your name and serial number
  449.          iff "%yn" eq "y" then
  450.             copy /u %[prevdir]brand.exe
  451.             do forever
  452.                .\brand.exe
  453.                if %? eq 0 leave
  454.                echo.
  455.                yesno yn Branding failed ... try again
  456.                if "%yn" ne "Y" leave
  457.             enddo
  458.          endiff
  459.       else
  460.          wait
  461.          sep -
  462.          text
  463. You cannot brand 4DOS now because the BRAND program from the previous
  464. version is not available in your old 4DOS directory.
  465.  
  466. The installation process will continue with the downloaded trial
  467. version.  To brand this version at a later time, see the instructions
  468. in the README.TXT file.
  469.          endtext
  470.       endiff
  471.  
  472.    else
  473.       echo This portion of the installation process provides information on
  474.       echo "branding" the new version of %product with your name and serial number.
  475.       echo.
  476.       echo This section is informational only; you cannot actually brand %product now
  477.       echo because it is in use (to run this installation batch file), and
  478.       echo %opsys does not allow running programs to be modified.  For manual
  479.       echo branding instructions see the README.TXT file.
  480.       echo.
  481.       echo You will only be eligible to brand this upgrade if your FIRST purchase
  482.       echo of %product was a version 2.5 or later diskette, and you are upgrading
  483.       echo to version 3.0.  If your original purchase was for version 2.0 or
  484.       echo earlier, or you obtained %product on our CD Suite, in most cases you
  485.       echo must purchase the version 3.0 upgrade (once you order the upgrade you
  486.       echo can continue to use this trial version until your order arrives).  For
  487.       echo more information on upgrades see PRODUCTS.TXT and UPGFORM.TXT.
  488.       echo.
  489.       echo Branding will also require the brand program and brand information
  490.       echo (name, serial number, and validation code) from %product 2.5 or later.
  491.       echo If you are eligible for the upgrade at no charge but have lost your
  492.       echo brand information, contact JP Software to obtain a replacement (there is
  493.       echo a small charge for this service).
  494.    endiff
  495. endiff
  496.  
  497. :branddone
  498. wait
  499. goto doconfig
  500.  
  501.  
  502. :noprev
  503. iff %product eq 4DOS then
  504.    echo [4DOS] >! 4DOS.INI
  505.    echo InstallPath = %cd >>! 4DOS.INI
  506. endiff
  507.  
  508.  
  509. :trialver
  510. sep -
  511. echo You may use this new trial version of %product for up to 21 days while
  512. echo evaluating it.  After that time you must purchase %product if you continue
  513. echo to use it.  See our license agreement in the file LICENSE.TXT for
  514. echo complete details.
  515. wait
  516.  
  517.  
  518. :doconfig
  519.  
  520. if %product eq 4NT goto configdone
  521.  
  522. set csname=%_boot:\CONFIG.SYS
  523. set csbak=%_boot:\CONFIG.JPS
  524. set csmod=N
  525. clear
  526. echo The installation process updates CONFIG.SYS to load your new copy of
  527. echo %product as the default %opsys command processor.  You have three choices:
  528. echo.
  529. echo    - Update the system CONFIG.SYS file.  This is the recommended method
  530. echo      and will fully install %product on your system.  Your previous
  531. echo      CONFIG.SYS file will be saved as CONFIG.JPS.
  532. echo.
  533. echo    - Make a copy of CONFIG.SYS in the %product directory and update that
  534. echo      copy, instead of the "real" CONFIG.SYS file.  This allows you to
  535. echo      review the changes before implementing them.  If there is already a
  536. echo      copy of CONFIG.SYS in the %product directory it will be renamed CONFIG.JPS.
  537. echo.
  538. echo    - Skip the CONFIG.SYS update.  In this case you will have to update
  539. echo      CONFIG.SYS manually (see the %product.TXT file for details).
  540. echo.
  541. echo Enter:  Y to update %csname
  542. echo         C to update a copy of CONFIG.SYS in the %product directory
  543. echo         N to skip the CONFIG.SYS changes
  544. echo.
  545. inkey /k"YNC" Your choice:  %%csopt
  546.  
  547. switch %csopt
  548.  
  549.    case Y
  550.       set jptemp=%@unique[.]
  551.       iff %product eq 4OS2 then
  552.          callrexx jpos2ins.cmd "4OS2" "%cd" "UpdatePaths" "%csname" "%jptemp" "" "%[cd]%exefile"
  553.       else
  554.          insthelp Config /d"%cd" /o"%csname" /t"%jptemp"
  555.       endiff
  556.       iff %result eq 0 then
  557.          copy %csname %csbak > nul
  558.          copy %jptemp %csname > nul
  559.          set csmod=Y
  560.          sep -
  561.          echo CONFIG.SYS has been updated.  The next time you reboot your system, your
  562.          echo new copy of %product will be used as the %opsys command processor.
  563.       else
  564.          sep -
  565.          echo CONFIG.SYS could not be updated due to the above error.  You must update
  566.          echo it manually (see the %product.TXT file for details).
  567.       endiff
  568.       del /q %jptemp > nul
  569.  
  570.    case C
  571.       echo.
  572.       if exist .\config.sys (move .\CONFIG.SYS .\CONFIG.JPS > nul)
  573.       iff %product eq 4OS2 then
  574.          callrexx jpos2ins.cmd "4OS2" "%cd" "UpdatePaths" "%csname" "%[cd]CONFIG.SYS" "" "%[cd]%exefile"
  575.       else
  576.          insthelp Config /d"%cd" /o"%csname" /t"%[cd]CONFIG.SYS"
  577.       endiff
  578.       iff %result eq 0 then
  579.          sep -
  580.          echo The copy of CONFIG.SYS has been updated.  You can review this file, then
  581.          echo make changes to the real CONFIG.SYS file manually when you are ready to
  582.          echo start using your new copy of %product as the %opsys command processor.
  583.       else
  584.          sep -
  585.          echo The copy of CONFIG.SYS could not be updated due to the above error.  You
  586.          echo must update CONFIG.SYS manually (see the %product.TXT file for details).
  587.       endiff
  588.  
  589.    case N
  590.       sep -
  591.       echo CONFIG.SYS will not be updated.  You can update it manually when you are
  592.       echo ready to start using your new copy of %product as the default %opsys
  593.       echo command processor (see the %product.TXT file for details).
  594.  
  595. endswitch
  596. wait
  597.  
  598.  
  599. :configdone
  600.  
  601. if %product ne 4DOS .or. %_win ge 40 goto autoexecdone
  602.  
  603. set aename=%_boot:\AUTOEXEC.BAT
  604. set aebak=%_boot:\AUTOEXEC.JPS
  605. clear
  606. text
  607. The installation process updates AUTOEXEC.BAT to load the KSTACK.COM
  608. program, a small memory-resident program used by the 4DOS KEYSTACK
  609. command to pass keystrokes to DOS applications.  You have three choices:
  610.  
  611.    - Update the system AUTOEXEC.BAT file.  This is the recommended
  612.      method and will fully install 4DOS on your system.  Your previous
  613.      AUTOEXEC.BAT file will be saved as AUTOEXEC.JPS.
  614.  
  615.    - Make a copy of AUTOEXEC.BAT in the 4DOS directory and update that
  616.      copy, instead of the "real" AUTOEXEC.BAT file.  This allows you to
  617.      review the changes before implementing them.  If there is already a
  618.      copy of AUTOEXEC.BAT in the 4DOS directory it will be renamed to
  619.      AUTOEXEC.JPS.
  620.  
  621.    - Skip the AUTOEXEC.BAT update.  In this case you will have to update
  622.      AUTOEXEC.BAT manually to install KSTACK.COM (see the 4DOS.TXT file
  623.      for details).
  624.  
  625. endtext
  626. echo Enter:  Y to update %aename
  627. echo         C to update a copy of AUTOEXEC.BAT in the 4DOS directory
  628. echo         N to skip the AUTOEXEC.BAT changes
  629. echo.
  630. inkey /k"YNC" Your choice:  %%aeopt
  631.  
  632. switch %aeopt
  633.  
  634.    case Y
  635.       set jptemp=%@unique[.]
  636.       insthelp AutoExec /d"%cd" /o"%aename" /t"%jptemp"
  637.       iff %result eq 0 then
  638.          copy %aename %aebak > nul
  639.          copy %jptemp %aename > nul
  640.          set aemod=Y
  641.          echo AUTOEXEC.BAT has been updated.
  642.       else
  643.          sep -
  644.          text
  645. AUTOEXEC.BAT could not be updated due to the above error.  You must
  646. update it manually (see the 4DOS.TXT file for details).
  647.          endtext
  648.       endiff
  649.       del /q %jptemp > nul
  650.  
  651.    case C
  652.       if exist .\AUTOEXEC.BAT (move .\AUTOEXEC.BAT .\AUTOEXEC.JPS > nul)
  653.       insthelp AutoExec /d"%cd" /o"%aename" /t"%[cd]AUTOEXEC.BAT"
  654.       iff %result eq 0 then
  655.          sep -
  656.          text
  657. The copy of AUTOEXEC.BAT has been updated.  You can review this file,
  658. then make changes to the real AUTOEXEC.BAT file manually when you are
  659. ready.
  660.          endtext
  661.       else
  662.          sep -
  663.          text
  664. The copy of AUTOEXEC.BAT could not be updated due to the above error.
  665. You must update AUTOEXEC.BAT manually (see the 4DOS.TXT file for
  666. details).
  667.          endtext
  668.       endiff
  669.  
  670.    case N
  671.       sep -
  672.       text
  673. AUTOEXEC.BAT will not be updated.  You can update it manually when you
  674. are ready (see the 4DOS.TXT file for details).
  675.       endtext
  676.  
  677. endswitch
  678. wait
  679.  
  680.  
  681. :autoexecdone
  682.  
  683. switch %product
  684.  
  685.    case 4DOS
  686.       iff %_dosver ge 20.0 .and. exist jpos2ins.cmd then
  687.          clear
  688.          text
  689. If you wish, the installation software can create an OS/2 desktop folder
  690. for 4DOS, including objects to start 4DOS itself, and the 4DOS help.
  691.          endtext
  692.          yesno yn Create an OS/2 desktop folder for 4DOS
  693.          iff "%yn" == "Y" then
  694.             start /fg /c jpos2ins.cmd "4DOS" "%cd" "CreateFolder"
  695.             sep -
  696.             text
  697. You should see the folder creation window open and execute on the
  698. screen.  Creating a folder is a separate process, and the installation
  699. software cannot determine when the process is finished, or whether it
  700. worked correctly.  When you return to this screen you can continue, and
  701. complete the installation.
  702.  
  703. If there are any errors in creating the folder or it does not appear on
  704. your desktop, you can create 4DOS desktop objects manually as described
  705. in the 4DOS.TXT file, in the section on using 4DOS under OS/2.
  706.             endtext
  707.             wait
  708.          endiff
  709.       endiff
  710.  
  711.       iff %_win ge 40 then
  712.          iff exist jpsoft.inf then
  713.             clear
  714.             text
  715. The installation software can create a JP Software program group for
  716. 4DOS, accessible through the Windows 95 Start menu.  The group will
  717. include shortcuts to start 4DOS itself, and the 4DOS help.  The same
  718. process creates a desktop shortcut for 4DOS (easily deleted if you
  719. prefer to use only the Start menu).
  720.  
  721. The JP Software group and related desktop shortcuts will also be made
  722. removable using Windows 95's Uninstall facility (available from the
  723. Control Panel's Add / Remove Programs item).
  724.  
  725. If you choose not to create these items now, you can create shortcuts
  726. manually as described in the 4DOS.TXT file, in the chapter on installing
  727. 4DOS.
  728.             endtext
  729.             yesno yn Create a Windows 95 program group and desktop shortcut for 4DOS
  730.             iff "%yn" == "Y" then
  731.                instinf %[cd]jpsoft.inf
  732.                sep -
  733.                text
  734. The process to create the 4DOS group and shortcuts has been started, and
  735. should be complete in a few seconds (this is a separate process, and the
  736. installation software cannot determine when it is finished).
  737.  
  738. Installation will now continue.  If there are any errors in creating the
  739. group or shortcuts, or they do not appear on your Start menu or desktop,
  740. you can create 4DOS shortcuts manually as described in the 4DOS.TXT
  741. file, in the section on using 4DOS under Windows 95.
  742.                endtext
  743.                wait
  744.             endiff
  745.          endiff
  746.  
  747.          iff exist jp4dos.inf then
  748.             clear
  749.             text
  750. The installation software can install optional registry extensions for
  751. 4DOS.  The registry extensions customize a few Windows 95 functions to
  752. best take advantage of features provided by 4DOS.  Specifically, they:
  753.  
  754.    - Create a new "4DOS Prompt here" entry in the context menu of drives
  755.      and directories, to launch 4DOS in that drive or directory.
  756.  
  757.    - Extend Windows' definition of a "batch file" to include BTM files,
  758.      including the ability to double-click on a BTM file to execute it.
  759.  
  760.    - Provide an additional "open" option in the context menu of all
  761.      batch files (.BAT, .CMD, and .BTM), to run the file with 4DOS.
  762.  
  763. These registry extensions can be removed using Windows 95's Uninstall
  764. facility (available from the Control Panel under Add / Remove Programs).
  765.  
  766. If you choose not to install the registry extensions now, you can do so
  767. later as described in 4DOS.TXT, in the 4DOS installation chapter.
  768.             endtext
  769.             yesno yn Install 4DOS registry extensions
  770.             iff "%yn" == "Y" then
  771.                instinf %[cd]jp4dos.inf
  772.                sep -
  773.                text
  774. The process to install the 4DOS registry extensions has been started, and
  775. should be complete in a few seconds (this is a separate process, and the
  776. installation software cannot determine when it is finished).
  777.  
  778. You can continue now, and complete the installation.
  779.                endtext
  780.                wait
  781.             endiff
  782.          endiff
  783.  
  784.       endiff
  785.  
  786.    case 4OS2
  787.       clear
  788.       text
  789. If you wish, the installation software can create an OS/2 desktop folder
  790. for 4OS2, including objects to start 4OS2 itself, and the 4OS2 help.
  791. You can also create these objects manually as described in the 4OS2.TXT
  792. file, in the chapter on installing 4OS2.
  793.       endtext
  794.       yesno yn Create an OS/2 desktop folder for 4OS2
  795.       iff "%yn" == "Y" then
  796.          callrexx jpos2ins.cmd "4OS2" "%cd" "CreateFolder"
  797.          wait
  798.       endiff
  799.  
  800.    case 4NT
  801.       clear
  802.       :: Registry stuff only works in NT 4.0
  803.       iff %_dosver ge 4.00 then
  804.          iff exist jpsoft.inf then
  805.             clear
  806.             text
  807. The installation software can create a JP Software program group for
  808. 4NT, accessible through the Windows NT Start menu.  The group will
  809. include shortcuts to start 4NT itself, and the 4NT help.  The same
  810. process creates a desktop shortcut for 4NT (easily deleted if you
  811. prefer to use only the Start menu).
  812.  
  813. The JP Software group and related desktop shortcuts will also be made
  814. removable using Windows NT's Uninstall facility (available from the
  815. Control Panel's Add / Remove Programs item).
  816.  
  817. If you choose not to create these items now, you can create shortcuts
  818. manually as described in the 4NT.TXT file, in the chapter on installing
  819. 4NT.
  820.             endtext
  821.             yesno yn Create a Windows NT program group and desktop shortcut for 4NT
  822.             iff "%yn" == "Y" then
  823.                instinf %[cd]jpsoft.inf
  824.                echo.
  825.                echo The program group and shortcuts have been created.
  826.                wait
  827.             endiff
  828.          endiff
  829.  
  830.          iff exist jp4nt.inf then
  831.             clear
  832.             text
  833. The installation software can install optional registry extensions for
  834. 4NT.  The registry extensions customize a few Windows NT functions to
  835. best take advantage of features provided by 4NT.  Specifically, they:
  836.  
  837.    - Create a new "4NT Prompt here" entry in the context menu of drives
  838.      and directories, to launch 4NT in that drive or directory.
  839.  
  840.    - Extend Windows' definition of a "batch file" to include BTM files,
  841.      including the ability to double-click on a BTM file to execute it.
  842.  
  843.    - Provide an additional "open" option in the context menu of all
  844.      batch files (.BAT, .CMD, and .BTM), to run the file with 4NT.
  845.  
  846. These registry extensions can be removed using Windows NT's Uninstall
  847. facility (available from the Control Panel under Add / Remove Programs).
  848.  
  849. If you choose not to install the registry extensions now, you can do so
  850. later as described in the 4NT.TXT file, in the 4NT installation chapter.
  851.             endtext
  852.             yesno yn Install 4NT registry extensions
  853.             iff "%yn" == "Y" then
  854.                instinf %[cd]jp4nt.inf
  855.                echo.
  856.                echo The registry extensions have been installed.
  857.                wait
  858.             endiff
  859.          endiff
  860.       endiff
  861.  
  862. endswitch
  863.  
  864.  
  865. clear
  866. switch %product
  867.  
  868.    case 4DOS .or. 4OS2
  869.       iff %csmod eq Y then
  870.          echo %product installation is complete.  The next time you reboot your system,
  871.          echo %product will be used as the default %opsys command processor.
  872.       else
  873.          echo %product installation is complete.  You chose not to update the system
  874.          echo CONFIG.SYS file during the installation process.  When you are ready,
  875.          echo update CONFIG.SYS as described in the %product.TXT file, then reboot.
  876.       endiff
  877.       iff %product eq 4DOS .and. %_win eq 40 then
  878.          echo.
  879.          echo To start 4DOS from the Windows 95 desktop, use the shortcut or group
  880.          echo created during the installation process.  If you did not allow the
  881.          echo installation software to create a shortcut you can do so manually;
  882.          echo instructions are in the 4DOS.TXT file, in the chapter on 4DOS
  883.          echo installation.
  884.       endiff
  885.  
  886.    case 4NT
  887.       echo 4NT installation is complete.  To start 4NT, use the shortcut or group
  888.       echo created during the installation process.  If you did not allow the
  889.       echo installation software to create a shortcut you can do so manually;
  890.       echo instructions are in the 4NT.TXT file, in the chapter on 4NT
  891.       echo installation.
  892.  
  893. endswitch
  894.  
  895. goto exit_noretry
  896.  
  897.  
  898.  
  899. :on_error
  900. :nonfatalerr
  901. on errormsg
  902. on break
  903. echo.
  904. echo.
  905. echo *** The installation stopped due to the above error.  The installation
  906. echo     program will restart the next time you start 4%_dos.
  907. echo.
  908. goto done
  909.  
  910. :on_break
  911. on errormsg
  912. on break
  913. echo.
  914. echo.
  915. echo *** Installation interrupted.  The installation program will restart
  916. echo     the next time you start 4%_dos.
  917. echo.
  918. goto done
  919.  
  920. :fatalerr
  921. on errormsg
  922. on break
  923. echo.
  924. echo.
  925. echo *** Installation stopped due to the above error.
  926. echo.
  927. echo You will have to complete the installation manually.  For
  928. echo instructions see the chapter on 4%_dos installation in the
  929. echo 4%_dos.TXT file.
  930. echo.
  931.  
  932. :exit_noretry
  933. on errormsg
  934. on break
  935. set bname=%@full[%0]
  936. move %bname %@path[%bname]\%@name[%bname].btx >& nul
  937.  
  938. :done
  939. on errormsg
  940. on break
  941. echo.
  942. iff "%qq" eq "Y" then
  943.    pause Press any key to exit ...
  944.    exit
  945. else
  946.    pause Press any key to exit to the 4%_dos prompt ...
  947. endiff
  948. endlocal
  949.  
  950.