home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / 4os2300.zip / _4INST.BTM (.txt) next >
4DOS Compressed Batch-To-Memory File  |  1997-07-30  |  22KB  |  955 lines

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