;************* Computer Weekly Office 2007 KIX Script text *************** ? "Running Job for Office 2007 preparation" ? "Please be patient, this may take some time..." Select Case InGroup("Office2007DeploymentPhase1-gs") ? "You are a member of the Office 2007 Rollout Group" $officeinstall = "1" Case InGroup("Office2007DeploymentPhase2-gs") ? "You are a member of the Office 2007 Rollout Group 2" $officeinstall = "1" Case InGroup("Office2007DeploymentPhase3-gs") ? "You are a member of the Office 2007 Rollout Group 3" $officeinstall = "1" Case InGroup("Office2007ProDeployment-gs") ? "You are a member of the Office 2007 Pro Rollout Group" $officeinstall = "2" case 1 $officeinstall = "0" ? "You will not have office installed at present" EndSelect ? "*********** Copying Office 2007 Install Files *************" if $officeinstall = "1" If not exist ("C:\Windows\OfficeTrack\officecopied.txt") Shell '"\\server\Office2007$\setup.exe" /config "\\server\Office2007$\configs\liscache.xml"' if @error = 0 ? "Office Preparation complete" if not exist ("C:\Windows\OfficeTrack") md "C:\Windows\OfficeTrack" endif Copy "\\server\office2007$\officecopied.txt" "C:\Windows\OfficeTrack" endif Else ? "Office 2007 Files have already been copied to your workstation" endif endif if $officeinstall = "2" If not exist ("C:\Windows\OfficeTrack\officeprocopied.txt") Shell '"\\server\Office2007Pro$\setup.exe" /config "\\server\Office2007Pro$\configs\liscache.xml"' if @error = 0 ? "Office Preparation complete" if not exist ("C:\Windows\OfficeTrack") md "C:\Windows\OfficeTrack" endif Copy "\\server\office2007Pro$\officeprocopied.txt" "C:\Windows\OfficeTrack" endif Else ? "Office 2007 Pro Files have already been copied to your workstation" endif endif ? "***** Run Office Install if allowed here ******" ;This part will begin the office install if the above officeinstall variable is set to one If ($officeinstall = "1" And Not Exist ("C:\Program Files\Microsoft Office\alreadyinstalled.txt") And Exist ("C:\Windows\OfficeTrack\officecopied.txt")) ? "Running Office 2007 Install" Shell '"C:\MSOCache\All Users\{90120000-0012-0000-0000-0000000FF1CE}-C\setup.exe" /adminfile "\\server\Office2007$\Configs\installformec.msp" /config "\\server\Office2007$\configs\lisinstall.xml"' ? "Script now waiting for Office to reboot your system or for setup to continue" Sleep 20 Else ? "Office 2007 Already Installed" EndIf If ($officeinstall = "2" And Not Exist ("C:\Program Files\Microsoft Office\alreadyinstalled.txt") And Exist ("C:\Windows\OfficeTrack\officeprocopied.txt")) ? "Running Office 2007 Pro Install" Shell '"C:\MSOCache\All Users\{90120000-0011-0000-0000-0000000FF1CE}-C\setup.exe" /adminfile "\\server\Office2007Pro$\Configs\installformec.msp" /config "\\server\Office2007Pro$\configs\lisinstall.xml"' ? "Script now waiting for Office to reboot your system or for setup to continue" Sleep 20 Else ? "Office 2007 Pro Already Installed" EndIf If exist ("C:\Program Files\Microsoft Office\alreadyinstalled.txt") $officepresent = "1" else $officepresent = "0" endif ;************ Install Office 2003 Web Components Add-in for Office 2007 ****************** If $officepresent = "1" and $officeinstall <> "0" And Not Exist ("C:\Windows\OfficeTrack\Web.txt") ? "Installing Office 2003 Web Components Add-in for Office 2007" Shell "\\server\office2007$\Web\owc11.exe /quiet" if @error = 0 Copy "\\server\office2007$\Web\Web.txt" "C:\Windows\OfficeTrack" ? "Setup of Web Components Add-in complete" $WebPresent = "1" endif else ? "Office 2003 Web Components add-in install bypassed" EndIf If exist ("C:\Windows\OfficeTrack\Web.txt") $WebPresent = "1" else $WebPresent = "0" endif ;************ Install Save as XPS or PDF Add-in for Office 2007 ****************** If $officepresent = "1" and $officeinstall <> "0" And Not Exist ("C:\Windows\OfficeTrack\XPSPDF.txt") ? "Installing Save as PDF and XPS Add-in" Shell "\\server\office2007$\XPSPDF\SaveAsPDFandXPS.exe /quiet" if @error = 0 Copy "\\server\office2007$\XPSPDF\XPSPDF.txt" "C:\Windows\OfficeTrack" ? "Setup of XPS/PDF Add-in complete" $XPSPDFPresent = "1" endif else ? "Save as PDF and XPS add-in install bypassed" EndIf If exist ("C:\Windows\OfficeTrack\XPSPDF.txt") $XPSPDFPresent = "1" else $XPSPDFPresent = "0" endif ;*********** Install .Net Frameworks 3.5 SP1 ****************** ;Newly added section to install .Net frameworks 3.5sp1 due to requirement by VSTOinstaller.exe $sp1value = "Blank" $sp1value = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5","Version") if ($officepresent = "1" and $sp1value <> "3.5.30729.01" and $officeinstall <> "0") ? "Installing .net framework 3.5 SP1" Shell "\\server\netlogon\net2\dotnetfx35.exe /qb /norestart" if @error = 0 ? ".net frameworks 3.5 SP1 installed" $netpresent = "1" else ?".net frameworks install failed, please check" endif endif ;************ Install Visual Studio Runtime for Office 2007 ****************** ; Will install Visual Studio only if .net frameworks 3.5 SP1 is installed $netvalue = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5","Install") if @error = 0 if ($netvalue = "1" and $officeinstall <> "0" And Not Exist ("C:\Windows\OfficeTrack\VSTO.txt")) ? "Installing Visual Studio Tools 3.0" Shell "\\server\office2007$\VSTO\vstor30.exe /q" if @error = 0 Copy "\\server\office2007$\VSTO\VSTO.txt" "C:\Windows\Officetrack" ? "Setup of Visual Studio Runtime complete" $VSTOPresent = "1" else ? "There has been an issue with the Visual Studio Runtime Install." Endif EndIf Else ? "Error reading registry key for .Net Frameworks 3.5 Check" ? "Visual Studio Tools 3.0 install bypassed" Endif ;************* Copy and install Office 2007 "Ribbon" files and training videos to all machines ************* ;The Files are copied to the Windows Directory as it is likely no-one will bother looking in that ;directory to delete things If ($officeinstall <> "0" And Not Exist ("C:\WINDOWS\Ribbon")) MD C:\Windows\Ribbon if @error = 0 ? "Ribbon Folder Created" endif else ? "Ribbon folder creation bypassed" endif If $officeinstall <> "0" And Not Exist ("C:\Windows\OfficeTrack\RibbonCopied.txt") Shell 'xcopy "\\server\netlogon\Ribbon\*.*" "C:\Windows\Ribbon" /E /Y /Q' if @error = 0 Copy "\\server\netlogon\OfficeRibbonInstall\RibbonCopied.txt" "C:\Windows\OfficeTrack" else ? "Help file copy bypassed or failed" EndIf endif If exist ("C:\Windows\OfficeTrack\RibbonCopied.txt") $ribbonpresent = "1" else $ribbonpresent = "0" endif ;************* Silent Install the Office Ribbon links to the Help files ************************ ;running using VSTOInstaller from the Visual Studio Tools (locally based on user's workstations) ? "Running registry change to allow silent Office Ribbon install" if $officeinstall <> "0" and $ribbonpresent = "1" shell "Regedit /s \\server\netlogon\OfficeRibbonInstall\newexceptions.reg" if @error = 0 ? "Registry has been updated to allow silent Ribbon install." Else ? "Registry hasn't been updated. You may experience problems with the Ribbon Install" endif endif if exist ("C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe") $VSTOpresent = "1" else $VSTOpresent = "0" endif if $officepresent = "1" and $officeinstall <> "0" and $ribbonpresent = "1" and $VSTOpresent = "1" ? "Installing Word Help" Shell '"C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe" /Silent /Install "\\server\netlogon\OfficeRibbonInstall\GroupM Word Help Toolbar.vsto"' if @error = 0 ? "Word Help Installed" $WordRibbon = "1" else ? "Word Help Install failed" endif ? "Installing Excel Help" Shell '"C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe" /Silent /Install "\\server\netlogon\OfficeRibbonInstall\GroupM Excel Help Toolbar.vsto"' if @error = 0 ? "Excel Help Installed" $ExcelRibbon = "1" else ? "Excel Help Install failed" endif ? "Installing Powerpoint Help" Shell '"C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe" /Silent /Install "\\server\netlogon\OfficeRibbonInstall\GroupM PowerPoint Help Toolbar.vsto"' if @error = 0 ? "Powerpoint Help Installed" $PowerpointRibbon = "1" else ? "Powerpoint Help Install failed" endif else ? "Ribbon Install has been bypassed due to Ribbon Files not being present on workstation" endif ;************ Moment of Truth ************ ;if everything has actually worked, and a certain file doesn't exist then ;the users will recieve a message saying all is well. ? "Has office made it?" if $officeinstall <> "0" and not exist ("C:\Windows\Officetrack\Messagerecieved.txt") if ($officepresent = "1" and $WebPresent = "1" and $XPSPDFPresent = "1" and $WordRibbon = "1" and $ExcelRibbon = "1" and $PowerpointRibbon = "1") Shell "\\server\netlogon\OfficeSuccess.bat" copy "\\server\netlogon\Messagerecieved.txt" "C:\Windows\OfficeTrack" endif endif exit exit