MS Office 2007

This is the silent installer for Office 2007 with a .MSP file generated by running: setup.exe /admin

Install

On the Office 2007 distribution point there is a folder called Updates which contains nothing. Each patch you want to apply to office 2007 is supposed to be added inside that folder and it will also recognize the .msp and apply it.

Generate custom.msp using "setup.exe /admin", and place custom.msp in the "Updates" folder.

<package id="office2007" name="Microsoft Office 2007" revision="2007" reboot="false" priority="0">

  <check type="uninstall" condition="exists" path="Microsoft Office Enterprise 2007" />

  <install cmd='"%SOFTWARE%\Office 2007\setup.exe"' >
     <exit code="1641" reboot="delayed"/>
  </install>

</package>

For installation media having more than one Office 2007 edition, we have to explicitly select the version for silent installation using the /config switch, as listed below: (replace ProPlus with the version you would like to use, e.g. ProPlus, Standard)

<package id="office2007" name="Microsoft Office 2007" revision="2007" reboot="false" priority="0">

  <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2007" />

  <install cmd='"%SOFTWARE%\Office2007\setup.exe" /config "%SOFTWARE%\Office2007\ProPlus.WW\config.xml"' >
     <exit code="1641" reboot="delayed"/>
  </install>

</package>

Upgrade

http://technet.microsoft.com/en-us/library/cc179141.aspx .

"You cannot apply the Setup customization file to existing installations by putting the MSP file in the Updates folder and running Setup again on the user's computer, or by running Setup with the customization file specified in the command line. You must apply the MSP file directly to the user's computer."

So, for an upgrade command we must apply the msp file directly using msiexec:

  <upgrade cmd='msiexec /qn /p "%SOFTWARE%\Office 2007\updates\Custom.msp"'>
    <exit code="1641" reboot="delayed"/>
  </upgrade>

Remove

Before a <remove /> option can be applied, a silent uninstallation file must be created on the share where the installation files exist. Navigate to the Version.WW folder (Enterprise.WW or ProPlus.WW for example). Copy the config.xml and name it silentuninstall.xml. Edit the silentuninstall.xml file to resemble the following:

<Configuration Product="Enterprise">
    <Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
</Configuration>

Now add the following line to your packages.xml file (remembering to replace [Version]):

<remove cmd='"%SOFTWARE%\Office 2007\setup.exe" /uninstall [Version] /config  "%SOFTWARE%\Office2007\[Version].WW\silentuninstall.xml"' />

Integrate Service Pack into the installer

While you might know slipstreaming from other Microsoft products, this isn't possible for Office 2007. It's actually just installing the regular version and then updating to the selected Service Pack.

You don't need previous Service Packs. The newest Service Pack always replaces older once.

Download Service Pack 2 from Microsoft. Remember to select the language matching your Office-pack.

Execute the downloaded file with the following parameters (where the **-** is your language code) and accept the EULA:

office2007sp2-kb953195-fullfile-**-**.exe /extract:C:\SERVPACK

Move the contents of C:\SERVPACK to the folder called UPDATES in your original Office installation.

Now you can burn the Office installation or just execute it from a network share. The Service Pack will automatically be installed.