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

时间:2022-04-23 22:41:11

InstallShield-2009 Premier: Basic msi project:

InstallShield-2009 Premier:基本msi项目:

What to do when I want a custom action to run when user clicks cancel button during uninstall?

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

I put a custom action (a C# exe which would just show a message box) with

我把一个自定义动作(一个C#exe,它只显示一个消息框)

Action Type:

行动类型:

Type: Launch an executable

Location: Stored in the Binary table

Action Parameters:

动作参数:

Source: exe path

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

Additional Options:

其他选项:

Return Processing: Synchronous (Check exit code)

Run Only During Path Uninstall: unchecked

Respond Options:

回应选项:

In-Script Execution: Rollback Execution in System Context

Executing Scheduling: disabled

Insert into Sequence:

插入序列:

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)

but it didn't fire the message box when I canceled the uninstall. How?

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

2 个解决方案

#1


1  

You may want to try to tie an event to the Cancel button of the dialog. In the Installation Designer, goto User Interface>Dialog, find SetupProgress and in behavior add an event to the Cancel PushButton. I haven't tried it, but it's worth a shot.

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

#2


0  

Rollback custom actions should be scheduled before the action they are rolling back. Since you want to handle any rollback, you can schedule the action after InstallInitialize in InstallExecuteSequence.

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

This way it will always run when the user cancels the installation after it actually started installing.

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

Please note that rollback custom actions cannot be used when cancelling an install before the process actually starts (the progress bar is shown). For this you would need a control event on that specific Cancel button.

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

#1


1  

You may want to try to tie an event to the Cancel button of the dialog. In the Installation Designer, goto User Interface>Dialog, find SetupProgress and in behavior add an event to the Cancel PushButton. I haven't tried it, but it's worth a shot.

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

#2


0  

Rollback custom actions should be scheduled before the action they are rolling back. Since you want to handle any rollback, you can schedule the action after InstallInitialize in InstallExecuteSequence.

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

This way it will always run when the user cancels the installation after it actually started installing.

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

Please note that rollback custom actions cannot be used when cancelling an install before the process actually starts (the progress bar is shown). For this you would need a control event on that specific Cancel button.

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