home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / 4os2302.zip / _4INST.BTM (.txt) next >
4DOS Compressed Batch-To-Memory File  |  1999-04-16  |  22KB  |  961 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 1999, JP Software Inc., All Rights Reserved.
  14.          Author:  Tom Rawson   Last Revision:  March 24, 1999
  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/98).
  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/98, create a shortcut for 4DOS, and add
  44.         registry 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 WIN95C .or. %_dos eq WIN98C then
  61.    set _dos=NT
  62.    cls
  63.    text
  64.  
  65. 4NT is not designed to run under Windows 95/98, and we do not recommend
  66. installing it there.  For a native Windows 95/98 version of our command
  67. line tools use 4DOS, our DOS command processor with full Windows 95/98
  68. and long filename support.
  69.  
  70. (This is a one-time message which will not be repeated.)
  71.  
  72.       endtext
  73.       set qq=Y
  74.       goto exit_noretry
  75.    endiff
  76.    if %_4ver ge 3.0 goto verok
  77. endiff
  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. if "%_jprr" eq "Y" goto pathok
  97.  
  98. echo.
  99. echo.
  100. echo Welcome to 4%_dos!
  101. echo.
  102. echo This installation procedure is run automatically the first time
  103. echo you start a new downloaded or trial copy of 4%_dos.  It is written
  104. echo entirely in the 4%_dos batch language.
  105. echo.
  106. echo If you are new to 4%_dos, this procedure will install 4%_dos on your
  107. echo system.  No system files will be modified without your permission.
  108. echo.
  109. echo If you already have a previous version of 4%_dos installed, this
  110. echo procedure will copy the settings (4%_dos.INI and 4START) and
  111. echo registration information (if available) from the previous version to
  112. echo the new directory, and -- after requesting your permission -- will
  113. echo update the appropriate configuration files.
  114. echo.
  115. echo If you have already installed this new version of 4%_dos, or prefer to
  116. echo perform the installation manually as described in the 4%_dos.TXT file, you
  117. echo can exit now, and this installation program will not be run again.
  118. echo.
  119. inkey /k"yn" Proceed with installation (Y/N)? %%yn
  120. if "%yn" ne "Y" goto exit_noretry
  121.  
  122. iff %_dos eq DOS then
  123.    if %@len["%@full[%0]"] lt 150 goto pathok
  124.    echo.
  125.    echo The 4DOS directory name is too long for automated installation.
  126.    goto fatalerr
  127. endiff
  128.  
  129.  
  130. :pathok
  131.  
  132. cdd "%@path["%@full[%0]"]" || (echo Cannot switch to the product directory! %+ goto fatalerr)
  133.  
  134. iff not exist 4%_dos.%@if[%_dos eq DOS,com,exe] then
  135.    cls
  136.    echo.
  137.    echo The 4%_dos automated installation batch file is not in the
  138.    echo directory where the product files are stored.  Please put all
  139.    echo the new 4%_dos files in the same directory and try again.
  140.    goto done
  141. endiff
  142.  
  143. iff %_dos eq DOS .and. (%_env lt 512 .or. %_alias lt 256) then
  144.    iff "%_jprr" eq "Y" then
  145.       exit 16
  146.    else
  147.       text
  148.  
  149. =========================================================================
  150.  
  151. The free environment or alias space is not adequate for automated
  152. installation.  The installation software will start a temporary copy of
  153. 4DOS with larger environment and alias space, and try again.
  154.  
  155.       endtext
  156.       pause
  157.       set _jprr=Y
  158.       .\4dos.com //envfree=768 //alias=%@eval[%_alias + 384] /c "%@full[%0]" %&
  159.       unset /q _jprr
  160.       iff %? eq 16 then
  161.          text
  162.  
  163. =========================================================================
  164.  
  165. The free environment or alias space is still inadequate for automated
  166. installation.
  167.          endtext
  168.          goto fatalerr
  169.       else
  170.          goto done
  171.       endiff
  172.    endiff
  173. endiff
  174.  
  175.  
  176. alias fatalerr `(echo %& %+ goto fatalerr)`
  177. alias wait `echo. %+ pause Press any key to continue ...`
  178. alias yesno `echo. %+ inkey /k"yn" %2& (Y/N)? %%%1`
  179. alias retry `(beep %+ iff "%2&" ne "" then %+ echo. %+ echo %2& %+ endiff %+ goto %1)`
  180. alias insthelp `pushd %+ .\insthelp.exe %& %+ set result=%? %+ popd`
  181. alias callrexx `pushd %+ call %& %+ set result=%? %+ popd`
  182. alias instinf `pushd %+ %instinf %& %+ popd`
  183. alias sep `echo. %+ echo %@repeat[%1,72] %+ echo.`
  184. alias clear `cls %+ echo. %+ echo.`
  185.  
  186. set reltype=%4
  187.  
  188. set product=4%_dos
  189. set cd=%_cwds
  190. if %product eq 4DOS .or. %product eq 4OS2 set cd=%@upper[%cd]
  191. set instinf=rem
  192. iff %product eq 4DOS then
  193.    iff %_win ge 40 then
  194.       set cd=%@sfn["%cd"]
  195.       set instinf=rundll.exe
  196.       if "%windir" ne ""  .and. exist "%windir\rundll.exe" set instinf=%windir\rundll.exe
  197.       set instinf=%instinf setupx.dll,InstallHinfSection DefaultInstall 132
  198.    endiff
  199. elseiff %product eq 4NT .and. %_dosver ge 4.00 then
  200.    set instinf=%SystemRoot\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
  201. endiff
  202.  
  203. set majordate=6405
  204. set newbdate=6405
  205.  
  206. switch %product
  207.    case 4DOS
  208.       set reqfiles=4DOS.COM OPTION.EXE 4HELP.EXE 4DOS.HLP INSTHELP.EXE
  209.       set exefile=4DOS.COM
  210.       set batext=BTM BAT
  211.       set opsys=DOS
  212.       if %_win ge 40 set opsys=Windows 95/98
  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 opsys=OS/2
  218.       option //execwait=Yes
  219.    case 4NT
  220.       set reqfiles=4NT.EXE 4NT.HLP 4NT.CNT SHRALIAS.EXE INSTHELP.EXE
  221.       set exefile=4NT.EXE
  222.       set batext=BTM CMD BAT
  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. set prevdir="%prevdir"
  250. iff %product eq 4DOS .and. %_win ge 40 then
  251.    set prevdir=%@sfn[%prevdir]
  252. endiff
  253. set slashdir=prevdir
  254. gosub addslash
  255.  
  256. if not isdir %prevdir retry getpdir That is not a valid directory
  257. iff not exist %[prevdir]%exefile then
  258.    echo This directory does not appear to contain a previous version of
  259.    echo %product.  Please try again.
  260.    retry getpdir
  261. endiff
  262.  
  263. set prevdate=%@date[%@filedate[%[prevdir]%exefile]]
  264. set majorupg=%@if[%prevdate lt %majordate,Y,N]
  265. set newbrand=%@if[%prevdate ge %newbdate,Y,N]
  266. unset prevdate
  267.  
  268. clear
  269. echo Your current %product.INI, 4START, and 4EXIT files (if any) will now be
  270. echo copied from the previous %product directory.  If these files already
  271. echo exist in the new %product directory you will be prompted for whether to
  272. echo replace the file in the new directory with the file from the old
  273. echo directory.
  274. echo.
  275. yesno yn Copy the %product.INI, 4START, and 4EXIT files
  276. iff "%yn" eq "Y" then
  277.  
  278.    :: Copy the files
  279.    if exist %[prevdir]%[product].ini copy %[prevdir]%[product].ini .\
  280.    for %f in (4START 4EXIT) for %e in (%batext) if exist %[prevdir]%f.%e copy %[prevdir]%f.%e .\
  281.  
  282.    :: Update paths in INI file
  283.    iff exist %product.INI then
  284.       sep -
  285.       echo Paths in the new copy of %product.INI will now be updated to point to your
  286.       echo new %product directory.  The old .INI file will be saved as %product.JPS.
  287.       echo If you do not allow this update, you must perform it manually, or %product
  288.       echo may not work properly.
  289.       iff %product eq 4DOS then
  290.          echo.
  291.          echo During the update process any old HelpPath directive will be removed from
  292.          echo 4DOS.INI (this directive is now obsolete), and an InstallPath directive
  293.          echo will be added.
  294.       endiff
  295.       yesno yn Update %product.INI
  296.       set jptemp=%@filename["%@unique[.]"]
  297.       iff "%yn" eq "Y" then
  298.          iff %product eq 4OS2 then
  299.             callrexx jpos2ins.cmd "4OS2" "%cd" "UpdateINI" "4OS2.INI" "%jptemp"
  300.          else
  301.             insthelp IniFile /d"%cd" /o"%product.INI" /t"%jptemp"
  302.          endiff
  303.          iff %result eq 0 then
  304.             copy %product.INI %product.JPS > nul
  305.             copy %jptemp %product.INI > nul
  306.          else
  307.             sep -
  308.             echo Paths in %product.INI could not be updated due to the above error.  Be sure
  309.             echo to manually update any settings in %product.INI which point to the %product
  310.             echo directory.  If you do not, %product may not work properly.
  311.          endiff
  312.          wait
  313.       endiff
  314.       del /q %jptemp > nul
  315.    endiff
  316.  
  317. else
  318.    sep -
  319.    echo You chose not to copy existing startup files from your previous %product
  320.    echo directory.  You may want to copy these files manually at a later time,
  321.    echo and update them for the new version.
  322.    wait
  323. endiff
  324.  
  325.  
  326. clear
  327.  
  328. if "%reltype" eq "P" goto trialver
  329.  
  330. echo The next part of the installation process varies depending on whether
  331. echo you own a purchased or "registered" version of %product, as opposed to a
  332. echo trial or "shareware" version.
  333. yesno yn Are you upgrading from a previously purchased copy of %product
  334. if "%yn" ne "Y" goto trialver
  335.  
  336.  
  337. iff %newbrand eq Y then
  338.  
  339.    :: Previous version is 6.0 / 3.0 or later
  340.    iff %majorupg eq Y then
  341.       :: Major update, order is probably required
  342.       sep -
  343.       echo The installation software has determined that you are installing a
  344.       echo major update to %product (as opposed to a minor or maintenance update).
  345.       echo.
  346.       echo Normally such updates must be purchased; please contact JP Software
  347.       echo or your dealer for details.  If you order an upgrade you can use the
  348.       echo trial version while you wait for your upgrade to arrive.
  349.       echo.
  350.       echo If you believe you are eligible for a free registered copy of this
  351.       echo version even though it is a major update (for example, because you
  352.       echo purchased a special offer which included the next version), you can try
  353.       echo to "brand" %product with your name and serial number manually; for
  354.       echo instructions see the README.TXT file.  If branding fails with the
  355.       echo message "Contact JP Software or your dealer for an upgrade" then you
  356.       echo must purchase the upgrade.
  357.       goto branddone
  358.    endiff
  359.  
  360.    :: Minor update
  361.    iff %product eq 4DOS then
  362.       :: Minor update to 4DOS, try to brand it
  363.       sep -
  364.       echo The installation software has determined that you are installing a
  365.       echo minor or maintenance update to 4DOS.  This portion of the installation
  366.       echo process will assist you in "branding" this update with your name and
  367.       echo serial number.
  368.    
  369.       iff exist %[prevdir]br4dos.exe then
  370.          yesno yn Brand the new version of 4DOS with your name and serial number
  371.          iff "%yn" eq "y" then
  372.             copy /u %[prevdir]br4dos.exe
  373.             do forever
  374.                .\br4dos.exe
  375.                if %? eq 0 leave
  376.                echo.
  377.                yesno yn Branding failed ... try again
  378.                if "%yn" ne "Y" leave
  379.             enddo
  380.          endiff
  381.       else
  382.          :: Oops, missing brand program.
  383.          wait
  384.          sep -
  385.          echo You cannot brand 4DOS now, because the BR4DOS program from the previous
  386.          echo version is not available in your old 4DOS directory.
  387.          echo.
  388.          echo The installation process will continue with the downloaded trial version.
  389.          echo To brand this version at a later time, see the README.TXT file.
  390.       endiff
  391.    else
  392.       :: Minor update to 4OS2 / 4NT
  393.  
  394.       :: If 4OS2, copy JPCONFIG.INI
  395.       if (%product eq 4OS2 .and. exist %[prevdir]jpconfig.ini) copy /u %[prevdir]jpconfig.ini .\ > nul
  396.  
  397.       sep -
  398.       echo The installation software has determined that you are installing a
  399.       echo minor or maintenance update to %product.  The "branding" (name and
  400.       echo serial number) information should already be stored on your system,
  401.       echo and will be transferred automatically to the new version.
  402.       echo.
  403.       echo If the information does not transfer properly, or you need to
  404.       echo reinstall your branding information for any other reason, see the
  405.       echo manual branding instructions in the README.TXT file.
  406.       echo.
  407.    endiff
  408.  
  409. else
  410.  
  411.    :: Updating from 5.5 / 2.5 or earlier
  412.    sep -
  413.    iff %product eq 4DOS then
  414.       text
  415. This portion of the installation process will assist you in "branding"
  416. 4DOS with your name and serial number.  Branding the program converts it
  417. from a trial (shareware) copy to one registered to you.
  418.  
  419. You are only eligible to brand this upgrade if your FIRST purchase of
  420. 4DOS was a version 5.5 or later diskette, and you are upgrading to
  421. version 6.02.  If your original purchase was for version 5.0 or earlier,
  422. or you obtained 4DOS on our CD Suite, in most cases you must purchase
  423. the version 6.02 upgrade (once you order the upgrade you can continue to
  424. use this trial version until your order arrives).  For more information
  425. on upgrades see PRODUCTS.TXT and UPGFORM.TXT.
  426.  
  427. Branding also requires the brand program and brand information (name,
  428. serial number, and validation code) from 4DOS 5.5 or later.  If you are
  429. eligible for the upgrade at no charge but have lost your brand
  430. information, contact JP Software to obtain a replacement (there is a
  431. small charge for this service).
  432.       endtext
  433.       iff exist %[prevdir]brand.exe then
  434.          yesno yn Brand the new version of 4DOS with your name and serial number
  435.          iff "%yn" eq "y" then
  436.             copy /u %[prevdir]brand.exe
  437.             do forever
  438.                .\brand.exe
  439.                if %? eq 0 leave
  440.                echo.
  441.                yesno yn Branding failed ... try again
  442.                if "%yn" ne "Y" leave
  443.             enddo
  444.          endiff
  445.       else
  446.          wait
  447.          sep -
  448.          text
  449. You cannot brand 4DOS now because the BRAND program from the previous
  450. version is not available in your old 4DOS directory.
  451.  
  452. The installation process will continue with the downloaded trial
  453. version.  To brand this version at a later time, see the instructions
  454. in the README.TXT file.
  455.          endtext
  456.       endiff
  457.  
  458.    else
  459.       echo This portion of the installation process provides information on
  460.       echo "branding" the new version of %product with your name and serial number.
  461.       echo.
  462.       echo This section is informational only; you cannot actually brand %product now
  463.       echo because it is in use (to run this installation batch file), and
  464.       echo %opsys does not allow running programs to be modified.  For manual
  465.       echo branding instructions see the README.TXT file.
  466.       echo.
  467.       echo You will only be eligible to brand this upgrade if your FIRST purchase
  468.       echo of %product was a version 2.5 or later diskette, and you are upgrading
  469.       echo to version 3.02.  If your original purchase was for version 2.0 or
  470.       echo earlier, or you obtained %product on our CD Suite, in most cases you
  471.       echo must purchase the version 3.02 upgrade (once you order the upgrade you
  472.       echo can continue to use this trial version until your order arrives).  For
  473.       echo more information on upgrades see PRODUCTS.TXT and UPGFORM.TXT.
  474.       echo.
  475.       echo Branding will also require the brand program and brand information
  476.       echo (name, serial number, and validation code) from %product 2.5 or later.
  477.       echo If you are eligible for the upgrade at no charge but have lost your
  478.       echo brand information, contact JP Software to obtain a replacement (there is
  479.       echo a small charge for this service).
  480.    endiff
  481. endiff
  482.  
  483. :branddone
  484. wait
  485. goto doconfig
  486.  
  487.  
  488. :noprev
  489. iff %product eq 4DOS then
  490.    echo [4DOS] >! 4DOS.INI
  491.    echo InstallPath = %cd >>! 4DOS.INI
  492. endiff
  493.  
  494. :trialver
  495. sep -
  496. iff "%reltype" eq "P" then
  497.    :: Pre-release
  498.    echo You may use this pre-release version of %product until the date stated
  499.    echo in the signon message when the program starts, or in the README.TXT or
  500.    echo other similar file which came with the pre-release.
  501.    echo.
  502.    echo After that time you must upgrade to or purchase the final release under
  503.    echo our standard license terms.  This pre-release version may be difficult
  504.    echo to use or cease to operate properly after the date shown in the signon
  505.    echo message or documentation.
  506.    echo.
  507.    echo See the license agreement in the file LICENSE.TXT for complete details.
  508. else
  509.    :: Shareware
  510.    echo You may use this new trial version of %product for up to 21 days while
  511.    echo evaluating it.  After that time you must purchase %product if you continue
  512.    echo to use it.  See the trial version information in the file TRIAL.TXT and
  513.    echo our license agreement in LICENSE.TXT for complete details.
  514. endiff
  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=%@filename["%@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=%@filename["%@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 jp4dossc.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/98 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/98'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 Win95/98 program group and desktop shortcut for 4DOS
  730.             iff "%yn" == "Y" then
  731.                instinf %[cd]jp4dossc.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/98.
  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/98 functions
  752. to best take advantage of features provided by 4DOS.  Specifically,
  753. they:
  754.  
  755.    - Create a new "4DOS Prompt here" entry in the context menu of drives
  756.      and directories, to launch 4DOS in that drive or directory.
  757.  
  758.    - Extend Windows' definition of a "batch file" to include BTM files.
  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/98'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.       del /zqe 4nt.fts 4nt.gid > nul
  803.       :: Registry stuff only works in NT 4.0
  804.       iff %_dosver ge 4.00 then
  805.          iff exist jp4ntsc.inf then
  806.             clear
  807.             text
  808. The installation software can create a JP Software program group for
  809. 4NT, accessible through the Windows NT Start menu.  The group will
  810. include shortcuts to start 4NT itself, and the 4NT help.  The same
  811. process creates a desktop shortcut for 4NT (easily deleted if you
  812. prefer to use only the Start menu).
  813.  
  814. The JP Software group and related desktop shortcuts will also be made
  815. removable using Windows NT's Uninstall facility (available from the
  816. Control Panel's Add / Remove Programs item).
  817.  
  818. If you choose not to create these items now, you can create shortcuts
  819. manually as described in the 4NT.TXT file, in the chapter on installing
  820. 4NT.
  821.             endtext
  822.             yesno yn Create a Windows NT program group and desktop shortcut for 4NT
  823.             iff "%yn" == "Y" then
  824.                instinf %[cd]jp4ntsc.inf
  825.                echo.
  826.                echo The program group and shortcuts have been created.
  827.                wait
  828.             endiff
  829.          endiff
  830.  
  831.          iff exist jp4nt.inf then
  832.             clear
  833.             text
  834. The installation software can install optional registry extensions for
  835. 4NT.  The registry extensions customize a few Windows NT functions to
  836. best take advantage of features provided by 4NT.  Specifically, they:
  837.  
  838.    - Create a new "4NT Prompt here" entry in the context menu of drives
  839.      and directories, to launch 4NT in that drive or directory.
  840.  
  841.    - Extend Windows' definition of a "batch file" to include BTM files,
  842.      including the ability to double-click on a BTM file to execute it.
  843.  
  844.    - Provide an additional "open" option in the context menu of all
  845.      batch files (.BAT, .CMD, and .BTM), to run the file with 4NT.
  846.  
  847. These registry extensions can be removed using Windows NT's Uninstall
  848. facility (available from the Control Panel under Add / Remove Programs).
  849.  
  850. If you choose not to install the registry extensions now, you can do so
  851. later as described in the 4NT.TXT file, in the 4NT installation chapter.
  852.             endtext
  853.             yesno yn Install 4NT registry extensions
  854.             iff "%yn" == "Y" then
  855.                instinf %[cd]jp4nt.inf
  856.                echo.
  857.                echo The registry extensions have been installed.
  858.                wait
  859.             endiff
  860.          endiff
  861.       endiff
  862.  
  863. endswitch
  864.  
  865.  
  866. clear
  867. switch %product
  868.  
  869.    case 4DOS .or. 4OS2
  870.       iff %csmod eq Y then
  871.          echo %product installation is complete.  The next time you reboot your system,
  872.          echo %product will be used as the default %opsys command processor.
  873.       else
  874.          echo %product installation is complete.  You chose not to update the system
  875.          echo CONFIG.SYS file during the installation process.  When you are ready,
  876.          echo update CONFIG.SYS as described in the %product.TXT file, then reboot.
  877.       endiff
  878.       iff %product eq 4DOS .and. %_win eq 40 then
  879.          echo.
  880.          echo To start 4DOS from the Windows 95/98 desktop, use the shortcut or
  881.          echo group echo created during the installation process.  If you did
  882.          echo not allow the installation software to create a shortcut you can
  883.          echo do so manually; instructions are in the 4DOS.TXT file, in the
  884.          echo chapter on 4DOS installation.
  885.       endiff
  886.  
  887.    case 4NT
  888.       echo 4NT installation is complete.  To start 4NT, use the shortcut or group
  889.       echo created during the installation process.  If you did not allow the
  890.       echo installation software to create a shortcut you can do so manually;
  891.       echo instructions are in the 4NT.TXT file, in the chapter on 4NT
  892.       echo installation.
  893.  
  894. endswitch
  895.  
  896. goto exit_noretry
  897.  
  898.  
  899.  
  900. :on_error
  901. :nonfatalerr
  902. on errormsg
  903. on break
  904. echo.
  905. echo.
  906. echo *** The installation stopped due to the above error.  The installation
  907. echo     program will restart the next time you start 4%_dos.
  908. echo.
  909. goto done
  910.  
  911. :on_break
  912. on errormsg
  913. on break
  914. echo.
  915. echo.
  916. echo *** Installation interrupted.  The installation program will restart
  917. echo     the next time you start 4%_dos.
  918. echo.
  919. goto done
  920.  
  921. :fatalerr
  922. on errormsg
  923. on break
  924. echo.
  925. echo.
  926. echo *** Installation stopped due to the above error.
  927. echo.
  928. echo You will have to complete the installation manually.  For
  929. echo instructions see the chapter on 4%_dos installation in the
  930. echo 4%_dos.TXT file.
  931. echo.
  932.  
  933. :exit_noretry
  934. on errormsg
  935. on break
  936. set bname="%@full[%0]"
  937. move %bname "%@path[%bname]\%@name[%bname].btx" >& nul
  938.  
  939. :done
  940. on errormsg
  941. on break
  942. if "%_jprr" eq "Y" (endlocal %+ quit)
  943. echo.
  944. iff "%qq" eq "Y" then
  945.    pause Press any key to exit ...
  946.    exit
  947. else
  948.    pause Press any key to exit to the 4%_dos prompt ...
  949. endiff
  950. endlocal
  951. quit
  952.  
  953. :addslash
  954.     iff "%@right[1,%[%slashdir]]" eq "%=q" then
  955.         if "%@instr[%@eval[%@len[%[%slashdir]]-2],1,%[%slashdir]]" ne "\" set %slashdir="%@instr[1,%@eval[%@len[%[%slashdir]]-2],%[%slashdir]]\"
  956.     else
  957.         if "%@right[1,%[%slashdir]]" ne "\" set %slashdir=%[%slashdir]\
  958.     endiff
  959. return
  960.  
  961.