msi安装程序postbuildevent cscript" $(ProjectDir)EnableLaunchApplication.js" " $(BuiltOuputPath)"

时间:2012-10-09 08:59:14

标签: installer windows-installer

我有MSI安装程序项目 postbuildevent == cscript" $(ProjectDir)EnableLaunchApplication.js" " $(BuiltOuputPath)"

1我几个小时都在苦苦挣扎的问题 - 如何防止在卸载时运行此脚本 - 即仅在安装时运行?

2 个答案:

答案 0 :(得分:2)

发布后事件不会在安装或卸载时运行。他们运行post build

答案 1 :(得分:1)

基于this thread,我修改/添加了这些行:

sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton', 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1 AND NOT REMOVE', '0')";

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