Office 2007 Deployment: The Main Script Part 2

As mentioned last time, we are continuing with the content of the KIX script used to deploy out Office 2007:

? “***** 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 FilesMicrosoft Officealreadyinstalled.txt”) And Exist (“C:WindowsOfficeTrackofficecopied.txt”))
? “Running Office 2007 Install”
Shell ‘”C:MSOCacheAll Users{90120000-0012-0000-0000-0000000FF1CE}-Csetup.exe” /adminfile “
\serverOffice2007$Configsinstall.msp” /config “\serverOffice2007$configslisinstall.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 FilesMicrosoft Officealreadyinstalled.txt”) And Exist (“C:WindowsOfficeTrackofficeprocopied.txt”))
? “Running Office 2007 Pro Install”
Shell ‘”C:MSOCacheAll Users{90120000-0011-0000-0000-0000000FF1CE}-Csetup.exe” /adminfile “
\serverOffice2007Pro$Configsinstall.msp” /config “\serverOffice2007Pro$configslisinstall.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 FilesMicrosoft Officealreadyinstalled.txt”)
$officepresent = “1”
else
$officepresent = “0”
endif

At first glance it is a bit of a brain ****, but in actual fact it does use the same methodology as the office file cache we saw back in the first part. Once again the $officeinstall variable is being used to tell what version of Office the users are getting. 1 was for standard, 2 for professional and 0 meant office would not be installed at all.

However there is this bit which may cause concern:

C:MSOCacheAll Users{90120000-0012-0000-0000-0000000FF1CE}-Csetup.exe

Where did we come up with that? Well believe it or not, it was as a result of running the cache job and just searching for the setup.exe file on the workstation. Office will cache to the msocache folder on the bigger HD on the system, but as our users here only have the C: Drive avaliable, we could be certain where the MSOCache folder will be. However we weren’t certain where the files would copy to as that string above ({90120000-0012-0000-0000-0000000FF1CE}-C) could chage every time it copied across to a new machine.

Thankfully it didn’t. (Thank you Microsoft!!)

So in order to come up with that location you may need to run the cache job and then look in the MSOCache folder as to where it’s located.

Then we’ve got the rest of the command line:

/adminfile “\serverOffice2007$Configsinstall.msp” /config “\serverOffice2007$configslisinstall.xml”‘

basically here we are calling the MSP file created in the Office Customization Tool, and then another xml file to configure the option to reboot if needed:

<Setting Id=”Reboot” Value=”IfNeeded” />

That’s all we have for the lisinstall.xml which is not commented out, as the rest is taken care of via the MSP. So if all goes well at this point you should see something like this:

officebeinginstalled.gif

Basically it lets the users know what is going on, the progress of the main office install and the most important thing of all; no-one can interfere with the install bar someone exiting it via the Windows Task Manager. But that can be said of many things through all this process so there are worse things which could happen.

We did configure our Office install to leave a “alreadyinstalled.txt” file in the root of the program filesMicrosoft Office folder which again we are using to detect if everything went well and to avoid running the set-up again which explains this part of the if statement:

Not Exist (“C:Program FilesMicrosoft Officealreadyinstalled.txt”)

Though again you can do a check of the registry instead if you don’t want to leave txt files all over the place. Now after the install completes we do come across this:

? “Script now waiting for Office to reboot your system or for setup to continue”
Sleep 20
Else

Why are we telling the kix script to wait for 20 seconds? Well the line above gives it away as we noticed during some of the initial configuration that the script would just carry on with the rest of what we wanted to install but that was interupted by Office wanting to reboot the machine in some cases and this had the capacity to make us cry with half a completed install which did in fact cause further attempts to install to fail.

We had to have some form of pause to minimise any potential issues as a result of a reboot after the main install.

If exist (“C:Program FilesMicrosoft Officealreadyinstalled.txt”)
$officepresent = “1”
else
$officepresent = “0”
endif

And finally we have a function here where we populate another variable called $officepresent which just looks for the text file and then gives it a value based on the results. We’re going to use that as we go on as a way of checking if other installation components should in fact run.

The next part we’re going to talk about Visual Studio 2008 and the reason why we even are going to look at it at all will be revealed….  

Join the conversation

2 comments

Send me notifications when other members comment.

Please create a username to comment.

MediaEdge Office 2007 Deployment: The Main Script Part 3 We return to the KIX logon script for the Office 2007 rollout to explain more on what we are doing...
Cancel
hi, great script you got up there. I tried and worked just fine. I will try to customize the code and apply some ajax on it.

thanks a lot.

Cancel

-ADS BY GOOGLE

SearchCIO

SearchSecurity

SearchNetworking

SearchDataCenter

SearchDataManagement

Close