Install 32-bit files and 64-bit registry settings in the WiX installer

Is it possible to configure a 64-bit registry key to refer to the path of 32-bit program files using WiX?

I am writing a plugin for other software. I want my dll plugin to go to C:\Program Files (x86)\MyPlugin\MyPlugin.dll not in C:\Program Files\MyPlugin\MyPlugin.dll , because the dll is 32-bit and not 64-bit.

However, I need the registry key to be in HKLM/Software/Company/Product/Etc.... not in HKLM/Wow6432Node/Software/Company/Product/Etc.... because the process that really reads the registry key is is 64-bit. This 64-bit process reads the registry and starts the 32-bit process for the isolated dll library.

Is there any way to do this? I tried to use different components with different Win64 attribute values ​​and even put them in separate component groups. However, I keep getting these build errors (not warnings):

 ICE80: This 64BitComponent RegistryComponent uses 32BitDirectory INSTALLFOLDER 
+5
source share
4 answers

If you support 32-bit and 64-bit machines, you need two separate MSI settings:

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

Thus, your 32-bit installation creates any COM entries for any 32-bit clients, and for a 64-bit installation, there are 32-bit and 64-bit components that are written to the registry.

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

+2
source

Somewhat bad decision, but you can just add custom actions to add entries to the registry, if you do not mind sticking them after removal.

If you write a custom action in C #, you can just do something like this:

 using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) { // do it } 
+3
source

A fairly simple solution for only one version of the installer for 32 and 64 bits is to export a REG file with the keys you want to add (from regedit), and then run a custom action during installation, that is:

<CustomAction Id='Add_Registry_Keys' Execute='deferred' Directory='DriverDir' Impersonate='no' ExeCommand='regedit.exe /s &quot;[DriverDir]default.reg' Return='ignore' />

+2
source

You can also suppress ICE errors, not just warnings. This means that you can use the Win64 attributes in x86 msi. The option to ignore ICE checks is located in the project properties on the Tool Options tab.

This may not be recommended, but if it works even better than an alternative to custom action.

0
source

Source: https://habr.com/ru/post/1208835/


All Articles