cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
klosezhang
Level 3

Display dialog panel based on Java Custom Action return value

Hi all,

I am stucking on this problem for 2 days now, please help.

I have installshield 2012 professional version and I am able to invoke my Java application (custom action) from installshield.
My Java application throws Exception if the operation fails. And if so I want the installer display a dialog with the exception message I thrown to the user and return to the installer panel where they are.
However as soon as the custom action throws exception (Which means the application didn't end with code 0) installshield consider the installation process fails.

I've tried many ways such as creating a temp file or registry key but the condition builder for dialog behavior only look into the properties managed by "Property Manager". And when I go to "Property manager" view it seems only accept hard coded value or existing local value. I am seeking for setting the property value from my Java application but I don't know how.

Please help.

Really appreciate.
Labels (1)
0 Kudos
(1) Reply
TsungH
Level 12

It is the behavior of Microsoft Windows Installer. Excerpt from Custom Action Type 2, Custom actions that are executable files must return a value of 0 for success. The installer interprets any other return value as failure.

If your executable custom action writes to temp file/registry to communicate back to the installation, you will need a separate custom action after the executable custom action to read it and set property accordingly, before you can use the property to conditionally display a dialog.

DLL and script custom actions are easier when it comes to setting value of property. You may want to consider changing your custom action type.
0 Kudos