【发布时间】:2012-02-29 17:58:34
【问题描述】:
我正在用 Eclipse 中的 launch4j ANT 任务创建我的 java 程序的 Windows 可执行 EXE 文件,并将其命名为“MyApp.exe”。我需要这个程序在没有管理员身份验证的情况下在 Windows 系统上运行。 到目前为止,这行得通。它运行良好,无需任何 UAC 提示。
但是:如果我在我的 launch4j ANT 任务中将此 EXE 重命名为“install.exe”、“setup.exe”或“updater.exe”,则会出现 UAC 图标(右下角覆盖程序图标)并且我得到启动程序时 UAC 提示(仅在 Windows Vista 或 7 上)。 如果我在 Windows 资源管理器中重命名程序,也会发生这种情况。
似乎文件名中有一些“保留字”会导致 Windows 以提升的访问权限 (UAC) 启动程序。
有人可以确认这个问题吗?我真的不能将我的应用程序命名为“install.exe”或“update.exe”吗?
【问题讨论】:
-
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.msdn.microsoft.com/en-us/library/bb530410.aspx
标签: windows-7 ant windows-vista uac launch4j