安装VSTO 64运行,但无法找到VSTO

2023-09-03 00:40:28 作者:誮開べ誮亦落

我创建了一个WiX的安装程序部署中添加针对Windows 2010目标系统是目前的x64赢和放大器;安装Office。我通过几个微软网站走到告诉我,我需要比64位的安装程序和放大器;运行时(因为该加载在加载到当前字运转过程中)。 此安装程序将检查VSTO运行时使用这种说法的存在:

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 ?>

<Property Id="VSTORUNTIMEREDIST">
    <RegistrySearch Id="VSTORuntimeRedist" Root="HKLM" Key="SOFTWARE\Microsoft\vsto runtime setup\v4R\VSTORFeature_CLR40" Name="Version" Type="raw" Win64="$(var.win64Flag)"/>
</Property>

<Property Id="OFFICERUNTIME">
    <RegistrySearch Id="OfficeRuntime" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4" Name="Version" Type="raw" Win64="$(var.win64Flag)"/>
</Property>
<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"]]>
</Condition>

其实它的工作为我安装的x86版本,但在建64位模式下,无法找到在任何时候(即使是安装运行时)在注册表中的64项。 我已经尝试卸载并重新安装运行时(重启,实际上可以),但它并没有奏效。

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.

所以我的问题是,如果有任何已知的bug的问题,或者我用了错误的注册表项?

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

推荐答案

在x64系统上了WoW64应用被透明地重定向到 Wow6432Node 节点的注册表,所以他们实际上寻找如 HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \微软\ VSTO运行时设置有它位于一个关键。但真正的64位应用程序看看真正的 HKEY_LOCAL_MACHINE \ SOFTWARE \微软\ VSTO运行时设置节点,关键是,当然,不是present那里。这一点,很可能会导致您的安装程序失败。因此,对于64位安装程序,你需要指定完整的节点 Wow6432Node 路径的一部分。

On x64 systems WoW64 apps are transparently redirected into Wow6432Node node of the registry, so they actually look for a key like HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup there it is located. But the real x64 apps look into real HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTO 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.