PDA

View Full Version : Installing component to multiple features / locations



AaronM
07-21-2008, 08:52 AM
I did some searching on this topic and found a few posts, but wanted to see if anyone else had any helpful insight on this in addition to my reserach/testing.

Scenario 1 - Multiple features, same install location
FeatureA and FeatureB install to same destination and share common file(s). - When I add the component a second time, it creates an additional entries in the File and Component tables of the MSI dabase with a generated number for suffix to distinguish the two. If one feature was required, then could possibly leave it out of the second feature. If both features or optional, then would need a better approach. Possibly could make a "Shared" feature which is required and any duplicate components get put in there.

Scenario 2 - Multiple features, different install location
FeatureA and FeatureC install to different destinations, but share common file(s). - Would it be best to simply create two separate components of the same file in the installer?

Any other ideas? Please categories your responses/tips with the corresponding scenario since they are different. Thanks.

bryanwolf
07-21-2008, 12:21 PM
A Component is best remembered as a set of resources being installed to a single location. As long as the target location is the same then the component codes of all files should be equal (e.g. FileA residing at DirectoryB should always be represented by ComponentCode X). Associating a single component with multiple features has undesirable consequences and is generally not the best way to go.

Thus the best way to manage shared resources is through a single shared feature that includes all the shared resources and ensures that they are installed to the proper location.

In your second scenario the two features' components should not have the same component code even though they contain the same file.