我在使用具有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位安装程序,我可以写入两个路径?谁能告诉我我做错了什么?感谢你的帮助。
感谢您的答案@phildw。使用64位安装程序,我现在可以写入32位和64位注册表。 – 2014-11-07 08:46:01