Set VM Option if it isn't empty

16 Views Asked by At

In my install4j installer I set VM option from installer variable:

${installer:proxyHostVM}

Can I do it only if variable available and isn't empty ?

1

There are 1 best solutions below

0
Ingo Kegel On BEST ANSWER

You have to set the "Condition expression" property of the "Add VM options" action that you use to set this VM parameter:

String value = (String)context.getVariable("proxyHostVM");
return value != null && !((String)value).isEmpty()