【问题标题】:Bulding windows installer using jpackage on continous delivery agent在持续交付代理上使用 jpackage 构建 Windows 安装程序
【发布时间】:2021-03-17 12:01:04
【问题描述】:

我在 CD 代理上运行 jpackage 任务时遇到问题。 我收到以下错误:

light.exe : error LGHT0217 : Error executing ICE action 'ICE01'. The most common cause of this kind of ICE failure is an incorrectly registered scripting engine. See http://wixtoolset.org/documentation/error217/ for details and how to solve this problem. The following string format was not expected by the external UI message logger: "The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.".

我做了一些研究,基本上这个问题可以通过以下方式解决:

  1. 为代理用户添加管理员权限
  2. env 变量的大小非常精确(对于某些人来说,大小大于 32KB 的 env 变量会导致类似的错误)
  3. 抑制 ICE 验证

在我的情况下,每个解决方案都无关紧要或有问题。

  1. 我无法在 CD 上使用管理员用户
  2. env 变量小于 32KB (10KB)
  3. 我找不到使用 jpackage 抑制 ICE 验证的方法 - 我知道可以通过将 -sval 传递给 light.exe 或在 wixproj 文件中指定属性来完成,但我不知道如何输入 light.exe 参数到 jpackage(如果可能的话)和 wixproj 文件在 --resource-dir 中传递似乎没有做任何改变。

明确地说,它在我的本地环境中运行良好。

所以很可能我的问题可以归结为是否可以从 jpackage 级别抑制 ICE 验证。

我正在为 gradle 使用 badass-runtime-plugin 并尝试为 javafx + spring boot 应用程序构建安装程序。这是我的build.gradel 相关部分:

runtime {
    modules = ['java.management', 'java.naming', 'java.instrument', 'java.sql', 'jdk.unsupported', 'jdk.security.jgss', 'java.desktop', 'java.logging', 'jdk.jfr', 'java.xml', 'java.scripting', 'jdk.crypto.cryptoki']
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        noConsole = false
    }
    jpackage {
        mainClass = 'org.springframework.boot.loader.JarLauncher'
        imageOptions += ['--icon', "src/main/resources/graphics/icon.ico"]
        imageOptions += ['--win-console']
        installerOptions += ['--resource-dir', "src/main/resources"]
        installerOptions += ['--vendor', 'XYZ']
        installerOptions += ['--type', 'msi']
        installerOptions += ['--verbose']
        installerOptions += ['--resource-dir', "src/main/resources/wix"]
        installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
    }
}

【问题讨论】:

    标签: java windows gradle wix jpackage


    【解决方案1】:

    根据badass-runtime-plugin's author,jpackage 很可能无法做到这一点。

    但是我设法想出了一些肮脏的技巧,以某种方式让我实现了我的目标。 我为 jpackage 添加了 tempDir 参数,然后在 gradle build 失败后,我“手动”在带有 -sval 开关的 tempDir 文件上运行 light.exe。

    【讨论】:

      猜你喜欢
      • 2021-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-31
      • 1970-01-01
      • 1970-01-01
      • 2016-02-22
      • 1970-01-01
      相关资源
      最近更新 更多