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

后端 未结 7 646
深忆病人
深忆病人 2020-11-27 13:41

fellow anthropoids and lily pads and paddlewheels!

I\'m developing a Windows desktop app in C#/.NET/WPF, using VS 2008. The app is required to install and run on Vis

7条回答
  •  粉色の甜心
    2020-11-27 14:21

    i like below concept, some stuff taken from above

    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." Babies full of rabies, who comes up with this shit?

    6. Change the folder's Property property to "COMMONAPPDATAFOLDER".

    string userAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
    string commonAppData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); 
    

提交回复
热议问题