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.
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?
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:
Installation Phases and In-Script Execution Options for Custom Actions in 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.
And of course, never reinvent the wheel where it already exists. (XMLFileChanges) It rarely goes well.