Thursday, March 17, 2011

I Was Wrong

Yesterday I posted a script for upgrading from Office 2007 to 2010.  It wasn't the "way to go".

A former boss of mine, back in my construction days, used to say "I am man enough to admit when I'm wrong.  I was wrong to listen to you!" and he somehow kept a straight face.  Just a thought that made me smile, but in any case, I can't blame anyone but myself.

The reason is this:  The WMI Uninstall() method works fine.  The WMI process monitor on "setup.exe" works fine as well.  But the problem is that when it's done with "setup.exe", it forces a reboot 9 times out of 10.  That's not good (unless you don't intend on finished the rest of the script for installing 2010).

The better way is to use "setup.exe /uninstall [ProductCode] /config [config_file.xml]" where [ProductCode] is something like "ProPlus" or whatever.  The trick is that you have to kick it off with "start /wait", but that's not all (sorry Billy Mays and Ron Popeil).  The START command doesn't like UNC paths.  So you need to stuff a PUSHD call in first, switch to the source (admin) share for Office 2007 and run the START /WAIT SETUP.EXE... command from there.  Then it works.

No comments: