Win7 AllUsers应用程序数据文件夹上的访问权限

Win7 AllUsers应用程序数据文件夹上的访问权限

问题描述:

我的Windows桌面应用程序在Windows用户之间共享设置,因此我将设置文件保留在AllUsers应用程序数据下(可能会放到任何地方).在WinXP上一切正常,但是在Vista/7上,我发现只有Windows管理员可以在此区域更改文件.我尚未提供清单,因此每个用户都认为自己可以更改设置,但是虚拟化可确保每个用户实际上都有其OWN设置文件.这打破了Common(allUsers)AppData的想法.

我总是可以以高权限访问我的应用-糟糕的主意!由于许多原因.

我可以在安装时在AppData文件夹上设置ACL-好的,直到发生细微的错误时有人清理或丢失我的文件夹.

我很想将设置放回到我的Program Files安装文件夹中,并在那里设置文件的ACL-这样行得通吗?我可以在安装文件夹中设置一个用户可写的文件夹吗?

My Windows desktop app shares settings between Windows users, so I keep a settings file under AllUsers Application Data (wherever that might end up). All works fine on WinXP but on Vista/7 I find that only Windows Administrators can change files this area. I don''t yet provide a manifest so each user thinks he can change settings but virtualization ensures that each user actually has his OWN settings file. This breaks the idea of Common (allUsers) AppData.

I could always run my app at Elevated access - BAD idea! for many reasons.

I can set the ACL on my AppData folder at installation time - ok until someone cleans up or loses my folder when subtle bugs happen.

I''m tempted to put the settings back into my Program Files installation folder and set the file''s ACL there - would this work? Could I set up a user-writable folder within my installation folder?

Where is my shared application data expected to live?

我不建议在安装时使用ACL:如果您的应用安装在商业环境中,例如,更改可能会失败.

还要小心地将它们放入安装文件夹中.如果您的程序最终出现在程序文件"中,则可能会遇到相同的问题.

您正在使用什么制作程序?如果您使用的是.Net Framework,则可以尝试使用内置的设置"功能,该功能可以具有应用程序范围"设置和用户"设置.
I wouldn''t suggest playing with ACL at installation time: if you app is installed in a business environment, for example, the changes may fail.

Be careful about putting things in your installation folder as well. If your program ends up in Program Files, you could end up with the same problem.

What are you using to make the program? If you''re using the .Net Framework, you could try using the built in Settings features which can have Application scope settings as well as User ones.