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();