Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiled program icon has Windows Shield on it

Status
Not open for further replies.

Blobtech

Programmer
Dec 19, 2002
28
0
0
GB
Hi,

I've had some issues recently with programs I compile where the program icon has the Windows shield overlaying it meaning the program needs to run with elevated permissions. In the programs 3it's happening on there is nothing radically different to other programs I've written.

Does anyone know why this is happening?

Thanks,

Lee.
 
I suspect that your program is compiled as legacy code, i.e. it lacks a manifest that marks it "Vista aware." This is indicated in the manifest through the presence of a valid <trustInfo/> section.

If your program doesn't have this then Windows considers it legacy code and does a number of appcompat analyses on it when first run. In this case it has probably rolled the dice and decided your program is some legacy scripted setup that should run elevated. The heuristics look at the name of the file and several of the extended properties for keywords. If your program "smells like" a legacy setup then a rule for it gets added to the appcompat database marking it as "elevation required."

One way around this is to change the name of the file and the contents of the extended properties. Another is to apply a proper manifest, preferably one compiled in or wedged in after the fact as a resource.

That skips quite a few appcompat checks, making the program start quicker as well as eliminating elevation when not required. When it is required <trustInfo/> can request that too.
 
>If your program "smells like" a legacy setup ...
Which often means the exe has a name like or including strings like 'setup', 'update', 'upgrade', 'install' etc. e.g. SETUP.EXE
What exe file names are you using?
 
Hi,

I can't believe it was something as simple as the name of the exe. The half dozen or so programs I've had this problem with have all got 'update' in the program name.

After changing the program names and re-compiling, they're all fine now.

Thanks for your help.
 
Don't you think this help deserves a star? Or two...

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top