VS2008 Setup Project: Shared (By All Users) Application Data Files?

I have learned the answer to my question through other sources, yes, yes! Sadly, it didn’t fix my problem! What’s that make me — a fixer-upper? Yes, yes!

To put stuff in a sub-directory of the Common Application Data folder from a VS2008 Setup project, here’s what you do:

  1. Right-click your setup project in the Solution Explorer and pick “View -> File System”.

  2. Right-click “File system on target machine” and pick “Add Special Folder -> Custom Folder”.

  3. Rename the custom folder to “Common Application Data Folder.” (This isn’t the name that will be used for the resulting folder, it’s just to help you keep it straight.)

  4. Change the folder’s DefaultLocation property to “[CommonAppDataFolder][Manufacturer]\[ProductName]”. Note the similarity with the DefaultLocation property of the Application Folder, including the odd use of a single backslash.

  5. Marvel for a moment at the ridiculous (yet undeniable) fact that there is a folder property named “Property.”

  6. Change the folder’s Property property to “COMMONAPPDATAFOLDER”.

Data files placed in the “Common Application Data” folder will be copied to “\ProgramData\Manufacturer\ProductName” (on Vista) or “\Documents and Settings\All Users\Application Data\Manufacturer\ProductName” (on XP) when the installer is run.

Now it turns out that under Vista, non-Administrators don’t get modify/write access to the files in here. So all users get to read the files, but they get that in “\Program Files” as well. So what, I wonder, is the point of the Common Application Data folder?

Leave a Comment