Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CPack WIX install a file outside the install tree

Tags:

cmake

wix

cpack

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?

like image 407
Pat Avatar asked May 16 '18 05:05

Pat


1 Answers

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).

like image 78
Stein Åsmul Avatar answered Nov 06 '22 01:11

Stein Åsmul