home *** CD-ROM | disk | FTP | other *** search
- @*echo off
- *setlocal
- *unalias *
- setdos /g.,
- set product=Take Command
- on errormsg goto on_error
- on break goto on_break
- goto start
-
- text > nul
-
- _TCINST.BTM -- Take Command Self-Install
-
- Copyright 1997, JP Software Inc., All Rights Reserved.
- Author: Tom Rawson Last Revision: July 21, 1997
-
- This file is used to install a downloaded copy of Take Command/16, Take
- Command/32, or Take Command for OS/2. It performs basic installation
- functions once, then renames itself so it will not be run automatically
- a second time.
-
- DO NOT MODIFY THIS FILE UNLESS INSTRUCTED TO DO SO BY OUR SUPPORT STAFF.
- We cannot provide support for the installation process if you have
- modified the installation batch file!
-
- The primary functions provided by this file are:
-
- * Check that required files appear to have been extracted OK,
- and perform other similar tests for proper version, operating
- system, etc.
-
- * Locate the previous copy of the product, if any.
-
- * If there was a previous copy:
- - Copy over the old .INI and TCSTART files.
- - Update the old .INI file for the new path.
- - Allow branding of the new version if appropriate.
-
- * For Take Command/16:
- - Copy CTL3D as required
- - Use DDE to set up a Take Command group.
-
- * For Take Command/32:
- - If running in Windows NT 3.5, copy CTL3D as required
- - If running in Win95 or NT 4.0+, create a shortcut for Take Command,
- and add registry extensions.
-
- * For Take Command for OS/2:
- - Call a REXX script to update CONFIG.SYS (updates OS2_SHELL, COMSPEC,
- BOOKSHELF, DPATH, and LIBPATH).
- - Call a REXX script to create a desktop object for Take Command for
- OS/2.
- endtext
-
-
- :start
- iff %_dos eq WIN then
- iff %_winver ge 3.20 then
- cls
- text
-
- Take Command/16 is designed to run under Windows 3.1, 3.11, and Windows
- for Workgroups. We do not recommend installing it under Windows 95 or
- Windows NT. For a native 32-bit Windows implementation of our GUI
- command line tools use Take Command/32, rather than Take Command/16.
-
- endtext
- goto done
- endiff
- if %_4ver ge 1.0 goto verok
- endiff
- if %_dos eq WIN95 .and. %_4ver ge 1.0 goto verok
- if %_dos eq WIN32 .and. %_4ver ge 1.0 goto verok
- if %_dos eq PM .and. %_4ver ge 1.0 goto verok
- cls
- text
-
- This automated installation batch file is for use under Take Command 2.0
- or above. It will not work for other products, or earlier versions.
-
- endtext
- goto done
-
-
- :verok
- echo.
- echo Setting up ...
-
-
- setdos /c%=^
- setdos /p%=&
- setdos /e%=
-
- option //execwait=Yes
-
- alias fatalerr `(echo %& %+ goto fatalerr)`
- alias wait `echo. %+ pause Press any key to continue ...`
- alias yesno `echo. %+ inkey /k"yn" %2& (Y/N)? %%%1`
- alias retry `(beep %+ iff "%2&" ne "" then %+ echo. %+ echo %2& %+ endiff %+ goto %1)`
- alias addslash `if "%@right[1,%[%1]]" ne "\" set %1=%[%1]\`
- alias insthelp `pushd %+ .\insthelp.exe %& %+ set result=%? %+ popd`
- alias callrexx `pushd %+ call %& %+ set result=%? %+ popd`
- alias instinf `pushd %+ %instinf %& %+ popd`
- alias sep `echo. %+ echo %@repeat[%1,72] %+ echo.`
- alias clear `cls %+ echo. %+ echo.`
-
- set cd=%_cwds
- set instinf=rem
- switch %_dos
- case WIN
- set product=Take Command/16
- set base=TCMD
- set cd=%@upper[%cd]
- set opsys=Windows
- case WIN95
- set product=Take Command/32
- set base=TCMD32
- set instinf=rundll.exe
- if "%windir" ne "" .and. exist %windir\rundll.exe set instinf=%windir\rundll.exe
- set instinf=%instinf setupx.dll,InstallHinfSection DefaultInstall 132
- set opsys=Windows 95
- case WIN32
- set product=Take Command/32
- set base=TCMD32
- if %_dosver ge 4.00 set instinf=%SystemRoot\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
- set opsys=Windows NT
- case PM
- set product=Take Command for OS/2
- set base=TCMDOS2
- set opsys=OS/2
- endswitch
-
- switch %base
- case TCMD
- set reqfiles=TCMD.EXE TC16DLL.DLL TCMD.HLP
- set exefile=TCMD.EXE
- set batext=BTM BAT
- set oldver=1.02
- set verlist=1.0 2.0
- case TCMD32
- set reqfiles=TCMD32.EXE TC32DLL.DLL TCMD32.HLP TCMD32.CNT SHRALIAS.EXE
- set exefile=TCMD32.EXE
- set batext=BTM CMD BAT
- set oldver=1.02
- set verlist=1.0 2.0
- case TCMDOS2
- set reqfiles=TCMDOS2.EXE JPOS2DLL.DLL KEYSTACK.EXE TCMDOS2.INF TCMDOS2H.MSG JPOS2INS.CMD
- set exefile=TCMDOS2.EXE
- set batext=BTM CMD
- set oldver=1.0
- set verlist=1.0 2.0
- endswitch
-
-
- cls
- echo.
- echo.
- echo Welcome to Take Command!
- echo.
- echo This installation procedure is run automatically the first time you
- echo start a new downloaded or trial copy of Take Command. It is written
- echo entirely in the Take Command batch language.
- echo.
- echo If you are new to Take Command, this procedure will install Take Command
- echo on your system. No system files will be modified without your
- echo permission.
- echo.
- echo If you already have a previous version of Take Command installed, this
- echo procedure will copy the settings (in the .INI and TCSTART files) and
- echo registration information (if available) from the previous version, and
- echo -- after requesting your permission -- will update the appropriate
- echo configuration files.
- echo.
- echo If you have already installed this new version of Take Command, or prefer
- echo to perform the installation manually as described in the %base.TXT file,
- echo you can exit now, and this installation program will not be run again.
- echo.
- inkey /k"yn" Proceed with installation (Y/N)? %%yn
- if "%yn" ne "Y" goto exit_noretry
-
- cdd %@path[%@full[%0]] || (echo Cannot switch to the product directory! %+ goto fatalerr)
-
- iff not exist %exefile then
- cls
- echo.
- echo The Take Command automated installation batch file is not in the
- echo directory where the product files are stored. Please put all
- echo the new Take Command files in the same directory and try again.
- goto done
- endiff
-
-
- for %f in (%reqfiles) if not exist %f (set errname=%f %+ goto missing_file)
- goto filesok
-
- :missing_file
- sep =
- echo The %errname file is missing. This file is required to install
- echo %product. Please check that all downloaded files were
- echo placed in the same directory.
- goto nonfatalerr
-
-
- :filesok
-
- clear
- echo This procedure installs %product version %_4ver.
- yesno pver Are you currently using an earlier version of%=n%product on your system
-
- if "%pver" ne "Y" goto noprev
-
- :getpdir
- sep -
- echo Please enter the directory where your previous
- input version of %product is installed: %%prevdir
- addslash prevdir
-
- if not isdir %prevdir retry getpdir That is not a valid directory
- iff not exist %[prevdir]%exefile then
- echo This directory does not appear to contain a previous version of
- echo %product. Please try again.
- retry getpdir
- endiff
-
- set prevtime=%@filetime[%[prevdir]%exefile]
- set prevver=%@left[2,%prevtime].%@instr[3,1,%prevtime]
- unset prevtime
- if "%@left[1,%prevver]" eq "0" set prevver=%@right[3,%prevver]
- iff %@index[%verlist,%prevver] ne -1 then
- set newupg=%@if[%@eval[%prevver - %@left[%oldver,3]] ge 0.5,Y,N]
- set upgdist=%@eval[%@left[%_4ver,3] - %prevver]
- else
- sep -
- echo The installation software cannot identify your previous version of Take
- echo Command. Installation can proceed, but a few prompts may be incorrect.
- echo You can choose to proceed with the installation, re-enter the
- echo installation directory, or stop and perform the installation manually,
- echo using the instructions in %base.TXT
- echo.
- inkey /k"ydn" Enter Y to proceed, D to change the installation directory, or N to stop: %%yn
- if "%yn" eq "D" goto getpdir
- if "%yn" ne "Y" goto exit_noretry
- set newupg=N
- set upgdist=9.0
- endiff
- unset prevver
-
- clear
- echo Your current %base.INI, TCSTART, and TCEXIT files (if any) will now be
- echo copied from the previous Take Command directory. If these files already
- echo exist in the new Take Command directory you will be prompted for whether
- echo to replace the file in the new directory with the file from the old
- echo directory.
- echo.
- yesno yn Copy the %base.INI, TCSTART, and TCEXIT files
- iff "%yn" eq "Y" then
-
- :: Copy the files
- if exist %[prevdir]%[base].ini copy /r %[prevdir]%[base].ini .\
- for %f in (TCSTART TCEXIT) for %e in (%batext) if exist %[prevdir]%f.%e copy /r %[prevdir]%f.%e .\
-
- :: Update paths in INI file
- iff exist %base.INI then
- sep -
- echo Any TCStartPath directive in the new copy of %base.INI will now be
- echo updated to point to your new Take Command directory. The old .INI file
- echo will be saved as %base.JPS. If you do not allow this update, you must
- echo perform it manually, or %product may not work properly.
- echo.
- yesno yn Update %base.INI
- set jptemp=%@unique[.]
- iff "%yn" eq "Y" then
- iff %base eq TCMDOS2 then
- callrexx jpos2ins.cmd "TCMD" "%cd" "UpdateINI" "TCMDOS2.INI" "%jptemp"
- else
- copy %base.INI %jptemp > nul
- set oldtcpath=%@iniread[%jptemp,TakeCommand,TCStartPath]
- if "%oldtcpath" ne "" set result=%@iniwrite[%jptemp,TakeCommand,TCStartPath,%_cwd]
- endiff
- iff %result eq 0 then
- copy %base.INI %base.JPS > nul
- del /q %base.INI > nul
- copy %jptemp %base.INI > nul
- else
- sep -
- echo Paths in %base.INI could not be updated. Be sure to manually update
- echo any settings in %base.INI which point to the Take Command directory.
- echo If you do not, %product may not work properly.
- endiff
- wait
- endiff
- del /q %jptemp > nul
- endiff
-
- else
- sep -
- echo You chose not to copy existing startup files from your previous Take
- echo Command directory. You may want to copy these files manually at a
- echo later time, and update them for the new version.
- wait
- endiff
-
-
- clear
- echo The next part of the installation process varies depending on whether
- echo you own a purchased or "registered" version of %product, as
- echo opposed to a trial or "shareware" version.
- echo.
- yesno yn Are you upgrading from a previously purchased%=ncopy of %product
- if "%yn" ne "Y" goto trialver
-
-
- iff %newupg eq Y then
-
- :: Previous version is 2.0 or later
- iff %upgdist gt 0.1 then
- :: Major update, order is probably required
- sep -
- echo The installation software has determined that you are installing a
- echo major update to Take Command (as opposed to a minor or maintenance
- echo update).
- echo.
- echo Normally such updates must be purchased; please contact JP Software
- echo or your dealer for details. If you order an upgrade you can use the
- echo trial version while you wait for your upgrade to arrive.
- echo.
- echo If you believe you are eligible for a free registered copy of this
- echo version even though it is a major update (for example, because you
- echo purchased a special offer which included the next version), you can try
- echo to "brand" Take Command with your name and serial number manually; for
- echo instructions see the README.TXT file. If branding fails with the
- echo message "Contact JP Software or your dealer for an upgrade" then you
- echo must purchase the upgrade.
- else
- :: Minor update
- sep -
- echo The installation software has determined that you are installing a
- echo minor or maintenance update to Take Command. The "branding" (name
- echo and serial number) information should already be stored on your
- echo system, and will be transferred automatically to the new version.
- echo.
- echo If the information does not transfer properly, or you need to
- echo reinstall your branding information for any other reason, see the
- echo manual branding instructions in the README.TXT file.
- echo.
- endiff
-
- else
-
- :: Updating from 1.0x
- sep -
- echo This portion of the installation process provides information on "branding"
- echo the new version of %product with your name and serial number.
- echo.
- echo This section is informational only; you cannot actually brand Take
- echo Command now because it is in use (to run this installation batch file),
- echo and %opsys does not allow running programs to be modified. For
- echo manual branding instructions see the README.TXT file.
- echo.
- echo You will only be eligible to brand this upgrade if you originally
- echo purchased Take Command 1.0x on diskette, and you are now upgrading to
- echo version 2.0. If you originally obtained Take Command on our CD Suite,
- echo in most cases you must purchase the version 2.0 upgrade (once you order
- echo the upgrade you can continue to use this trial version until your order
- echo arrives). For more information see PRODUCTS.TXT and UPGFORM.TXT.
- echo.
- echo Branding will also require the brand program and brand information
- echo (name, serial number, and validation code) from your previous version of
- echo Take Command. If you are eligible for the upgrade at no charge but have
- echo lost your brand information, contact JP Software to obtain a replacement
- echo (there is a small charge for this service).
-
- endiff
-
- wait
- goto doconfig
-
-
- :noprev
- :trialver
- sep -
- echo You may use this new trial version of %product for up to 21
- echo days while evaluating it. After that time you must purchase Take Command
- echo if you continue to use it. See our license agreement in the file
- echo LICENSE.TXT for complete details.
- wait
-
-
- :doconfig
-
- if %base ne TCMDOS2 goto configdone
-
- set csname=%_boot:\CONFIG.SYS
- set csbak=%_boot:\CONFIG.JPS
- set csmod=N
- clear
- echo The installation process updates paths in CONFIG.SYS so that Take Command
- echo for OS/2 can locate its files properly. You have three choices:
- echo.
- echo - Update the system CONFIG.SYS file. This is the recommended method
- echo and will fully install Take Command for OS/2 on your system. Your
- echo previous CONFIG.SYS file will be saved as CONFIG.JPS.
- echo.
- echo - Make a copy of CONFIG.SYS in the Take Command for OS/2 directory
- echo and update that copy, instead of the "real" CONFIG.SYS file. This
- echo allows you to review the changes before implementing them. If
- echo there is already a copy of CONFIG.SYS in the Take Command for OS/2
- echo directory it will be renamed CONFIG.JPS.
- echo.
- echo - Skip the CONFIG.SYS update. In this case you will have to update
- echo CONFIG.SYS manually (see the TCMDOS2.TXT file for details).
- echo.
- echo Enter: Y to update %csname
- echo C to update a copy of CONFIG.SYS in the Take Command directory
- echo N to skip the CONFIG.SYS changes
- echo.
- inkey /k"YNC" Your choice: %%csopt
-
- switch %csopt
-
- case Y
- set jptemp=%@unique[.]
- callrexx jpos2ins.cmd "TCMD" "%cd" "UpdatePaths" "%csname" "%jptemp"
- iff %result eq 0 then
- copy %csname %csbak > nul
- copy %jptemp %csname > nul
- set csmod=Y
- sep -
- echo CONFIG.SYS has been updated.
- else
- sep -
- echo CONFIG.SYS could not be updated due to the above error. You must update
- echo it manually (see the TCMDOS2.TXT file for details).
- endiff
- del /q %jptemp > nul
-
- case C
- echo.
- if exist .\config.sys (move .\CONFIG.SYS .\CONFIG.JPS > nul)
- callrexx jpos2ins.cmd "TCMD" "%cd" "UpdatePaths" "%csname" "%[cd]CONFIG.SYS"
- iff %result eq 0 then
- sep -
- echo The copy of CONFIG.SYS has been updated. You can review this file, then
- echo make changes to the real CONFIG.SYS file manually when you are ready.
- else
- sep -
- echo The copy of CONFIG.SYS could not be updated due to the above error. You
- echo must update CONFIG.SYS manually (see the TCMDOS2.TXT file for details).
- endiff
-
- case N
- sep -
- echo CONFIG.SYS will not be updated. You can update it manually when you are
- echo ready (see the TCMDOS2.TXT file for details).
-
- endswitch
- wait
-
-
- :configdone
-
-
- switch %base
-
- case TCMD
- clear
- text
- The installation software can create a JP Software program group for
- Take Command/16, accessible from Program Manager. The group will
- include items to start Take Command itself, and the Take Command help.
-
- If you choose not to create these items now, you can create them
- manually at any time. For instructions see the TCMD.TXT file, in the
- chapter on installing Take Command/16.
-
- The group creation process may not work properly if Program Manager is
- not your Windows shell.
- endtext
- yesno yn Create a program group and items for Take Command/16
- iff "%yn" == "Y" then
- on errormsg
- echo.
- echo Working ...
- ddeexec progman, progman, [CreateGroup(JP Software)]
- (ddeexec progman, progman, [ReplaceItem(Take Command Prompt)]) >& nul
- ddeexec progman, progman, [AddItem(%[cd]%exefile,Take Command Prompt,,,,,%_cwd,,)]
- (ddeexec progman, progman, [ReplaceItem(Take Command Help)]) >& nul
- ddeexec progman, progman, [AddItem(WINHELP %[cd]TCMD.HLP,Take Command Help,,,,,%_cwd,,)]
- on errormsg goto on_error
- activate "%_wintitle"
- echo.
- echo The program group and items have been created.
- wait
- endiff
-
- sep -
- text
- Take Command/16 includes a feature called "Caveman" which allows you
- to run DOS applications within the Take Command window. In order to
- use Caveman, you must add a line to the Windows SYSTEM.INI file to
- load the Caveman driver, CAVEMAN.386.
-
- Due to the structure of SYSTEM.INI, the installation software cannot
- perform this step for you reliably. If you want to use Caveman, see the
- Take Command/16 installation instructions in TCMD.TXT, which explain how
- to add the line for CAVEMAN.386 manually.
- endtext
- wait
-
- case TCMD32
- clear
- :: Registry stuff only works in Win95 or NT 4.0
- iff (%_dos eq WIN95 .or. (%_dos eq WIN32 .and. %_dosver ge 4.00)) then
- iff exist jpsoft.inf then
- clear
- text
- The installation software can create a JP Software program group for
- Take Command/32, accessible through the Start menu. The group will
- include shortcuts to start Take Command/32 itself, and the Take
- Command/32 help. The same process creates a desktop shortcut for Take
- Command/32 (easily deleted if you prefer to use only the Start menu).
-
- The JP Software group and related desktop shortcuts will also be made
- removable using Windows' Uninstall facility (available from the Control
- Panel's Add / Remove Programs item).
-
- If you choose not to create these items now, you can create shortcuts
- manually as described in the TCMD32.TXT file, in the chapter on
- installing Take Command/32.
- endtext
- yesno yn Create a program group and desktop shortcuts%=nfor Take Command/32
- iff "%yn" == "Y" then
- instinf %[cd]jpsoft.inf
- echo.
- echo The program group and shortcuts have been created.
- wait
- endiff
- endiff
-
- iff exist jptcmd32.inf then
- clear
- text
- The installation software can install optional registry extensions for
- Take Command/32. The registry extensions customize a few Windows
- functions to take advantage of features provided by Take Command/32.
- Specifically, they:
-
- - Create a new "Take Command/32 Prompt" in the context menu of drives
- and directories, to launch Take Command in that drive or directory.
-
- - Extend Windows' definition of a "batch file" to include BTM files,
- including the ability to double-click on a BTM file to execute it.
-
- - Provide an additional "open" option in the context menu of batch
- files (.BAT, .CMD, and .BTM), to run the file with Take Command/32.
-
- These registry extensions can be removed using Windows' Uninstall facility
- (available from the Control Panel under Add / Remove Programs).
-
- If you choose not to install the registry extensions now, you can do so
- later as described in the TCMD32.TXT file, in the Take Command/32
- installation chapter.
- endtext
- yesno yn Install Take Command/32 registry extensions
- iff "%yn" == "Y" then
- instinf %[cd]jptcmd32.inf
- echo.
- echo The registry extensions have been installed.
- wait
- endiff
- endiff
- endiff
-
- case TCMDOS2
- clear
- text
- If you wish, the installation software can create an OS/2 desktop folder
- for Take Command for OS/2, including objects to start Take Command
- itself, and the Take Command help. You can also create these objects
- manually as described in the TCMDOS2.TXT file, in the chapter on
- installing Take Command for OS/2.
- endtext
- yesno yn Create an OS/2 desktop folder for Take Command
- iff "%yn" == "Y" then
- callrexx jpos2ins.cmd "TCMD" "%cd" "CreateFolder"
- wait
- endiff
-
- endswitch
-
-
- clear
- switch %base
-
- case TCMD .or. TCMD32
- echo %product installation is complete. To start %product, use
- echo the shortcut or group created during the installation process. If you
- echo did not allow the installation software to create a shortcut you can
- echo do so manually; instructions are in the %base.TXT file, in the chapter
- echo on %product installation.
-
- case TCMDOS2
- iff %csmod eq Y then
- echo Take Command for OS/2 installation is complete. Please reboot before
- echo using Take Command, so that the changes made to paths in CONFIG.SYS can
- echo take effect.
- else
- echo Take Command for OS/2 installation is complete. You chose not to update
- echo the system CONFIG.SYS file during the installation process. When you
- echo are ready, update CONFIG.SYS as described in the TCMDOS2.TXT file, then
- echo reboot.
- endiff
-
- endswitch
-
- goto exit_noretry
-
-
-
- :on_error
- :nonfatalerr
- on errormsg
- on break
- echo.
- echo.
- echo *** The installation stopped due to the above error. The installation
- echo program will restart the next time you start Take Command.
- echo.
- goto done
-
- :on_break
- on errormsg
- on break
- echo.
- echo.
- echo *** Installation interrupted. The installation program will restart
- echo the next time you start Take Command.
- echo.
- goto done
-
- :fatalerr
- on errormsg
- on break
- echo.
- echo.
- echo *** Installation stopped due to the above error.
- echo.
- echo You will have to complete the installation manually. For
- echo instructions see the chapter on %product installation
- echo in the %base.TXT file.
- echo.
-
- :exit_noretry
- on errormsg
- on break
- set bname=%@full[%0]
- move %bname %@path[%bname]\%@name[%bname].btx >& nul
-
- :done
- on errormsg
- on break
- echo.
- pause Press any key to exit to the Take Command prompt ...
- cls
- endlocal
- *if %@index["%prompt",$e] ne -1 *prompt
-
-