MS Office 2010

Preliminary reading

The page on MS Office 2007 is worthwhile preliminary reading for understanding this page.

'Office Customization Tool in Office 2010' - http://technet.microsoft.com/en-us/library/cc179097.aspx

'Config.xml file in Office 2010' - http://technet.microsoft.com/en-us/library/cc179195.aspx

MS Office 2010 (volume license)

Launch the Microsoft Office Customization Tool using setup.exe /admin. Specify any customisations you require and save them to a MSP file. The MSP file can be saved whereever is appropriate, such as the installer directory's \upgrades directory, or elsewhere. This file will be specified in the WPKG package and used by the Office installer.

Customization

Office Customization Tool (.msp)

Disable the Opt-in Welcome Wizard

In the Customization Tool, go to Features \ Modify user settings \ Microsoft Office 2010 \ Privacy \ Trust center and set "Disable opt-in wizard on first run" to Enabled.

Disabling Visual Basic for Applications

If you disable Visual Basic for Applications using Features → Set feature installation states → Office Shared Features → Visual Basic for Applications then beware that "Disabling VBA for Office can have far-reaching implications. Some of these include the following: You cannot install Microsoft Access." - http://support.microsoft.com/kb/287567.

config.xml

...

WPKG Package

<package 
	id="microsoftoffice2010" 
	name="Microsoft Office 2010 Standard" 
	revision="%PKG_VERSION%" 
	reboot="false" 
	priority="0">

	<variable name="PKG_VERSION" 		value="1" />
	<variable name="PKG_SOURCE"		value="%SOFTWARE%\Microsoft\Office2010\x86" architecture="x86" />
	<variable name="PKG_SOURCE"		value="%SOFTWARE%\Microsoft\Office2010\x64" architecture="x64" />
	<variable name="PKG_NAME"		value="setup.exe" />
	<variable name="PKG_MSP_NAME"		value="customisation.MSP" />
	<variable name="PKG_INSTALL_SWITCH"	value="/adminfile %PKG_SOURCE%\%PKG_MSP_NAME%" />
	<variable name="PKG_REMOVE_SWITCH"	value="/uninstall Standard /config %PKG_SOURCE%\silent-uninstall.xml" />
	<variable name="PKG_DESTINATION"	value="%PROGRAMFILES%\Common Files\microsoft shared\OFFICE14\Office Setup Controller" />
	
	<check type="uninstall" condition="exists" path="Microsoft Office .+ 2010" />

	<install cmd='"%PKG_SOURCE%\%PKG_NAME%" %PKG_INSTALL_SWITCH%' >
		<exit code="1641" />
		<exit code="3010" />
	</install>
    
	<upgrade cmd='"%PKG_SOURCE%\%PKG_NAME%" %PKG_INSTALL_SWITCH%' >
		<exit code="1641" />
		<exit code="3010" />
	</upgrade>
    
	<remove cmd='"%PKG_DESTINATION%\%PKG_NAME%" %PKG_REMOVE_SWITCH%' >
		<exit code="3010" />
	</remove>
</package>

Previously, the install, update, remove commands looked like::

	<install cmd='%comspec% /C start "" /WAIT "%SOFTWARE%\microsoft-office-2010\setup.exe" /adminfile "%SOFTWARE%\microsoft-office-2010\customisation.msp"' >

I'm tested on Win7 and Win10, that without "%comspec% /C start "" /WAIT" all work fine.

silent-uninstall.xml

To remove Office 2010 (as per Office 2007), create %SOFTWARE%\microsoft-office-2010\ containing\silent-uninstall.xml:

<Configuration Product="ProPlus">

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

	<Setting Id="SETUP_REBOOT" Value="NEVER" />

</Configuration>

'SETUP_REBOOT' 'NEVER' (above) prevents a reboot when Office is removed, otherwise it will reboot without asking after uninstallation.

KMS Activation

"If your organization has 50 or more computers that need to activate Office 2010, we recommend that you use Key Management Service (KMS). KMS activates the computers, or KMS clients, from a KMS host server that contains a KMS host key that is supplied by Microsoft. This method replaces direct activation through Microsoft, and gives the local administrator control of the process." - http://technet.microsoft.com/en-us/library/ff603508.aspx#section1

To activate Office via KMS, a 'dependant' WPKG XML file is created.

<?xml version="1.0" encoding="UTF-8"?>
<packages>

<package id="msoffice2010-activation" name="Activation MS Office 2010" revision="1" reboot="false" priority="71">

	<depends package-id="msoffice2010" />	
	<variable name="update" value="01" />	

	<check type="execute" path="%software%\office\msoffice10\maths_config\activation.bat" condition="exitcodeequalto" value="0" />

	<check type="file" condition="exists" path="%PROGRAMFILES%\Microsoft Office\Office14\WORDIRM.XML.%update%" />
	
	<!-- Make a backup of the random file WORDIRM.XML. This is used for the Remove part as there isn't
	an uninstaller for the update, therefore we need to uninstall something to make the Check work so that
	we can then uninstall the main Maple program-->
	<install cmd='%COMSPEC% /c copy /y "%PROGRAMFILES%\Microsoft Office\Office14\WORDIRM.XML" "%PROGRAMFILES%\Microsoft Office\Office14\WORDIRM.XML.%update%"' >
		<exit code="any" />
	</install>

	<!-- Now do the KMS... -->
	<install cmd='"%SYSTEMROOT%\system32\cscript" "%PROGRAMFILES%\Microsoft Office\Office14\OSPP.vbs" /sethst:kms.somewhere.over.the.rainbow' />

	<install cmd='"%SYSTEMROOT%\system32\cscript" "%PROGRAMFILES%\Microsoft Office\Office14\OSPP.vbs" /act' />
	
	<remove cmd='%COMSPEC% /c del /q "%PROGRAMFILES%\Microsoft Office\Office14\WORDIRM.XML.%update%"' />

<!-- 
To check Office is activated, run
cscript "%PROGRAMFILES%\Microsoft Office\Office14\OSPP.vbs" /dstatus
-->

</package>

</packages>

So that this package can be uninstalled, a random file in %PROGRAMFILES%\Microsoft Office\office14\ is copied, a 'check' added and the <remove> line removes this copied file.

activation.bat =

@echo off

%Systemroot%\system32\cscript "%ProgramFiles%\Microsoft Office\Office14\OSPP.vbs" /dstatus | find "---LICENSED---"
exit %errorlevel%

MS Office 2010 single license

The Office Customization Tool (OCT) is available only with volume licensed versions of Office 2010 (and the 2007 Office). Unfortunately the prices of volume licenses are significantly higher, than for single licenses. So the above solution can't be used if you bought several single licenses for budget reasons.

config.xml

To configure a silent installation (unattended installation) of an Office 2010 product that requires no user interaction, create a config.xml. You find an example in the subfolder of the installation called product_folder_name.WW

If you only Have a Key and a Download Version of office, you need to Unpack it (X16-32011.exe /extract:C:\Office), to get the Files and Folders.

<Configuration Product="SingleImage">
	<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
	<!--    you _have to_ enter a valid key here!   -->
	<PIDKEY Value="AAAAABBBBBCCCCCDDDDDEEEEE" /> 
	<!--    enter a serverpath to get a installlog of all clients    -->
	<!-- <Logging Type="standard" Path="\\local.or.serverpath\for\installlogs" Template="%computername%.log" /> -->
	<!--    automatically activate product during installation - not tested if works with single licenses    -->!
	<!-- <Setting Id="AUTO_ACTIVATE" Value="1" /> -->
	<!-- <USERNAME Value="Customer" /> -->
	<!-- <COMPANYNAME Value="Organisation" />  -->
	<!-- <INSTALLLOCATION Value="%programfiles%\Microsoft Office" /> -->
	<!-- <LIS CACHEACTION="CacheOnly" /> -->
	<!-- <LIS SOURCELIST="\\server1\share\Office;\\server2\share\Office" /> -->
	<!-- <DistributionPoint Location="\\server\share\Office" /> -->
	<!--    choose what to install    -->
	<OptionState Id="ACCESSFiles"  State="Absent" Children="force" /><!-- Access -->
	<OptionState Id="EXCELFiles"   State="Local"  Children="force" /><!-- Excel -->
	<OptionState Id="OneNoteFiles" State="Absent" Children="force" /><!-- OneNote -->
	<OptionState Id="OUTLOOKFiles" State="Absent" Children="force" /><!-- Outlook -->
	<OptionState Id="PPTFiles"     State="Local"  Children="force" /><!-- Powerpoint -->
	<OptionState Id="PubPrimary"   State="Absent" Children="force" /><!-- Publisher -->
	<OptionState Id="WORDFiles"    State="Local"  Children="force" /><!-- Word -->
	<!-- <Setting Id="Reboot" Value="IfNeeded" /> -->
</Configuration>

Installation

It is necessary to give a real product key in config.xml during installation. Remember, no volume license. So for single license products, every client has his own license number. You can deal in two ways with this problem:

A: change product key after installation

If you delete all subkeys from [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Registration] (for 32bit Office in a 64bit windows) or HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Registration\ (for a 64bit Office) after installation (and before first usage), Office ask the user for the product key after startup.

B: use a different config.xml for every client

You can create a copy of config.xml for every client and use the the Value %COMPUTERNAME% to direct the client to his config.xml

For automatically generation of the config file, you can use a little tool called FilesFromCSV use the above config.xml, replace the pid with %computername% save it as template.xml

Then generate a csv file like this and call it license.csv:

computername;pid
w01;010101
w02;020202
...

Finally run the tool with

FilesFromCSV.exe -HDR=YES -D=; -csv=C:\temp\license.csv -template=C:\temp\template.xml -filenamefield=computername -outpath=C:\temp\output\


after that you can install the packet with

<package id="office2010"
	name="Microsoft Office 2010"  
	revision="1"
	reboot="false"
	priority="10">

	<check type='logical' condition='or'>
		<check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2010" />
		<check type="uninstall" condition="exists" path="Microsoft Office Single Image 2010" />
	</check>

	<commands>
		<command type="install" cmd='%comspec% /C start "Installer" /WAIT "%SOFTWARE%\O2010\x86\setup.exe" /config "%SOFTWARE%\O2010\x86\%COMPUTERNAME%.xml"' >
			<exit code="1641" />
			<exit code="3010" />
		</command>
		<!-- <command type="install" cmd='"%SYSTEMROOT%\system32\cscript" "%PROGRAMFILES%\Microsoft Office\Office14\OSPP.vbs" /act' /> --><!-- not yet tested -->
	</commands>
</package>

Configuration

If you have an Windows Server with an AD, it is possible to use Group Policy to enforce some Office 2010 settings. You need the Office 2010 Administrative Template files and find a comprehensive guide in this document (change language before download if needed).

A good start for recommended settings is the table on the botton of this site

Disabling the popup-dialog at first use to choose the default file type is not possible with the supplied ADM. Instead got to HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\General and set ShownFileFmtPrompt as DWORD to 00000001 (Hex) (This action is also possible with GPO) --Konus 13:44, 3 February 2012 (CET)