Run arbitrary commands with installations of the 2007 Office system
Updated: January 21, 2010
Applies To: Office Resource Kit
By default, the Setup program for the 2007 Microsoft Office system installs one Office product at a time. You can use the chaining feature to customize Setup to run an arbitrary command or a lightweight executable that you want to run when this product is installed. To add an arbitrary command or a lightweight executable, you can use the Add installations and run programs feature in the Office Customization Tool (OCT) or the Command element in Config.xml file. We recommend that you limit the use of Add installations and run programs and the Command element to running only lightweight executables or arbitrary commands that will not make changes to the computer or that do not require user input. For example, you can run a utility to copy logs or a command to launch a Welcome page at the end of installation.
The Add installations and run programs option in the OCT (command lines entered in the Add Program Entry and Modify Program Entry dialog boxes) and the Command element in the Config.xml file are intended to be used only for initial product installations and uninstallations. The commands are processed only during initial installations and uninstallations.
Chaining is not as reliable as installing each product separately. For example, if you chain two installations together and one of the products fails or encounters an unexpected error, the primary installation and the chained installation might not complete successfully. Therefore, using the chaining approach is not recommended. The recommended method for installing multiple products together is to use a deployment management program, such as Microsoft Systems Management Server or Microsoft System Center Configuration Manager 2007, or a third-party tool, instead of chaining. For more information, see Using Systems Management Server 2003 to deploy the 2007 Office system and Deploy the 2007 Office system by using System Center Configuration Manager 2007.
For information about Config.xml chained command issues, see KB article 928467, Chained commands do not run after the installation of a 2007 Office suite or program fails on the Microsoft Help and Support Web site (at http://go.microsoft.com/fwlink/?LinkId=99913).
In the following example, the OCT is used to add an arbitrary program to the installation.
To customize the primary installation to run a command
Create a network installation point that includes the product that you will install. For more information, see Create a network installation point for the 2007 Office system.
Run the OCT by running Setup.exe from the root of the network installation point with the /admin command-line option. For example, run: \\server\share\Office12\setup.exe /admin.
In the Select Product dialog box, select the product that is the primary installation.
In the left pane of the OCT, select Licensing and user interface. In the right pane, set Display level to None, enter the Product key, and select I accept the terms in the License Agreement.
For more information about “Licensing and user interface” and Display level options, see Office Customization Tool in the 2007 Office system.
In the left pane, select Add installations and run programs. In the right pane, click Add.
In the Add Program Entry dialog box, perform the following steps for the executable that is chained.
For Target, enter the fully qualified path of the executable file that you want to run after the primary installation. For example, enter \\server\share\Office12\copylogs.bat.
For Arguments, enter the string of arguments to be passed to the executable. For example, enter: QuietArg="/q" Wait="30000"
As mentioned previously, command lines entered in the Add Program Entry and Modify Program Entry dialog boxes are intended to be used only for initial installs and uninstalls. Command lines are processed only during initial installs and uninstalls.
Select the Run this program after the Office product has been installed option to run the program listed in the Target box after the Office installation is complete. This is the recommended option.
You can also select the Run this program before the Office product has been installed option if you want the program listed in the Target box to run before the Office installation starts. However, if the program does not terminate correctly, or if it restarts the computer, Office is not installed, and programs further down the list do not run.
Make other customizations in the OCT as needed.
Save the Setup customization file with a unique name in the Updates folder of the network installation point.
Exit the OCT.
To install the product
Run Setup from the root of the network installation point. For example, if the primary product is Office Enterprise 2007, enter: \\server\share\setup.exe
If you also used the Config.xml file to configure installation options in addition to the OCT setup customization .msp file customizations, run Setup from the root of the network installation point and specify the Config.xml file that you customized for the primary product. For example, if the primary product is Office Enterprise 2007, enter:
\\server\share\setup.exe /config \\server\share\Enterprise.WW\config.xml
In the Select Product dialog box, select the primary product.
After Setup installs the primary product, it runs the arbitrary command or lightweight executable that you specified in the OCT.
You can put the customization files that you created in a location other than the Updates folder. Just add the /adminfile option to the Setup command lines in the procedures earlier in this section to specify the customization files to use. For more information about how to use Setup command-line options, see Setup command-line options for the 2007 Office system.
How it works
The Setup program for the primary product follows the typical installation process. After that installation is complete, Setup runs the additional lightweight executable or arbitrary command that you specified in the OCT. Setup waits until each program is finished before it runs the next program.
It is important to run the primary Setup quietly. A chained Setup program cannot run if the primary Setup program is running interactively. You must run the primary Setup program with Display level set to None. It is recommended that chained installations also run with Display level set to None. And because you are running Setup quietly, you must enter the product key for each product in the OCT.
ConceptsOffice Customization Tool in the 2007 Office system
Config.xml file in the 2007 Office system
Create a network installation point for the 2007 Office system
Run Setup for the 2007 Office system on users' computers
Deploy the 2007 Office system by using System Center Configuration Manager 2007
Using Systems Management Server 2003 to deploy the 2007 Office system