自定义操作在卸载期间不起作用

时间:2022-12-10 22:43:05

I am developing installer using Installshield 2011 and project type is Basic MSI, I have custom action which is sequenced in such a way that is should be executed during uninstallation. here is the attached snap shot of custom action properties that I have configured.

我正在使用Installshield 2011开发安装程序,项目类型是Basic MSI,我有自定义操作,按照应该在卸载过程中执行的方式排序。这是我已配置的自定义操作属性的附加快照。

自定义操作在卸载期间不起作用

The problem I am facing is the configured custom action is not getting executed during uninstallation and eventually installed application will not be removed.

我面临的问题是卸载过程中未执行配置的自定义操作,最终安装的应用程序将不会被删除。

Following is the entry from verbose logging:

以下是详细日志记录的条目:

00532: (Unknown): InstallShield 11:01:17: Registering Msi Server...

00533: (Unknown): InstallShield 11:01:17: **Invoking script function MyFunction**

00534: (Unknown): InstallShield 11:01:17: **CallScriptFunctionFromMsiCA() ends**

00535: (Unknown): CustomAction NewCustomAction1 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

00536: (Unknown): Action ended 11:01:17: **NewCustomAction1. Return value 3.**

00537: (Unknown): Action ended 11:01:17: **INSTALL. Return value 3.**

00538: (Property): Property(S): DiskPrompt = [1]

00539: (Property): Property(S): UpgradeCode = {40AD9645-1459-4C32-8285-D1C0B163361D}

00540: (Property): Property(S): ProductCode = {84BDE810-2C23-48CA-A638-5B131DA3B57F}

Am I missing anything here?

我在这里遗漏了什么?

1 个解决方案

#1


2  

My first question would be why are you writing a custom action at all? InstallShield's built-in custom actions ( XML File Changes ) already has the ability to remove an element on uninstall. My second observation would be that InstallScript is solid as a language, it's lack of understanding on how to properly design custom actions that tends to cause problems. I'd read:

我的第一个问题是你为什么要写一个自定义动作? InstallShield的内置自定义操作(XML文件更改)已经能够在卸载时删除元素。我的第二个观察是,InstallScript作为一种语言是可靠的,它缺乏对如何正确设计往往会导致问题的自定义操作的理解。我害怕:

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

Windows Installer中自定义操作的安装阶段和脚本执行选项

Be sure to schedule all custom actions that modify the system as Deferred in System Context between InstallInitialize and InstallFinalize. Also be sure to use the CustomActionData pattern and to have corresponding rollback actions incase the uninstall is cancelled or fails. Otherwise you might get in a situation where your application is installed but the tag is missing.

确保在InstallInitialize和InstallFinalize之间安排将系统修改为系统上下文中的所有自定义操作。还要确保使用CustomActionData模式并在卸载取消或失败时进行相应的回滚操作。否则,您可能会遇到安装了应用程序但缺少标记的情况。

And of course, never reinvent the wheel where it already exists. (XMLFileChanges) It rarely goes well.

当然,永远不要重新发明已存在的车轮。 (XMLFileChanges)很少进展顺利。

#1


2  

My first question would be why are you writing a custom action at all? InstallShield's built-in custom actions ( XML File Changes ) already has the ability to remove an element on uninstall. My second observation would be that InstallScript is solid as a language, it's lack of understanding on how to properly design custom actions that tends to cause problems. I'd read:

我的第一个问题是你为什么要写一个自定义动作? InstallShield的内置自定义操作(XML文件更改)已经能够在卸载时删除元素。我的第二个观察是,InstallScript作为一种语言是可靠的,它缺乏对如何正确设计往往会导致问题的自定义操作的理解。我害怕:

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

Windows Installer中自定义操作的安装阶段和脚本执行选项

Be sure to schedule all custom actions that modify the system as Deferred in System Context between InstallInitialize and InstallFinalize. Also be sure to use the CustomActionData pattern and to have corresponding rollback actions incase the uninstall is cancelled or fails. Otherwise you might get in a situation where your application is installed but the tag is missing.

确保在InstallInitialize和InstallFinalize之间安排将系统修改为系统上下文中的所有自定义操作。还要确保使用CustomActionData模式并在卸载取消或失败时进行相应的回滚操作。否则,您可能会遇到安装了应用程序但缺少标记的情况。

And of course, never reinvent the wheel where it already exists. (XMLFileChanges) It rarely goes well.

当然,永远不要重新发明已存在的车轮。 (XMLFileChanges)很少进展顺利。