简体   繁体   English

Windows以非管理员帐户启动我的应用程序时要求输入管理员密码

[英]Windows asks for administrator password when starting my application in a non-administrator account

There is something my application is doing that is causing Windows to ask for an administrator password when starting my application in a non-administrator account. 我的应用程序正在执行的某些操作导致Windows以非管理员帐户启动我的应用程序时要求管理员密码。 At first I thought it was because I was writing some data in the run time folder in Program Files. 起初我以为是因为我要在Program Files的运行时文件夹中写入一些数据。 I took care of that but still have the problem. 我已经解决了,但是仍然有问题。 Do you have any idea how I can track down the problem ? 您知道我如何找到问题的答案吗?

Harry Johnston's comment is correct. 哈里·约翰斯顿的评论是正确的。

If you don't have a manifest that specifies the level, then Windows assumes this is an "old" program written before manifests were common. 如果没有指定级别的清单,则Windows会假定这是在清单常见之前编写的“旧”程序。 In that case, it'll use heuristics to guess whether the program might require administrator privileges. 在这种情况下,它将使用试探法来猜测程序是否可能需要管理员特权。 In particular, if the name of the executable has "install" or "setup" in it, Windows might assume that it's an installer and that it will require administrator privileges. 特别是,如果可执行文件的名称中包含“ install”或“ setup”,则Windows可能会认为它是安装程序,并且需要管理员权限。

If you provide a manifest that specifies a level (like asInvoker), then Windows won't guess, regardless of the name of your program. 如果您提供指定级别的清单(如Invoker),则无论程序名如何,Windows都不会猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM