Office 2007 Deployment: The Main Script Part 5

And now we reach the point where we install those Ribbon customisations. Now last time, I left Part 4 of the Main Script entry with the question of what could make the install of the ribbon files stop in its tracks. And so to the continuation of the logon script which will shed light on the matter.

;************* 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
 if @error = 0
 ? “Registry has been updated to allow silent Ribbon install.”
 ? “Registry hasn’t been updated. You may experience problems with the Ribbon Install”

What is this? A registry change? Why do we need to alter the registry to achieve our goals?

Well it’s down to Microsoft as it goes.

You see, Microsoft introduced some security measures with .net applications to make sure that the user is certain they want to install the program they have just executed. One of the options you have is adding a certificate to the install files, and having a corresponding certificate on the workstations.

Then only certified applications would install without the prompt and if they recieved a program of questionable origin, they are warned. A jolly good idea really, as you do want to make sure that only authorised programs are installed.

If you were to run the install program from the VSTO file you created, you would be presented with something like this:


ribboninstallverify.gifBasically if you’re happy with the install to proceed, then click install. Easy to do, but the problem with this is that the installer would prompt the user during the install process when we call the relevant files and there’s a chance they would not install it. We want to eliminate that from the process to make sure that the user doesn’t have to do anything.

Enter this command called via KIX:
Shell ‘”C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe” /Silent /Install “\\server\netlogon\OfficeRibbonInstall\GroupM Excel Help Toolbar.vsto”‘

Basically what we are doing is using the VSTOInstaller.exe which would be installed as part of the Visual Studio Runtime files to make the install silent and to specify the VSTO file we want to install. But if we were to run this as it stands, it would do nothing.

Unless the VSTO installs have occured on the machine before, the install will not work. You don’t even get an error message except for perhaps looking in the event viewer afterwards.

Now of course this is a problem. But fear not, because now we discuss the contents of the registry entry.

Basically when you install the ribbon for the first time, clicking install and allowing it to complete, registry entries are made with a “Public Key” hash of the program and the installation source where it was installed from. That means that future versions can be installed without issue.

All you have to do then really to get around this whole issue to install the programs you want on a test system from the location you will access the files from, then navigate to this portion of the registry on the same system:


An example of what you’re looking for:

file://server/netlogon/OfficeRibbonInstall/GroupM Excel Help Toolbar.vsto”

Export those entries under the Inclusion key and there you have it! A way for the installer to basically think it’s been installed before on any workstation you apply those changes to and therefore allow the silent install to take place. The best part is that it applies to the HKEY_CURRENT_USER section of the registry and therefore Admin permissions are not required.

Now before we do install the ribbons, we need to make sure that the VSTOInstaller.exe exists: 

if exist (“C:\Program Files\Common Files\Microsoft Shared\VSTO\9.0\VSTOInstaller.exe”)
$VSTOpresent = “1”
$VSTOpresent = “0”

And if all is good, then we can proceed with the actual install; 

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”
  ? “Word Help Install failed”

 ? “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”
  ? “Excel Help Install failed”

 ? “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”
  ? “Powerpoint Help Install failed”

? “Ribbon Install has been bypassed due to Ribbon Files not being present on workstation”

After all that, you can check Add\Remove Programs to see if they have installed, and also launch the Office app to ensure that the customisations worked. The beginning of the check involved the major variables which have been populated over the course of the script, also again checking that Office is installed in the first place otherwise it’s a waste of time going through this portion.

And finally, to round it all up, we have a little message that will pop up if everything installed:

;************ 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 “
  copy “
\\server\netlogon\Messagerecieved.txt” “C:\Windows\OfficeTrack”

Now we are checking for the existence of a text file which states that the user has already recieved a successful install message. If it’s not there, then all the variables are checked to make sure all the the components did install. If they did then they recieve a message via the batch file and then the “Messagerecieved.txt” file is copied across to the Officetrack folder which means they should see that message again.

And that is the complete script! Join us next time for some results of testing and installation results from the actual rollout, examples of communication sent out to the end users and the KIX file ready for you to download and test as you see fit.