Pregunta

I'm creating a windows executable EXE file of my java program with an ANT task of launch4j in Eclipse and named it "MyApp.exe". I need this program to run without admin authentication on windows systems. So far, this works. It just runs fine without any UAC prompt.

BUT: If I rename this EXE to "install.exe", "setup.exe" or "updater.exe" in my launch4j ANT task, the UAC icon appears (bottom right overlaying the program icon) and I get the UAC promp when starting the program (only on Windows Vista or 7). This also happens if I rename the program in Windows Explorer.

same program, renamed via windows explorer

Seems as if there are some "reserved words" in filenames that cause windows to start a program with elevated access rights (UAC).

Can someone confirm this issue? Can I really not name my application "install.exe" or "update.exe"?

¿Fue útil?

Solución

YES, there are reserved words in filenames which trigger the UAC.

@eee postet this as a comment:

MSDN:

Icon Overlays: In Windows Vista, if an executable file requires elevation to launch, then the executable's icon should be "stamped" with a shield icon to indicate this fact. ...The shield icon overlay will also be automatically placed on executables that are deemed to require elevation as per the installer detection heuristics. For example, a file named setup.exe will automatically receive a shield icon overlay even if the executable does not have an embedded application manifest.

http://msdn.microsoft.com/en-us/library/bb530410.aspx

Otros consejos

This behavior is controlled by Group Policy.

If User Account Control: Detect application installations and prompt for elevation is set to Disabled, then these filenames will cease to be special.

Of course if you're naming files for use on computers not under your control, you should still stay away from the recognized names.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top