tcallahan
Posts: 5
Joined: Sat Aug 01, 2020 12:58 am

Required Install Parameters/Properties

Is there a way to enforce a check that a Parameter/Property was defined on the commandline at install time, and if the parameter/property is not found, to immediately exit? This would be for a silent mode install.

ie. install.exe MYPROP=test (and if you ran without MYPROP=test the installer would exit with error? the value test will change and can be anything)
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Required Install Parameters/Properties

Hello,

In order to achieve that, you can proceed as it follows:

- go to "Custom Actions" page

- add the "Display error message" custom action

- if you want this custom action to be executed only during an install, configure it as it follows:

error.png
error.png (108.44 KiB) Viewed 1371 times

Basically, if the MY_PROP property does not exist (it is not given a value through the command line), the custom action will fail the installation.

Please note, however, that the message will not be displayed, since the installation is done silently.

Additionally, please note that this might not work if the property is defined in the "Install Parameters" page (because the property exists and therefore the condition of the custom action will be false, resulting in the custom action not executing).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”