【问题标题】:launch4j executable with specific name triggers Windows UAC具有特定名称的 launch4j 可执行文件触发 Windows UAC
【发布时间】: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


【解决方案1】:

此行为受组策略控制。

如果User Account Control: Detect application installations and prompt for elevation 设置为禁用,那么这些文件名将不再是特殊的。

当然,如果您要命名文件以供在不受您控制的计算机上使用,您仍应远离可识别的名称。

【讨论】:

    【解决方案2】:

    是的,文件名中有保留字会触发 UAC。

    @eee 将此作为评论发布:

    MSDN:

    图标叠加:在 Windows Vista 中,如果可执行文件需要 要启动的海拔高度,那么可执行文件的图标应该被“标记” 带有盾牌图标来表明这一事实。 ...盾牌图标覆盖 也将被自动放置在被认为是 根据安装程序检测启发式需要提升。为了 例如,名为 setup.exe 的文件将自动收到一个屏蔽 即使可执行文件没有嵌入的图标覆盖 应用程序清单。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-27
      • 2012-04-12
      • 2013-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      相关资源
      最近更新 更多