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

2019-01-29 07:01发布

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?

3条回答
三岁会撩人
2楼-- · 2019-01-29 07:21

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楼-- · 2019-01-29 07:24

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

REMOVE = "ALL"
查看更多
该账号已被封号
4楼-- · 2019-01-29 07:43

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();
查看更多
登录 后发表回答