Open yjfvictor opened 10 years ago
The solution is to write a manifest file listed below for the executables, in order to persuade UAC that it does not require administrative privilege.
<?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 filenames of the manifest files 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 prompt still pops up, change the timestamp of install.exe
and patch.exe
to persuade Windows to pick up the new manifest file.
created the manifest but an error appears afterwards:
The requested operation requires elevation
Just placing the manifest is not enough, as explained here: http://math.nist.gov/oommf/software-patchsets/patch_on_Windows7.html
Creating a manifest file is enough. The mt.exe
command is not required. You can release two files. The mt.exe
is just for someone who really wants to release only one single file.
What you need to do for prevent The requested operation requires elevation
is to let the last modified time of the executable later than the manifest file. You can type touch patch.exe
to update the last modified time of the executable.
Embedding the manifest file in the executable file via mt.exe
is an alternative way, which can reduce the problem of the last modified time.
When you type
install
orpatch
command, the UAC dialog pops up to request for the administrator privilege, because Windows 7 thinks that any executable file including "install", "patch", "update" within its filename is a installer and therefore the administrator privilege is required. Please fix this bug.