Condition for Install, also known as condition scripts, is the section of Smart Software that allows the software deployment to either proceed with the installation attempt or skip the deployment on the device. If you'd like to see the overview of Smart Software as a whole, check out our KB article on Creating Smart Software.
Addigy offers prebuilt conditions as well as a custom conditional command.
Prebuilt Conditions
These conditions have been created by Addigy and only require the values you'd like to set for your Smart Software item. To configure this, simply check the relevant box(s), fill out the information, and that's it! To note, your directories do not need to be formatted with quotes - Addigy will automatically wrap directories in quotes.
If you'd like to see the actual code that the condition is creating, enable the condition by checking the checkbox, fill in the values required, and then click the Preview command link at the bottom right. Moreover, you can enable as many prebuilt conditions as you'd like alongside having Custom Conditional Commands.
Custom Conditional Commands
The Custom Conditional Commands section allows you to add any commands or scripts that you need that might fall outside of the prebuilt conditions provided by Addigy.
Install if return value is 0 refers to the behavior of installation based on the exit code of the script. To enable or disable this option, a Custom Conditional Command must be present. When a script is done running, it will always return an exit code. If there is no explicit exit code in the script, it will naturally exit with 0.
By default, having this option checked will cause the software to install when the condition script exits with code 0. Disabling this option changes the behavior so that any non-zero exit code causes the software to install. This is particularly useful for some one-line condition scripts where you are relying on the natural exit code of the command used to determine whether to install the software or not. In most cases, Addigy recommends leaving this option enabled.
Exit Code Values
- 0 = Success
- Any non-zero values = Error