Reputation: 165
I have a windows batch cmd *.cmd file that runs sql, as part of my installer. This script returns a proper non-zero return code when the sql fails. I can't get my install4j installer to recognize the return code.
I tried two things:
When I checked the installation log I'm seeing the SQL errors from stderr redirected to the log, but no matter if it succeeds or fails I see this:
[INFO] com.install4j.runtime.beans.actions.misc.RunExecutableAction [ID 72]: Variable changed: sqlReturnCode=0[class java.lang.Integer]
It's always setting that variable to zero. I DO NOT have the "Show Console Window" option checked. Is this a known bug? How can I fix/work around it?
Upvotes: 0
Views: 1435
Reputation: 165
This ended up being a problem with the cmd script being executed. The ERRORLEVEL enivonrmental variable was being set but "exit /b %ERRORLEVEL%" was not being called.
Install4j relies on the proper error level being set with the exit command.
Upvotes: 1