Deploiement Microsoft Office

De Wiki des Responsables Techniques du 85
Aller à : navigation, rechercher

Script de déploiement pour Office_14 (Office 2010 Pro Plus) avec le fichier de config.xml qui contient la clé MAK, activation auto ou sinon avec clé KMS et serveur KMS.

A utiliser avec Outil de Personnalisation Office, voir la procédure ici : http://technet.microsoft.com/fr-fr/library/cc179097(v=office.15).aspx

Script Office2010.bat

setlocal

REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************

REM Get ProductName from the Office products core Setup.xml file, and then add "office14." as a prefix. 
set ProductName=Office14.PROPLUS

REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\Serveur\Office_14$

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\Serveur\Office_14$\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\Serveur\Office_14$\LogFiles

REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************

IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
:ARP64
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if NOT %errorlevel%==1 (goto End)

REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a

64bit OS) 
:ARP86
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto End)

REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End

Endlocal