InstallShield-2009:基本MSI:如何在用户取消卸载后运行自定义操作(回滚)

时间:2010-05-07 08:44:09

标签: installshield installshield-2009 custom-action

InstallShield-2009 Premier:基本msi项目:

当我想在卸载期间用户点击取消按钮时运行自定义操作时该怎么办?

我使用

进行自定义操作(一个只显示消息框的C#exe)

行动类型:

Type: Launch an executable

Location: Stored in the Binary table

操作参数:

Source: exe path

Target: a b c (doesn't matter, I don't need it)

其他选项:

Return Processing: Synchronous (Check exit code)

Run Only During Path Uninstall: unchecked

回复选项:

In-Script Execution: Rollback Execution in System Context

Executing Scheduling: disabled

插入序列:

Install UI-Sequence: <Absent from sequence>

Install Execute Sequence: After InstallServices (what should I set here?)

Install Execute Condition: (do I need to set? I left it blank)

但是当我取消卸载时它没有触发消息框。怎么样?

2 个答案:

答案 0 :(得分:1)

您可能想尝试将事件绑定到对话框的“取消”按钮。在安装设计器中,转到用户界面&gt;对话框,找到SetupProgress并在行为中向Cancel PushButton添加一个事件。我没试过,但值得一试。

答案 1 :(得分:0)

应在回滚操作之前安排回滚自定义操作。由于您要处理任何回滚,因此可以在InstallExecuteSequence中的InstallInitialize之后安排操作。

这样,当用户在实际开始安装后取消安装时,它将始终运行。

请注意,在进程实际启动之前取消安装时,无法使用回滚自定义操作(显示进度条)。为此,您需要在该特定的取消按钮上进行控制事件。