jvivace Posted May 25, 2011 Posted May 25, 2011 Unattended/Silent UPGRADE from 2003 to 2007What I have been tasked to do is to create a custom unattended/silent upgrade from 2003 to 2007.Management is wanting to take the 2003 products installed on the machine and upgrade those without adding anything else that comes with 2007.Example: If user has OneNote 2003 installed they want to make sure it gets upgraded to 2007 when the upgrade happens...BUT...if OneNote2003 is not installed they dont want it to get installed during the upgrade...After all my searching and diving around, I dont think this is possible...Anyone? Quote
NIM Posted May 26, 2011 Posted May 26, 2011 Yeah, I don't think you'll be able to do that.Here's the script that uninstalls Office 2003 and install Office 2007, but can't do what you mentioned in your example..'This script will uninstall Microsoft Office 2003, wait for the uninstall to finish and then begin'installing Microsoft Office 2007. This can be configured to be completely silent or allow prompts'to inform its progress. Dim installDim startsecondsDim endsecondsDim differencestartseconds = Int(Timer) 'start the initial time when script was run 'This will start the uninstall of Office 2003 based on its PID number and the /qn switch is silent 'If a confimation is desired the /qn+ switch can be used.Set wshell = CreateObject("WScript.Shell") wshell.run "msiexec /x {90110409-6000-11D3-8CFE-0150048383C9} /qb-" '/qn -silent /qb- no modalSet wshell = nothing 'END code to uninstall Office 2003install = 1WScript.Sleep 10000 'allows the process time to start before Process Check() function runsProcessCheck()'WScript.Echo "office 2003 has been uninstalled. Office 2007 will begin installation." 'starts install of Office 2007. To make this fully silent the custom-uA.xml file needs to be modifiedSet wshell = CreateObject("WScript.Shell") 'this batch line must run locally where the setup.exe file is 'UNC pathing does not work with batch commands wshell.run "setup.exe /config custom-uA.xml" 'this batch line must run locally where the setup.exe file isSet wshell = nothing 'End code to install Office 2007install = 2WScript.Sleep 10000 'allows the process time to start before Process Check() function runsProcessCheck()endseconds = Int(Timer)difference = (endseconds - startseconds) / 60'WScript.Echo "office 2007 has been installed."WScript.Echo "Office 2003 was uninstalled and Office 2007 was installed" & vbCrLf & vbCrLf & "This took " & difference & " minutes"'Function to check the processesSub ProcessCheck() Dim computer computer = "." Dim process Dim processNumber Dim count count = 15 'any number that grater than possible processes with the same name If install = 1 Then process = "msiexec.exe" Do until count <= 1 Set service = GetObject("winmgmts:\\" & computer & "\root\cimv2") Set results = service.ExecQuery(" Select * from Win32_Process where Name ='" & process & "'") count = 0 for each obj in results count= count+1 ' Wscript.echo obj.Name ' Wscript.echo obj.ProcessID Next WScript.sleep 1000 loop 'WScript.Echo "count = " & count Else 'office 07 setup process = "setup.exe" count=1 Do until count = 0 Set service = GetObject("winmgmts:\\" & computer & "\root\cimv2") Set results = service.ExecQuery(" Select * from Win32_Process where Name ='" & process & "'") count = 0 for each obj in results count = 1 ' Wscript.echo obj.Name ' Wscript.echo obj.ProcessID Next WScript.sleep 1000 loop 'WScript.Echo "count = " & count End IfEnd Sub'END the Function to check the processes Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.