2

我在使用具有64位Chrome的64位计算机的Wix Installer时遇到了一个问题。 我需要为64位计算机写入Wow6432路径和常规路径(HKLM \ Software \ Google \ Chrome),以便在Chrome中启用我们的应用扩展程序(Chrome 32从Wow6432路径读取并从常规路径读取Chrome 64)。我有下面的代码片段在64位中写入32位注册表值O

<Component Id='RegistryComponents' Guid='{771E66CF-7086-4A56-AAF9-3571ADBEB9AA}' Win64='no'> 
    <RegistryKey Id='ChromeExtnInstaller' Root='HKLM' Key='Software\Google\Chrome\Extensions\$(var.Extension)' Action='createAndRemoveOnUninstall'> 
     <RegistryValue Name='update_url' KeyPath='yes' Type='string' Value='https://clients2.google.com/service/update2/crx' /> 
    </RegistryKey> 
    <RegistryKey Id='NativeMessagingHost' Root='HKLM' Key='Software\Google\Chrome\NativeMessagingHosts\<NM_ID>' Action='createAndRemoveOnUninstall'> 
     <RegistryValue Type='string' Value='[INSTALLDIR]<Value>' /> 
    </RegistryKey> 
    <RemoveRegistryKey Action='removeOnUninstall' Root='HKLM' Key='Software\Google\Chrome\Extensions\$(var.Extension)'/> 
    <RemoveRegistryKey Action='removeOnUninstall' Root='HKLM' Key='Software\Google\Chrome\NativeMessagingHosts'/> 
</Component> 

<?if $(var.Platform)=x64 ?> 
<Component Id='RegistryComponents64' Guid='{20A0BA25-0EFC-49F5-8945-24F084EC3635}' Win64='yes'> 
    <RegistryKey Id='ChromeExtnInstaller64' Root='HKLM' Key='Software\Google\Chrome\Extensions\$(var.Extension)' Action='createAndRemoveOnUninstall'> 
     <RegistryValue Name='update_url' KeyPath='yes' Type='string' Value='https://clients2.google.com/service/update2/crx' /> 
    </RegistryKey> 
    <RegistryKey Id='NativeMessagingHost64' Root='HKLM' Key='Software\Google\Chrome\NativeMessagingHosts\com.sling.wbsp' Action='createAndRemoveOnUninstall'> 
     <RegistryValue Name='Default' Type='string' Value='[INSTALLDIR]com.sling.wbsp.json' /> 
    </RegistryKey> 
    <RemoveRegistryKey Action='removeOnUninstall' Root='HKLM' Key='Software\Google\Chrome\Extensions\$(var.Extension)'/> 
    <RemoveRegistryKey Action='removeOnUninstall' Root='HKLM' Key='Software\Google\Chrome\NativeMessagingHosts'/> 
</Component> 
<?endif?> 

而且在功能部分:

<ComponentRef Id="RegistryComponents"/> 
<?if $(var.Platform)=x64 ?> 
    <ComponentRef Id="RegistryComponents64"/> 
<?endif?> 

当我尝试使用64位机上的x86安装程序安装,只有Wow6432Node密钥更新。因此,64位Chrome无法安装扩展程序。如果我制作64位安装程序,Chrome 64可以正常工作,但Chrome 32会失败。我怎样才能确保使用标准的32位安装程序,我可以写入两个路径?谁能告诉我我做错了什么?感谢你的帮助。

回答

1

一般的情况是,32位的MSI只能包含32位的组件,且包括注册表:

http://msdn.microsoft.com/en-us/library/aa367451(v=vs.85).aspx

和独立的MSI需要用于不同的架构:

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

如果你有一个64位的设置,你应该能够写入32位注册表以及64位注册表,因为顶级链接说,所以我想你是什么样的missi在64位安装程序中,是一个写入本机64位注册表的组件,另一个相同的条目对于32位注册表具有Win64 =“no”。

+0

感谢您的答案@phildw。使用64位安装程序,我现在可以写入32位和64位注册表。 – 2014-11-07 08:46:01