I've got an installer with a couple features, and they can either all be
installed on one machine or on multiple machines. The features write values
to the registry to auto-populate properties on upgrades, however some of
the features use the same properties (database location, for example). What
I ended up doing was writing several registry keys for this same value with
slightly different names (e.g. Database_A, Database_B, Database_C). To pull
these values out of the registry, I  have a bit of code like this:

<Property Id="Database">        <RegistrySearch Id="Database_A" Root="HKLM"
Key="$(var.RegistryKey)" Name="Database_A" Type="raw"
/>      <RegistrySearch Id="Database_B" Root="HKLM"
Key="$(var.RegistryKey)" Name="Database_B" Type="raw"
/>      <RegistrySearch Id="Database_C" Root="HKLM"
Key="$(var.RegistryKey)" Name="Database_C" Type="raw" /></Property>

However, I recently added some code that had to a similar thing (read
a property written by two features), and did it by reading in two
separate properties and then using a custom action to overlay the
values:

<Property Id="Path">

        <RegistrySearch Id="Path" Root="HKLM" Key="$(var.RegistryKey)"
Name="Path" Type="raw" /></Property><Property
Id="Path2">     <RegistrySearch Id="Path2" Root="HKLM"
Key="$(var.RegistryKey)" Name="Path2" Type="raw" /></Property>

...

<InstallExecuteSequence>
        ...     <Custom Action="OverlayPath"
Before="SomethingElse"><![CDATA[Path2<>""]]></Custom>
        ...</InstallExecuteSequence>

...

<CustomAction Id="OverlayPath" Property="Path" Value="[Path2]" />

This second approach also works. So my question is, which is the
preferred method? Multiple RegistrySearch elements for one property is
certainly cleaner, but I couldn't find anything clearly defining the
expected behavior.


Thanks,

Adam
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to