cancel
Showing results for 
Search instead for 
Did you mean: 
sysadmin-blr
Flexera beginner

OnBeforeUninstall event not firing in Basic msi project

Hi Team, i am creating a setup project in Basic msi. I am having a class which inherits from Installer to get some data from user while install/uninstall. But the following event is not firing before uninstall. Is there any settings i need to update. protected override void OnBeforeUninstall(IDictionary savedState) Thanks, Ramesh P.
0 Kudos
4 Replies

Re: OnBeforeUninstall event not firing in Basic msi project

Hi,

I guess you are talking about Service Installer Project for .NET application where System.Configuration.Install is the inherited class and you are trying to call "protected virtual void OnBeforeUninstall (System.Collections.IDictionary savedState);".


If so, may I know how are you calling the event from Basic MSI ? If not wrong Managed Custom Action ?

Thanks

0 Kudos
sysadmin-blr
Flexera beginner

Re: OnBeforeUninstall event not firing in Basic msi project

we have just set the property ".NET Installer Class " to "Yes" under .NET Settings.
0 Kudos
Flexera Jenifer
Flexera

Re: OnBeforeUninstall event not firing in Basic msi project

Hi @sysadmin-blr,

 

From the issue description i could get that you are adding .Net assembly which is derived from System.Configuration.Install.Installer and setting property to "Yes".

As mentioned here:

https://docs.microsoft.com/en-us/dotnet/api/system.configuration.install.installer.onbeforeuninstall...

Notes to Inheritors

When overriding OnBeforeUninstall(IDictionary) in a derived class, be sure to call the base class's OnBeforeUninstall(IDictionary)method so that registered delegates receive the event.

Is that added in the .Net assembly you had added here?

 

Thanks,

Jenifer

0 Kudos

Re: OnBeforeUninstall event not firing in Basic msi project

Hi @sysadmin-blr,

I have tried the same and it seems to work as expected.

As suggested by @Jenifer did you try calling the base class when overriding the OnBeforeUninstall(IDictionary savedState) function.

protected override void OnBeforeUninstall(IDictionary savedState)
        {
            base.OnBeforeUninstall(savedState);

            // Your code goes here //

        }

Thanks,

0 Kudos