VSTO Runtime bootstrapper package failure causes deployed customization installation to fail (Aaron Cathcart)

In an attempt to make this easier to read here are a few terms I will be using frequently in this article:

  • VSTOR = Visual Studio Tools for the Microsoft Office System (version 3.0 Runtime) (x86)
  • VSTORSP1 = Visual Studio Tools for the Microsoft Office System (version 3.0 Runtime) Service Pack 1(x86)
  • Bootstrapper = the clickonce bootstrapper that gets deployed with a VSTO customization when there are prerequisites checked (setup.exe)

Some of our customers have raised an issue with the bootstrapper failing after deploying their customizations onto a user’s machine that has previously had VSTOR & VSTORSP1 installed.

The problem occurs when an end user installs VSTOR followed by VSTORSP1 then subsequently uninstalls VSTOR from the Add/Remove Programs wizard. The uninstall removes the entire product including the service pack but fails to update the registry keys that our bootstrapper uses to detect if VSTOR is installed. If a user then installs a customization using the bootstrapper it will incorrectly detect that VSTOR is installed and proceed to install VSTORSP1, at which point it fails.

I recently responded to a customer on the VSTO forums ( http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2dd02b04-cc89-47c3-8f76-462ecfbee65e ) regarding this issue where I approached it from an end-user perspective, providing them with a list of fixes for post-deployment use. The purpose of this article is to provide a solution that developers can utilize so that end-users machines do not require post-deployment modification. 

This workaround will allow developers to bake the correct VSTOR detection logic into every customization they develop that utilizes the bootstrapper. 

Here is what you need to do:

  1. On the development machine locate the file %ProgramFiles%Microsoft SDKsWindowsv6.0ABootstrapperPackagesVSTOR30product.xml
  2. Replace the element
    <RegistryCheck Property=VSTORuntimeInstalledKey=HKLMSOFTWAREMicrosoftVSTO Runtime Setupv9.0.21022Value=Install/>
    <MsiProductCheck Property=VSTORuntimeInstalledProduct={8FB53850-246A-3507-8ADE-0060093FFEA6}/>
  3. Alter the element
    <BypassIf Property=VSTORuntimeInstalledCompare=ValueGreaterThanOrEqualToValue=1/>
    to be
    <BypassIf Property=VSTORuntimeInstalledCompare=ValueGreaterThanOrEqualToValue=3/>

And that’s it! Now that you have made these changes to your product.xml, every VSTO customization you build and deploy with a bootstrapper will correctly detect if VSTOR is installed regardless of what state the end-users machine is in.