Child process exit abnormally when calling external scripts

Comments

3 comments

  • Avatar
    BitRock support

    Hi Jake,

    You can tell the installer how to treat error running external programs using the properties <abortOnError>, <showMessageOnError> or the <onErrorActionList>. You can find more details and examples at this section of our docs:

    https://clients.bitrock.com/installbuilder/docs/installbuilder-userguide.html#_handling_action_errors

    Could you check if that works for you?

    Regards,

    Alejandro

    0
    Comment actions Permalink
  • Avatar
    Jake

    Hi,

    I already set the abortOnError and ShowMessageOnError to '0' like below. Is there an option to "suppress" a certain error code?

    0
    Comment actions Permalink
  • Avatar
    BitRock support

    Hi Jake,

    `<runProgram>` defines a set of variables after executing:

    https://clients.bitrock.com/installbuilder/docs/installbuilder-userguide.html#_running_external_programs

     

    You could silence errors as you are currently doing, and then check `${program_exit_code}` and decide what to do. For example, if "2" exit code is acceptable, you could use the below code to throw any other invalid code:

    ```

       <runProgram>
          <program>/bin/sh</program>
          <programArguments>"${installdir}/testscript.sh"</programArguments>
          <abortOnError>0</abortOnError>
          <showMessageOnError>0</showMessageOnError>
       </runProgram>
    <throwError text="Execution failed ${program_stderr}">
    <ruleList>
    <compareValues value1="${program_exit_code}" logic="does_not_equal" value2="0"/>
    <compareValues value1="${program_exit_code}" logic="does_not_equal" value2="2"/>
    </ruleList>
    </throwError>

    ```

     

    0
    Comment actions Permalink

Please sign in to leave a comment.