Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Registry key value different in two Features


1 reply to this topic

TonyLowrey

TonyLowrey
  • Members
  • 15 posts

Posted 11 July 2006 - 17:12

I have several possible ways to set a particular registry key to different values depending on the feature selected for install.

What is the best practice to set these values so that all the rest of the good stuff like repair and modify work correctly.

I have complicated this a little by insisting that all components belong to merge modules.

The first idea was that I have a component for the key value 'default' in the "default" merge module and another component with a different GUID in a second "Feature1" merge module. In this case the components have different component GUIDS for the same key but with different values. Is that correct?

The "default" merge module is installed in all cases and I allocate the "Feature1" merge module to the optional feature so it is only installed if the feature is selected. This means that the registry key is set to the default value if the feature is not selected but 'overwritten' to the "Feature1" value if the feature is selected. This scenario installs the deafult value and overwrites with the second component with the feature1 value. This appears to work but requires that the feature1 value is written after the default value. Also two components with different GUIDs are writing the same registry key with different values which does not sound right.

How should this be done, same key but different values depending on feature selection?

Custom Actions are not considered good practice but I guess can be made to work.

Best practice guidelines welcome please.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 11 July 2006 - 20:08

Having two GUID's point to the same absolute path is always wrong. Remember the overall philosophy of MSI: Each GUID points to an absolute path, and only one absolute path. Accordingly an absolute path should never have more than one GUID pointing to it. Remember that an absolute path includes the file name. Hence these two absolute paths should have different GUIDs:

c:\test.txt
c:\test2.txt

In short: There should be a one to one match between:
GUID <-> Absolute path

Did you try to use a property value in the field: [THISISMYPROPERTY] and then assigning different values to this property depending on feature selection?
Regards
-Stein Åsmul