Dependencies in MS Installer / Wix

I am currently studying the vagaries of WiX and the Windows installer, and I hit a stumbling block.

The project that I am currently packaging consists of six discrete pieces. Now let's call them A, B, C, D, E, and F.

Chunk A is a collection of shared libraries and utilities that are used by every other project. It does not provide any end-user features.

Chunk B is another set of shared libraries and utilities that require features provided by Chunk A. This seems strange, but the architecture goes beyond my ability to influence or control.

Chunk C is the third set of shared libraries and utilities that require features provided by pieces A and B. This seems even weirder than before, but I still have no way to change that.

Chunks D, E, and F all require the functionality provided by pieces A, B, and C.

If possible, I would like to make sure that there is only one installation of pieces A, B, and C, which are shared between settings D, E, and F. I gained confidence that pieces A, B, and C maintain stable APIs so that they could be updated without impairing the functionality of D, E or F.

I immediately thought of creating merge modules for components in A, B, and C, and then linking to them in the functions provided by individual installers for D, E, and F. This would inflate the installers, but it would ensure that the necessary components were installed . Unfortunately, I am afraid that during the upgrade it may cause problems with Windows Installer validation.

Another thought is that I had to make one installer for A, B and C and require it in the installers for D, E and F via ComponentSearch.

Does any idea make sense? If no idea makes sense, do you have any recommendations regarding the correct way to implement it?

+6
windows-installer wix
source share
2 answers

Enable A + B + C with all installers and install in regular files. Windows Installer will handle reference counting so that only one copy will remain on the disk and will remain until the last product is removed. The upgrade will be great, the Windows Installer is designed for this kind of thing :)

However, instead of merging modules, I suggest using Wixlibs

+3
source share

They gave me confidence that chunks A, B, and C would keep the API stable so that they could be updated without breaking the functionality of D, E, enter code here or F.

A robust API may not be enough. What if an application accidentally relies on behavior that is an undocumented match (for example, the order of items in a returned list) or, worse, on behavior that is actually an error? Updating shared components can then break your application because it has not been tested against updated components.

My immediate thought is to create merge modules ... I am afraid that this will cause problems inside Windows. Checking the installer during the upgrade.

You may be right that there are problems with the ability to service with merge modules. Microsoft is no longer distributing new merge modules. It is also difficult to create updatable components and still follow the Windows Installer Component Rules .

I prefer to actually install the "general" components in each bin folder of the application separately. I am creating wixlibs for these components so that they can be shared between application installers. Inside the wixlib files, I put the component in <DirectoryRef Id="SharedComponentFolder> . This reference link is undefined, which is not a problem for lit.exe . In application installers, I then an alias of the application bin folder as follows:

 <Directory Id="AppBinFolder" Name="bin"> <Directory Id="SharedComponent1Folder" /> <!-- alias for AppBinFolder --> <Directory Id="SharedComponent2Folder" /> <!-- another alias --> </Directory> 

As a result, applications have their dependencies in their own bin folder and remain isolated from each other. Of course, there is a tradeoff:

  • you get stability because your application always works against the exact version of the dependencies for which it is tested; no Problems with DLL Hell .
  • You have more work when updating a shared component. Each application installer should be updated and redistributed, and not just one installer for a common component.
  • you lose disk space (because shared components are installed several times).

With .NET assemblies, the story can become even more complex with the GAC , strong names , redirection of policy files , etc. But this post is already too long :-)

+1
source share

All Articles