Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special Folder "Common Application Data Folder" not available in my setup project. Why?

I want to create a Visual Studio 2010 setup project that deploys some files to a folder where my application can use it from. I want it so, that all users have the same files, and that they also could manipulate them without admin rights.

Thus, "Common Application Data Folder"* as described in this MSDN article, seems fine.

However, in my Visual Studio 2010 setup project I did not find the "Common Application Data Folder" available in the "Add special Folder..." drop down menu.

I have a .NET 4.0 WinForms app and see no reason why this does not show up. The user's common application data folder is available but does not match my intended use.

Thanks for any hints!

like image 934
Marcel Avatar asked Mar 02 '12 09:03

Marcel


People also ask

How do I add a folder to Visual Studio setup project?

Add a new Setup Project in your solution > right-click Application Folder > Add > Project Output… > 2). Add a new Setup Project in your solution > right-click Application Folder > Add > Project Output… >

What is common Appdata folder?

Full path to the Application Data folder common to all users. Note: During Current User installations this variable is mapped to the Current User Application Data folder.


2 Answers

Visual Studio setup projects do not have a predefined folder for common Application Data. However, you can install files in it like this:

  • add a custom folder and select it
  • in its Properties pane set DefaultLocation to:

[CommonAppDataFolder]
  • in this folder add the files you want installed in common Application Data

During install CommonAppDataFolder will be automatically resolved by Windows Installer.

like image 139
rmrrm Avatar answered Sep 27 '22 21:09

rmrrm


A more specific solution might be to set the DefaultLocation property to:

[CommonAppDataFolder][Manufacturer]\[ProductName]

Manufacturer and ProductName will be resolved from the values you assign to the corresponding properties of the setup project.

like image 38
Derek Johnson Avatar answered Sep 27 '22 20:09

Derek Johnson