Reputation: 3419
I'm writing a couple of installation packages for a client/server application. I'm using the Wix Toolkit and as recommended each DLL is wrapped up as its own component with a unique id.
There are some common DLL's which need to be installed in both packages. Should these DLL's have the same component GUID or should they be different in each package?
Upvotes: 3
Views: 1554
Reputation: 66703
Installed components are identified by their GUID and keypath.
If both packages install the component to the same location, then it is important that both packages use the same GUID so that the component is reference counted correctly.
If both packages install the component to different locations, then they will be managed separately in any case because the keypath differs. It doesn't matter whether the GUID is the same or not in this case.
Conclusion: you should keep the GUID the same.
As an aside, wix encourages you to share component definitions by compiling them into a wixlib and then using that wixlib in the construction of different installer packages. It's analogous to the way you would create a DLL and then use that DLL in different applications.
Your question of GUIDs doesn't even come up if you use a wixlib, because there is no point where you would be able to change them for different packages.
Upvotes: 1
Reputation: 239636
Given your reply to my comment, it would make things especially bad if both the client and server were installed on the same machine.
From Windows Installer Components:
Two components that share the same component ID are treated as multiple instances of the same component regardless of their actual content. Only a single instance of any component is installed on a user's computer.
(Emphasis added).
Plus:
- Each component must be stored in a single folder.
The following bullet point may sound like it contradicts these:
- No file, registry entry, shortcut, or other resources should ever be shipped as a member of more than one component.
But that's actually saying things the other way around - if you have two installers that install the same DLL to the same location, they must be part of the same component. It's the location of the file (as well as its name, and the bits inside it, version, etc) that's important.
Re: first line of my answer, and given what you're planning to do - if the server was installed (DLLs in server directory), and then the client was installed, the DLLs would not be present in the GAC, and so the client app wouldn't work.
Upvotes: 5