Search code examples
windows-7antwindows-vistauaclaunch4j

launch4j executable with specific name triggers Windows UAC


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"?


Solution

  • 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