[CMake] WIX installer fails for shared files

Mark Stijnman mark.stijnman at gmail.com
Mon Nov 9 14:29:22 EST 2015


Hi Nils,

thanks for the reply.

On Mon, Nov 9, 2015 at 4:09 PM, Nils Gladitz <nilsgladitz at gmail.com> wrote:

> CMake does not implement any diagnostics that would prevent you from doing
> so but installing distinct files (or even the same file multiple times) to
> the same destination path is ill defined irregardless of it being in the
> same or distinct components.
>

Not in WiX, though - installing the same file from more than one feature is
common practice. The shared component will just get a higher reference
count. Installing different files to the same location, on the other hand,
*is* an error in WiX, which is what I'm running into (even though they're
really the same file). It also works as expected in the archive generators
- as long as both files are the same, that is, otherwise it is indeed
ill-defined.

I think there should be a change in the CMake/CPack behavior here,
regardless of whether the WiX generator will be extended to support this
use case. For generators that support the same file to be installed from
more than one component, such as the archive generators, it should check if
the files are the same, and if not, report an error. Generators that don't
support two files with the same destination at all should give an error
when that occurs.

A partial workaround is to put shared files in a separate, hidden CPack
>> component/WIX feature, and set component dependencies. However, with many
>> shared DLLs, maintaining this gets complex really fast, so I'd rather not
>> have to do this.
>>
>
> I think from CPack's point of view this is the proper thing to do.


It's probably the most portable solution to do this at the CPack level,
indeed. However, I found that the CPack WiX generator doesn't support
cross-feature dependencies, so I can't automatically install the required
files based on the user's feature selections. This is understandable, as
WiX itself doesn't appear to have support for this. From what information I
could find, the common approach in WiX is indeed to reference the common
components (or component groups) from each feature that need them. I'll
have to think about the best way to do this.

best regards Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151109/11e012da/attachment.html>


More information about the CMake mailing list