i_am_jorf
i_am_jorf

Reputation: 54600

How to specify c:\users\public (%PUBLIC%) in WiX?

Is there a Property that resolves to the public folder? I don't want to hard code "c:\users\public" in the Directory structure, obviously, but I can't find a predefined Property that resolves to this. Is there an accepted way of specifying files to be installed here and/or removed on uninstall?

Upvotes: 2

Views: 4125

Answers (2)

Rob Mensching
Rob Mensching

Reputation: 35866

If there is a CSIDL for the directory then the OSInfo CustomActions probably have it. That's an extension to the properties supported by Windows Installer. There isn't support for the Vista only RefKnownFolder(), yet.

Upvotes: 5

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

When you target your setup to be for all users then some folders will me mapped to the all users folder (DesktopFolder, StartMenuFolder, ProgramMenuFolder, more info here) but there is no permanent property that will point to the all users folders on all types of setups.

You can use the CommonAppDataFolder which is where you should put data that will be relevant to all users of the application (but it requires admin right to modify).

You can try to write a custom action (Sample here) that will replace the value of [YourFolder] with [%PUBLIC] (The Public environment variable, I don't know if it exits on XP and down)

Upvotes: 3

Related Questions