开发者

How to add a checkbox in final step to lauch a exe in VS2010 setup project?

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 change开发者_StackOverflow中文版s?


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

REMOVE = "ALL"


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜