the_doc735 Posted September 29, 2006 Share Posted September 29, 2006 (edited) Using the [GuiRunOnce] Section of the Answer FileThe [GuiRunOnce] section of the answer file contains a list of commands that run the first time a user logson to the computer after Setup runs. For example, you enter the following line to the [GuiRunOnce]section to start the application installation program automatically:[GuiRunOnce]"%systemdrive%\ <appfolder>\<appinstall> -quiet"If you plan to use [GuiRunOnce] to initiate an installation, there are some additional factors to take intoconsideration:If the application forces a reboot, determine whether there is a way to suppress the reboot.This is important because any time the system restarts, all previous entries in the [GuiRunOnce] sectionare lost. If the system restarts before completing entries previously listed in the [GuiRunOnce] section, theremaining items will not be run. If there is no way within the application to suppress a reboot, you can tryrepackaging the application into a Windows Installer package There are third-party products that providethis functionality.Windows 2000 ships with WinINSTALL LE (Limited Edition), a repackaging tool for Windows Installer.WinINSTALL LE allows you to efficiently repackage pre-Windows Installer applications into packages thatcan be distributed with Windows Installer. For more information about WinINSTALL LE, see the\Valueadd\3rdparty\Mgmt\Winstle folder on the Windows 2000 Server CD.For more information about Windows Installer packaging, see "Automating Client Installation and Upgrade"in this book.ImportantIf you are installing an application to multiple localized language versions of Windows 2000, it isrecommended that you test the repackaged application on the localized versions to ensure that it copiesthe files to the correct locations and writes the required registry entries appropriately.If an application requires a Windows Explorer shell to install, the [GuiRunOnce] section will notwork because the shell is not loaded when the Run and RunOnce commands are carried out.Check with the application vendor to determine if they have an update or patch that can address thissituation for the application setup. If not, you can repackage the application as a Windows Installerpackage or use another means of distribution.Applications that use the same type of installation mechanism might not run properly if a /waitcommand is not used This can happen when an application installation is running and starts anotherprocess. When the Setup routine is still running, initiating another process and closing an active one mightcause the next routine listed in the RunOnce registry entries to start. Because more than one instance ofthe installation mechanism is running, the second application will usually fail. For an example of how tocontrol this using a batch file, see "Using a Batch File to Control How Multiple Applications Are Installed"later in this chapter.Using Application Installation ProgramsThe preferred method for preinstalling an application is to use the installation routine supplied with theapplication. You can do this if the application that you are preinstalling is able to run in quiet mode(without user intervention) by using a /q or /s command-line switch. See the application Help file ordocumentation for a list of command-line parameters supported by the installation mechanism.Following is an example of a line that you can place in the [GuiRunOnce] section to initiate the unattendedinstallation of an application using its own installation program.<path to setup> \ Setup.exe /qSetup parameters vary between applications. For example, the /l parameter included in some applicationsis useful when you want to create a log file to monitor the installation. Some applications have commandsthat can keep them from restarting automatically. This is useful in helping to control applicationPage Using the [GuiRunOnce] Section of the Answer File e 1 of 2http://www.microsoft.com/technet/prodtechn.../deploy/dgcb_... 29/09/2006installations with a minimal number of reboots.Make sure that you check with the application vendor for information, instructions, tools, and bestpractices information before you preinstall any application.ImportantYou must meet the licensing requirements for any application that you install, regardless of how you installit.Top of pageUsing a Batch File to Control How Multiple Applications Are InstalledIf you want to control how multiple applications are installed, you can create a batch file that contains theindividual installation commands and uses the Start command with the /wait command line switch. Thismethod ensures that your applications install sequentially and that each application is fully installed beforethe next application begins its installation routine. The batch file is then run from the [GuiRunOnce]section.The following procedure explains how to create the batch file, how to install the application, and then howto remove all references to the batch file after installation is complete.To install applications using a batch file1. Create the batch file containing lines similar to the following example:Start /wait <path to 1st application>\<Setup> <command line parameters>Start /wait <path to 2nd application>\<Setup> <command line parameters>Exitwhere:• <path> is the path to the executable file that starts the installation. This path must be availableduring Setup.• <Setup> is the name of the executable file that starts the installation.• <command line parameters> are any available quiet-mode parameters appropriate for theapplication you want to install.2. Copy the batch file to the distribution folders or another location that can be accessed during setup.3. With <filename>.bat as the name of the batch file, include an entry in the [GuiRunOnce] section ofthe answer file to run the batch file, similar to the following example. This example assumes thatthe batch file was copied to the Sysprep folder on the local hard disk, though it can be locatedanywhere that Setup has access to during an installation.[GuiRunOnce]"%systemdrive%\sysprep\<filename>.bat""<path-1>\<Command-1>.exe"" < path-n>\<Command-n>.exe""%systemdrive%\sysprep\sysprep.exe –quiet"where:• <path-1>\<Command-1.exe> and <path-n>\<Command-n.exe> are fully qualified paths toadditional applications or utility installations or configuration tools. This can also be a path toanother batch file. These paths must be available during setup. Edited September 29, 2006 by the_doc735 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now