Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Common Application Data Path in windows installer

As I searched there is a folder in windows partition named "ProgramData" that contains applications' data which is used by applications in run time. Since this folder does not need admin permission and it is common between system users it is the best place to put the runtime files. In C#.Net I reach this folder address by this code:

Application.CommonAppDataPath

The problem is that I can not find the right folder to put my data in it while I'm creating windows installer(msi file) by Visual Studio Setup Project. I want to know how can I add this folder to my setup project.

Regards.

like image 631
Reza Ameri Avatar asked Sep 27 '12 09:09

Reza Ameri


1 Answers

Here is how you can add it:

  1. Go to "File System" view in your project and right click on "File System on Target Machine"
  2. Under "Add Special Folder" select "Custom folder" and give it a name
  3. Now right click on that folder and select "Properties Window"
  4. Set the "DefaultLocation" attribute to this: "[CommonAppDataFolder]"
  5. Now you can add any sub-folders you want under this new folder and place in there the files desired and your files should install in the desired path.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa367992(v=vs.85).aspx

like image 172
Bogdan Mitrache Avatar answered Oct 15 '22 03:10

Bogdan Mitrache