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

假装没事ソ 提交于 2019-12-30 08:33:18

问题


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!


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9531119/special-folder-common-application-data-folder-not-available-in-my-setup-projec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!