質問

When logged in as a user with administrative privileges, do apps automatically have the right to write to their own Program Files directory?

I'm persisting some data to the app directory and it's obviously not an issue in development because the app directory isn't under Program Files, but I just want to make sure I'm not going to run into any problems when I distribute the app. And the app will only be run by users with admin privileges.

役に立ちましたか?

解決

Most anti-virus programs will throw a fit if they see any updates under the program files directory.

You'd be better off writing your data to a folder under the AppData folder

他のヒント

No. Even a user who has administrative permissions by default runs in an non-elevated context. The user explicitly has to elevate in order to get permissions to write to that location.

You probably don't want to force the user to elevate just to save some data on behalf of that user. You probably also don't want to allow other users on the same machine to modify that data globally, nor do you want to disclose that data to other users.

AppData is the right spot for this sort of thing and has been for more than 10 years.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top