Add or Remove System MSIs or Packages Online with OCSetup

Applies To: Windows 7, Windows Server 2008 R2

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

OCSetup can be called only on a running Windows® operating system. OCSetup installs and removes system Microsoft® Windows Installer components. It can also be used to pass packages to Deployment Image Servicing and Management (DISM.exe) for installation or removal, or to call the Windows Installer service MSIExec.exe.

OCSetup cannot use a path to determine the location of the system Windows Installer or package. System Windows Installers must be staged before installation. The path for packages must be specified in the servicing section of an unattended installation answer file.

To install language packs online, use DISM or the Language Pack Setup tool (Lpksetup.exe). For more information, see Add a Language Pack Online.

For more information about OCSetup command-line options, see OCSetup Command-Line Options.

You must install the latest version of the Windows OEM Preinstallation Kit (Windows OPK), which contains all of the necessary tools, including Windows System Image Manager (Windows SIM).

Install or Remove System Windows Installers or Packages Online

Before running OCSetup at a command prompt, set the command prompt to run as an administrator (even if you are logged on as administrator on the computer). To do this, perform the following procedure.

  1. Click Start, point to All Programs, and then click Accessories.

  2. Right-click Command Prompt, and then click Run as administrator.

To install or remove Windows Installers or packages

  1. Copy the out-of-box system Windows Installer or package to the local hard drive.

  2. If you are installing a package, then create an answer file in Windows SIM with the desired packages in the servicing section.

    For details on how to do this, see Add a Package to an Answer File.

  3. Validate the answer file and save it.

  4. At a command prompt, run the following command.

    start /w ocsetup Windows Installer or package name /unattendfile:path to answer file
    

    The Windows Installer or package name is case-sensitive. To remove a system Windows Installer or package, use the /uninstall option.

See Also

Concepts

Service an Online Image
OCSetup Command-Line Options