Share via


Run arbitrary commands with installations of the 2007 Office system

Updated: January 21, 2010

Applies To: Office Resource Kit

This Office product will reach end of support on October 10, 2017. To stay supported, you will need to upgrade. For more information, see , Resources to help you upgrade your Office 2007 servers and clients.

 

Topic Last Modified: 2016-11-14

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.

Important

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 https://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

  1. 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.

  2. 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**.

  3. In the Select Product dialog box, select the product that is the primary installation.

  4. 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.

  5. In the left pane, select Add installations and run programs. In the right pane, click Add.

  6. 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"

      For information about the Command element and supported attributes, see “Command element” in Config.xml file in the 2007 Office system.

      Note

      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.

    • Click OK.

  7. Make other customizations in the OCT as needed.

  8. Save the Setup customization file with a unique name in the Updates folder of the network installation point.

  9. Exit the OCT.

To install the product

  1. 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

    -or-

    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

  2. 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.

Tip

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.