VSTO x64 runtime installed but can’t be found

Posted on

Problem :

I created a WiX installer deploying an add in for Windows 2010. Target system is currently x64 Win & Office installed. I walked through several microsoft sites telling me that i’ll need than an x64 installer & runtime (because the add in loads into the process of current word running).
This installer checks the existence of VSTO Runtime using this statement:

<?if $(var.Platform)=x64 ?>
<?define win64Flag = "yes"?>
<?else ?>
<?define win64Flag = "no"?>
<?endif ?>

    <RegistrySearch Id="VSTORuntimeRedist" Root="HKLM" Key="SOFTWAREMicrosoftvsto runtime setupv4RVSTORFeature_CLR40" Name="Version" Type="raw" Win64="$(var.win64Flag)"/>

    <RegistrySearch Id="OfficeRuntime" Root="HKLM" Key="SOFTWAREMicrosoftVSTO Runtime Setupv4" Name="Version" Type="raw" Win64="$(var.win64Flag)"/>
<Condition Message="The Visual Studio 2010 Tools for Office Runtime is not installed. Please install the Office Runtime.">
    <![CDATA[Installed OR VSTORUNTIMEREDIST>="10.0.30319" OR OFFICERUNTIME>="10.0.21022"]]>

Actually it’s working for the x86 Version of my Installer, but build in x64 mode, it is unable to find the x64 entry in the registry at any time (even if the runtime is installed).
I already tried to uninstall and reinstall the runtime (with reboot acutally) but it does not worked.

I also removed the check to get my Add In installed but it’s not loading then acutally.

Therefore my question is, if there is any known bug-issue or I used the wrong registry key?

Solution :

On x64 systems WoW64 apps are transparently redirected into Wow6432Node node of the registry, so they actually look for a key like HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftVSTO Runtime Setup there it is located. But the real x64 apps look into real HKEY_LOCAL_MACHINESOFTWAREMicrosoftVSTO Runtime Setup node, and the key is, naturally, not present there. This, most probably causes your installer to fail. So, for a x64 installer you need to specify full node with Wow6432Node path part.

This is called Registry Reflection and covered in details here.

Leave a Reply

Your email address will not be published. Required fields are marked *