Windows force UAC elevation for files if their names contain “update”?

ぐ巨炮叔叔 提交于 2019-12-13 01:53:54

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/31140051/windows-force-uac-elevation-for-files-if-their-names-contain-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!