为什么 Windows 要求系统管理员权限以“安装"运行可执行文件?以他们的名义? [英] Why is Windows asking for system administrator privileges for running executables with "install" in their name?

查看:28
本文介绍了为什么 Windows 要求系统管理员权限以“安装"运行可执行文件?以他们的名义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个工具,它允许将应用程序安装到我们的模拟器中,它被称为cl-install.exe".它确实不需要任何管理员权限即可运行.但是当从命令提示符调用此命令时,Windows 7 总是会弹出一个对话框,要求用户提供管理员权限.

I am building a tool which allows to install an application into our simulator and it is called 'cl-install.exe'. It really doesn't need any administrator privileges to run. But Windows 7 always pops up a dialog asking the user to provide administrator privileges when this command is invoked from the command prompt.

如果我将同一个可执行文件重命名为其他名称,其中没有安装"或设置"字样,Windows 不会要求管理员权限.

If I rename the same executable to some other name, without the words 'install' or 'setup' in it, Windows doesn't ask for admin privileges.

有什么方法可以阻止 Windows 执行此操作,而无需重命名我的可执行文件?

Is there any way I can prevent Windows from doing this, without renaming my executable?

推荐答案

这是 Windows Vista 及更高版本中存在的启发式方法的一部分.来自 此处 如果文件包含安装"、设置"、更新"或补丁"等字样 - 假定安装程序.

This is part of the heuristics present in Windows Vista and later. From here if the file contains the words "install", "setup", "update" or "patch" - installer is assumed.

您可以通过在清单中添加以下内容来防止这种情况

You can prevent this by adding the following to your manifest

<requestedExecutionLevel level="asInvoker" />

这篇关于为什么 Windows 要求系统管理员权限以“安装"运行可执行文件?以他们的名义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆