如果文件名称包含“update”,Windows强制文件的UAC标高? [英] Windows force UAC elevation for files if their names contain "update"?

查看:146
本文介绍了如果文件名称包含“update”,Windows强制文件的UAC标高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Windows 7和Microsoft Visual Studio 2010。



我创建了一个简单的项目 MessageBox()调用 WinMain()。该项目的名称是update,因此EXE文件的名称是 update.exe 。我已关闭链接器设置中的清单生成。但是当我尝试在Visual Studio中开始调试时,它说我的应用程序需要提升。



我决定通过在Windows资源管理器中点击启动应用程序,需要管理员权限。我将其重命名为 update12345.exe 12345update12345.exe ,但仍需要提升。



但是当我将它重命名为 12345.exe 时,它无需请求管理员权限即可正常工作。我认为Windows需要高程的所有文件名称包含更新子字符串。所以,我拿了另一个文件( debugview.exe 从SysInternals DebugView)并重命名为 update.exe - 但

解决方案



这个奇怪行为的原因是什么? div>

如果您的应用程序在其清单中不包含requestedExecutionLevel,安装程序检测技术将检查其名称是否包含update,install等,以检测是否是安装程序。
这是因为,当您的应用程式需要UAC时,将其重新命名为「更新」,而其他应用程式则不需要清单。


I am using Windows 7 and Microsoft Visual Studio 2010.

I created simple project with one MessageBox() call in WinMain(). The name of the project is "update", so name of EXE file is update.exe. I have turned off manifest generation in Linker settings. But when I try to start debugging in Visual Studio, it says that my application requires elevation.

I decided to start application by clicking on it in Windows Explorer, but it still requires administrator privileges. I renamed it to update12345.exe and to 12345update12345.exe, but it still requires elevation.

But when I renamed it to 12345.exe, it worked perfectly without requesting administrator privileges! I thought that Windows requires elevation for all files which name contains "update" substring. So, I took another file (debugview.exe from the SysInternals DebugView) and renamed it to update.exe - but it works without elevation.

What can be the reason for this strange behaviour?

解决方案

If your app not contains a requestedExecutionLevel into its manifest, Installer Detection Technology, checks if its name includes "update", "install", etc, to detect if is an installer app. This explains because your app requires UAC when is renamed to "update", and other app than has a manifest not.

这篇关于如果文件名称包含“update”,Windows强制文件的UAC标高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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