简体   繁体   中英

Make Installer for Both 64 and 32 bit

I use WIX to create an MSI installer for a DLL.

I would like to make one installer that allows to install the program on 64 bit platform just as on 32 bit.

The registry entries I have to define, are different for 32 and 64 bit.

This is the entry where I have to create a key in case it is 64 bit platform:

H_KEY_LOCALMACHINE\Software\Wow6432Node\Sparx Systems\EAAddins\AdminAddins

This is the entry where I have to create a key in case it is 32 bit platform:

H_KEY_LOCALMACHINE\Software\Sparx Systems\EAAddins\AdminAddins   

This is how the registry entries are defined in code:

<Component Id="AdminAddinsRegEntries" Guid="8777A7AB-B147-4850-9F25-65011306E9C6" >
  <RegistryKey Root="HKLM" Key="Software\Wow6432Node\Sparx Systems\EAAddins\AdminAddins" Action="createAndRemoveOnUninstall">
     <RegistryValue Type="string" Value="AdminAddins.MyClass" />
  </RegistryKey>
</Component>

How can I add the condition to avoid two different installers?

You just need to make a 32 bit install package. That's all. The system, through the registry redirector , will handle all the details of the separate 32/64 bit registry views for you.

The 32 bit package is processed by a 32 bit process when installed on a 64 bit system and is subject to registry redirection. The redirector will arrange for the key to be written in the 32 bit view of the registry.

You should not hardcode the Wow6432Node string. Just in case you miss that bit, let me say it again. You should not hardcode the Wow6432Node string.

So, to summarise:

  1. Make a 32 bit package.
  2. Use Software\\Sparx Systems\\EAAddins\\AdminAddins as the registry key.
  3. Let the redirector take care of the 32/64 bit registry view details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM