How to add a checkbox in final step to lauch a exe

2019-01-29 07:04发布

问题:

Currently, I'm following the steps described here to add a checkbox in the final step, but it seems that the checkbox still exits when I do the uninstallation. Does anybody know why or how to do a changes?

回答1:

You can try using control conditions to hide the checkbox during uninstall. For example, you can hide it when:

REMOVE = "ALL"


回答2:

You have add condition for your checkbox, look at ControlCondition Table. The script from your link adds CheckBox control to Finish dialog, and you have to add the following row to ControlCondition table:

Dialog_ = FinishedForm
Control_ = CheckboxLaunch
Action = Hide
Condition = NOT Installed

To do it add the following code to the script:

WScript.Echo("Updating the ControlCondition table...");
sql = "INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`)" VALUES ('FinishedForm', 'CheckboxLaunch', 'Hide', 'NOT Installed')";
view = database.OpenView(sql);
view.Execute();
view.Close();

Substitute FinishedForm and CheckboxLaunch with the values you use.



回答3:

Alexey's answer works except the condition should be 'Installed', not 'NOT Installed'. Also, there is a superfluous double quote in the sql INSERT statement. So the working answer should be:

    WScript.Echo("Updating the ControlCondition table...");
sql = "INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('FinishedForm', 'CheckboxLaunch', 'Hide', 'Installed')";
view = database.OpenView(sql);
view.Execute();
view.Close();