I use WIX 3.5 to create an MSI installer for a DLL.
I would like to make one installer that allows a simple user to install the program (per user) and also an administrator (per machine).
The registry entries I have to define, are different depending on the user preference:
If he select the "per user" option, the registry entry is HKEY_CURRENT_USER ,
as opposed if he select the "per machine" option, the registry entry is HKEY_LOCAL_MACHINE.
This is how the registry entry should be defined in code in case of per machine (HKLM):
<Component Id="AdminAddinsRegEntries" Guid="8777A7AB-B147-4850-9F25-65011306E9C6" >
<RegistryKey Root="HKLM" Key="Software\Sparx Systems\EAAddins\AdminAddins" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="AdminAddins.MyClass" />
</RegistryKey>
</Component>
This is how the registry entry should be defined in code in case of per user (HKCU):
<Component Id="AdminAddinsRegEntries" Guid="8777A7AB-B147-4850-9F25-65011306E9C6" >
<RegistryKey Root="HKCU" Key="Software\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?