Pat
Pat

Reputation: 1776

CPack WIX install a file outside the install tree

I'm using the CPack WIX generator to create an installer. The installer needs to install a file in a %ALLUSERSPROFILE%\foo\ folder on the target system.

I can't find a way to install files outside of the install tree (C:\Program Files\foo...)

How can this be accomplished?

Upvotes: 6

Views: 1083

Answers (2)

woernsn
woernsn

Reputation: 11

This is not possible at the moment. CMake does not allow to patch Directories at the moment. See https://gitlab.kitware.com/cmake/cmake/issues/14890.

Upvotes: 0

Stein Åsmul
Stein Åsmul

Reputation: 42206

I am not familiar with CPack, but the MSI System Folder Property for this is usually CommonAppDataFolder. So essentially you would use this as the target folder for the component hosting the files and resources you want installed in %ALLUSERSPROFILE%.


Folder Redirection: Without digressing too much, you should probably be aware that some of these system folder properties redirect based on whether the package is installed per-machine or per-user - relating to the value of ALLUSERS during installation. See link for more information ("Installation Context" and "Single Package Authoring" are illuminating). The folder you mention should be stable and not redirect.

Personal opinion: This folder redirection and per-user install feature are among my least favorite parts of MSI. My take is to install per-machine, whenever possible. Importantly (and the reason for this small rant): A package capable of installing per-user, should not target CommonAppDataFolder at all (since it does not redirect to a per-user target).

Upvotes: 3

Related Questions