java - 在持续交付代理上使用 jpackage 构建 Windows 安装程序
问题描述
我在 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.".
我做了一些研究,基本上这个问题可以通过以下方式解决:
- 为代理的用户添加管理员权限
- env 变量大小的veryfing 大小(对于某些人来说,大小大于 32KB 的 env 变量会导致类似的错误)
- 抑制 ICE 验证
在我的情况下,每个解决方案都无关紧要或有问题。
- 我无法在 CD 上使用管理员用户
- env 变量小于 32KB (10KB)
- 我找不到使用 jpackage 抑制 ICE 验证的方法 - 我知道可以通过将 -sval 传递给 light.exe 或在 wixproj 文件中指定属性来完成,但我不知道如何将 light.exe 参数输入到 jpackage (如果可能的话)并且在 --resource-dir 中传递的 wixproj 文件似乎没有做任何更改。
需要明确的是,它在我的本地环境中运行良好。
所以很可能我的问题可以归结为是否可以从 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']
}
}
解决方案
根据badass-runtime-plugin 的作者的说法,使用 jpackage 很可能无法做到这一点。
然而,我设法想出了一些肮脏的技巧,以某种方式让我实现了我的目标。我已经为 jpackage 添加了 tempDir 参数,然后在 gradle build 失败后,我使用 -sval 开关在 tempDir 的文件上“手动”运行 light.exe。
推荐阅读
- ios - 键盘折叠时 inputAccessoryView 不遵守 safeAreaLayoutGuide
- spring - 当我间接调用方法时,为什么@Cacheable 无效?
- python - 使用列表保存数据并将数据附加到列表作为安全网,python
- mysql - SQL获取具有特定时间段的连续开始和结束日期
- azure-web-app-service - 在 asp.net 核心中使用 Rotitiva 部署到天蓝色时显示框而不是字体的 PDF 报告
- qt - 关于 qt5 中的虚拟键盘与 windows 上的小部件应用程序
- mongodb - 如何根据日期范围 mongoDB 选择所有数据?
- xml - 为什么 XML 属性支持“>”(大于符号)而“<”(小于符号)不支持?
- maven - Maven 发布插件 - 如何仅发布快照?
- php - 如何在 PHP 中获取数组的参数