Why does Windows ask the system administrator to run executable files with "installation" in its name?

I create a tool that allows you to install the application in our simulator and is called "cl-install.exe". For this, you really do not need administrator rights. But Windows 7 always displays a dialog with a request to grant the user administrator rights when this command is called from the command line.

If I rename the same executable file to a different name, without the words โ€œinstallโ€ or โ€œinstallโ€ in it, Windows does not ask for administrator rights.

Is there a way to prevent Windows from being used without renaming my executable?

+7
source share
3 answers

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

This can be prevented by adding the following to the manifest.

<requestedExecutionLevel level="asInvoker" /> 
+11
source

If I remember correctly, you can disable this behavior as follows (quote from Technet ):

  • Click Start , click All Programs , click Accessories , click Run, type secpol.msc in the Open text box, and then click OK .

  • In the console tree of Local Security Settings, click Local Policies , and then click Security Settings .

  • Scroll down and double-click User Account Management. Detect application installations and upgrade request .

  • Select Disabled , and then click OK .

  • Close the Local Security Settings window.

You may need to re-enter to take effect.

+2
source

I found a working solution here: https://github.com/bmatzelle/gow/issues/156

Quote:

The solution is to write the manifest file listed below for the executables to convince the UAC that it does not require administrative privileges.

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <!-- Make sure that UAC believes that it does not require administrative privilege --> <requestedExecutionLevel level="asInvoker" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> </assembly> 

The manifest file names should be install.exe.manifest and patch.exe.manifest, and then put them in the same folder as install.exe and patch.exe.

If the UAC message still pops up, change the timestamp of the install.exe and patch.exe files to convince Windows to pick up the new manifest file.

+2
source

All Articles