通用可写应用程序文件放在哪里?
时间:2020-03-06 14:51:19 来源:igfitidea点击:
我认为应该使用" CSIDL_COMMON_APPDATA \ company \ product"放置所有应用程序用户通用的文件,并且该应用程序可以修改,但是在Vista上,这是一个只读位置,除非安装程序进行了修改(根据MSDN http://msdn.microsoft.com/zh-cn/library/ms995853.aspx),所以……什么是最好的?是否修改位置的安全设置以允许写入或者使用CSIDL_COMMON_DOCUMENTS \ company \ product
?也许还有第三种选择?
另外,在某处对此是否有"官方"微软建议?
解决方案
我认为这篇文章可能会回答一些问题,但是对于许多人来说,这似乎是一个难题。
显然,CSIDL_COMMON_DOCUMENTS提供了一种常见的解决方法
仅修改AppData目录的特定子目录上的安全性(这来自我们提供的链接):
CSIDL_COMMON_APPDATA This folder should be used for application data that is not user specific. For example, an application may store a spell check dictionary, a database of clip-art or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer. By default, this location is read-only for normal (non-admin, non-power) Users. If an application requires normal Users to have write access to an application specific subdirectory of CSIDL_COMMON_APPDATA, then the application must explicitly modify the security on that sub-directory during application setup. The modified security must be documented in the Vendor Questionnaire.
可以在此处找到Vista / UAC的准则。在该页面上搜索" CSIDL",我们将找到一些"官方"答案。