问题描述
我在 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.".
我做了一些研究,基本上问题可以通过以下方式解决:
- 我无法在 CD 上使用管理员用户
- 环境变量小于 32KB (10KB)
- 我找不到使用 jpackage 抑制 ICE 验证的方法 - 我知道可以通过将 -sval 传递给 light.exe 或 wixproj 文件中的 specyfing 属性来完成,但我不知道如何输入 light.exe 参数到 jpackage(如果可能)和传入 --resource-dir 的 wixproj 文件似乎没有做任何更改。
明确地说,它在我的本地环境中运行良好。
所以很可能我的问题可以归结为是否可以从 jpackage 级别抑制 ICE 验证的问题。
我将 badass-runtime-plugin 用于 gradle 并尝试为 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']
}
}
解决方法
根据 badass-runtime-plugin's author 的说法,使用 jpackage 很可能无法做到这一点。
然而,我设法想出了一些肮脏的技巧,以某种方式让我实现了我的目标。 我为 jpackage 添加了 tempDir 参数,然后在 gradle 构建失败后,我“手动”使用 -sval 开关对来自 tempDir 的文件运行 light.exe。