Question

Is it possible to use a variable for the port in the "Wait for http port" Action?

Was it helpful?

Solution

As of install4j 5.1.x, this is not possible. You change it with a code snippet, though. Add a "Run script" action with the script

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

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

return true;

This assumes that you have saved an integer port value to the installer variable "myPort". You have to replace "123" with the actual ID of the "Wait for http port" action.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top