dustin.schultz
dustin.schultz

Reputation: 13646

Install4J failure strategy, retry or quit on failure, remove ignore button

Using Install4J 6, I set the Failure Strategy of a particular Run Script action to be "Ask user whether to retry or quit". This is exactly what I want.

However, when the script runs and a failure occurs, the message box that pops up also contains a button to "Ignore".

enter image description here

Short of implementing my own options dialog using the Util.showOptionDialog(...), how do I remove this ignore button?

Upvotes: 3

Views: 408

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48035

Update on 2021-01-14:

Since install4j 6.1.6, you can define the installer variable

context.setVariable("sys.actionRetryDisableIgnore", true);

to remove the "Ignore button" from the confirmation dialog.


Old alternative answer:

This is currently not possible. I would recommend the following:

Set the "Failure strategy" property of the action to "Continue on failure" and call

context.setVariable("retryAction", Util.showOptionDialog("Your message",
    new String[] {"Retry", "Quit"}, JOptionPane.ERROR_MESSAGE) == 0);

in the case of failure or

context.setVariable("retryAction", false);

otherwise.

Then put the action into an action group. In the configuration of the action group, select the "Loop" property and set the "Loop expression" property to

context.getBooleanVariable("retryAction")

Upvotes: 2

Related Questions