VS Setup project - Pass Checkbox properties as arguments to MSI during silient installations

Checkboxes are used in Install UI to select what files need to be installed. This works fine when installing in full UI. During silent installation via the command line, the property cannot be set as arguments to msiexec.

 

The property values are initialized to 1 in the property table. The Setup project builds the MSI with CustomActions in the InstallExecuteSequence that reset these property values to Null. Its only in the UI when the CheckBox dialog is created the actual property values are set. Therefore no matter what values we pass from the command line to the properties they are always getting reset to Null and never being set to the desired values.

 

 

The condition I had to use was CHECKBOXA1<>””

had to remove some entries from the InstallExecuteSequence and the Property tables. This I have done using a post build event as below.

 

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `InstallExecuteSequence` WHERE `InstallExecuteSequence`.`Action`='CustomCheckA_SetProperty_CHECKBOX1'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `InstallExecuteSequence` WHERE `InstallExecuteSequence`.`Action`='CustomCheckA_SetProperty_CHECKBOX2'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `InstallExecuteSequence` WHERE `InstallExecuteSequence`.`Action`='CustomCheckA_SetProperty_CHECKBOX3'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `InstallExecuteSequence` WHERE `InstallExecuteSequence`.`Action`='CustomCheckA_SetProperty_CHECKBOX4'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `Property` WHERE `Property`.`Property`='CHECKBOXA1'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `Property` WHERE `Property`.`Property`='CHECKBOXA2'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `Property` WHERE `Property`.`Property`='CHECKBOXA3'"

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "DELETE FROM `Property` WHERE `Property`.`Property`='CHECKBOXA4'"

 

Contributor : Ravi Shankar