views:

61

answers:

1

I have a exe was complied by VC6 and the file name is patch.exe, there is no manifest was added, in that case, the EXE file requires administrator privileges, even though I removed all codes, just keep a empty main(), the result is same. But if I change the EXE from patch.exe to a.exe, the issue is gone.

Below is my test result. 1. EXE was complied by VC6 2. Without manifest or didn't specific privileges in manifest 3. the exe name included "patch" substring, case-insensitive

Is it a Microsoft issue? Why?

Tried VC2008, I can't repeat it.

+3  A: 

The UAC feature of Vista, etc. does use the filename of the executable to guess whether it's going to need escalated Admin privileges. So "legacy" installation programs such as setup.exe, install.exe, patch.exe (and others too I guess) which won't include a manifest will get appropriate privileges even if users don't do "Run as Administrator..." for it.

As to why the VC2008 version doesn't cause an escalation request? I don't know. Maybe there's a manifest embedded into it somewhere that is explicitly or implicitly saying it doesn't need it.

A question along these lines has already been asked on StackOverflow.

How to prevent Vista from requiring elevation on patch.exe?

Trevor Tippins
Depending on how you made the "VC2008" version you may have been given an asInvoker manifest by default. That's what you want to do. Either change the name, or add a manifest that says "don't guess from the name, I'm telling you I don't need to elevate." It doesn't matter what code is inside your exe.
Kate Gregory