将 eclipse 附加到 运行 install4j 安装程序

Attach eclipse to a running install4j installer

我刚开始使用 Install4j,我有一些自定义代码需要单步执行和调试。有没有办法将 eclipse 附加到 运行 安装程序并让它在我的代码中中断?

查看文档中的 Testing and debugging 部分:

您可以通过

在您的 IDE 中设置安装程序或卸载程序
  • 将工作目录设置为调试目录
  • 在 class 路径中包含您自己的代码
  • 在 class 路径中包含 i4jruntime.jar
  • 在 class 路径中包含 user.jar。您自己的代码也将包含在 user.jar 中,但 IDE 通常将项目代码放在 class 路径的开头,因此它将覆盖 class 中的等效代码32=].
  • 使用主 class com.install4j.runtime.installer.Installer 用于安装程序或 com.install4j.runtime.installer.Uninstaller 用于卸载程序
  • 传递 VM 参数 -Dinstall4j.debug=true

注意:执行的java进程的工作目录必须是调试目录,否则安装程序和卸载程序都将无法运行。