1

UAC の目的で .NET アプリケーション マニフェストが必要かどうかを判断するための規則やガイドラインはありますか?

レジストリ (HKLM > ソフトウェア > yadda yadda) に書き込み、ファイル I/O を実行するアプリケーションがあります。これにマニフェストが必要かどうかはわかりません。ファイル I/O は、ネットワーク共有 (ただし、アプリ自体がユーザーに資格情報の入力を求めます) またはローカルに対するものである可能性があります。

よくわからない場合は、最大レベルに設定しないでください。

4

1 に答える 1

1

You should include a manifest. If you don't want to always request elevation you don't have to, you can ask for asInvoker or highestAvailable. If your app doesn't run without elevation you may simply have no choice, apart from changing the app of course.

I found a couple of sites very handy when trying to learn this stuff.

This site has a great explanation of how UAC works and how you can expect it to affect your applications:

What Every Software Engineer Must Know About Windows Vista http://codefromthe70s.org/vistatutorial.aspx

I also found this blog post about manifests useful:

Answers to Several Application Manifest Mysteries and Questions http://blogs.msdn.com/b/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx

As for your specific case, the best thing is just to try it. If you're able to write to the registry keys you need and to the disk without elevation then you can leave it set to asInvoker.

As long as you're not trying to save anything to a restricted area (like the System directory) the I/O should not pose a problem. I'm afraid I can't remember the rules on writing to HKLM\Software. If it works without elevation, great.

But I would still include a manifest as a matter of best practices.

于 2012-06-18T18:26:01.173 に答える