0
votes

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.

Snapshot of attached custom action for uninstallation

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
What is your custom action trying to accomplish? Is it trying to interact with files that have (already) been removed in the uninstall process? As a side note: I avoid InstallScript like the plague.NGaida
Greetings NGaida, the current custom action contains only pop message apart from this i am not doing any thing. Basically i wanted to test it before i could do my actual implementation which is to remove a XML tag from app.config file during uninstallation.Chetan
InstallScript is solid since InstallShield 12. Still, I don't invest in it anymore. I tend to do everything in C#/DTF and occasionally C++. But I don't "avoid" InstallScript per say.Christopher Painter
@ChristopherPainter I need to uninstall 2 application during the installation of my msi file.I coded to uninstall application programatically and called that function in installer.cs.But that is not uninstalling the application,i have raised a question in SO please look into this and guide me stackoverflow.com/questions/26863294/…user2725407

1 Answers

2
votes

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.