tags:

views:

263

answers:

2

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?

+1  A: 

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)

Shay Erlichmen
Really what I want to do here is download data at runtime (not install time) that gets put in c:\users\public (since that is a writable location for all), and is read by all users. Then I want to delete this data on Uninstall, but I'm not sure how to refer to the folder properly. Perhaps I need to use [%PUBLIC] in some way...
jeffamaphone
Then you can set a registry key (After you download the data) that will tell the installer where the data is located and in uninstall time you can read the value and remove the files from that path.
Shay Erlichmen
FYI: The app only installs on Vista+ so we don't have to worry about XP for this particular app.
jeffamaphone
+3  A: 

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.

Rob Mensching
+1 WIX_DIR_COMMON_DOCUMENTS points to "c:\users\public\public documents" on vista.
Wim Coenen
I'll have a look at that. Thanks.
jeffamaphone