Install4j 将变量用于";中的端口;“等待http端口”;行动

Install4j 将变量用于";中的端口;“等待http端口”;行动,install4j,Install4j,是否可以在“等待http端口”操作中为端口使用变量 从install4j 5.1.x开始,这是不可能的。不过,您可以通过一个代码片段来更改它。在脚本中添加“运行脚本”操作 import com.install4j.runtime.beans.actions.control.*; int port = (Integer)context.getVariable("myPort"); ((WaitForHttpPortAction)context.getActionById("123")).setP

是否可以在“等待http端口”操作中为端口使用变量

从install4j 5.1.x开始,这是不可能的。不过,您可以通过一个代码片段来更改它。在脚本中添加“运行脚本”操作

import com.install4j.runtime.beans.actions.control.*;

int port = (Integer)context.getVariable("myPort");
((WaitForHttpPortAction)context.getActionById("123")).setPort(port);

return true;
这假设您已将整数端口值保存到安装程序变量“myPort”中。您必须将“123”替换为“等待http端口”操作的实际ID