Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Installer.AfterUninstall Event

Occurs after all the installers in the Installers property perform their uninstallation operations.

[Visual Basic]
Public Event AfterUninstall As InstallEventHandler
[C#]
public event InstallEventHandler AfterUninstall;
[C++]
public: __event InstallEventHandler* AfterUninstall;

[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.

Event Data

The event handler receives an argument of type InstallEventArgs containing data related to this event. The following InstallEventArgs property provides information specific to this event.

Property Description
SavedState Gets an IDictionary that represents the current state of the installation.

Example

[Visual Basic, C#, C++] The following example demonstrates the AfterUninstall event. It is raised by the OnAfterUninstall method.

[Visual Basic] 
' MyInstaller is derived from the class 'Installer'.
Sub New()
   MyBase.New()
   AddHandler AfterUninstall, AddressOf AfterUninstallEventHandler
End Sub 'New

Private Sub AfterUninstallEventHandler(sender As Object, e As InstallEventArgs)
   ' Add steps to perform any actions before the Uninstall process.
   Console.WriteLine("Code for AfterUninstallEventHandler")
End Sub 'AfterUninstallEventHandler

[C#] 
// MyInstaller is derived from the class 'Installer'.
MyInstaller() : base()
{
   AfterUninstall += new InstallEventHandler(AfterUninstallEventHandler);
}
private void AfterUninstallEventHandler(object sender, InstallEventArgs e)
{
   // Add steps to perform any actions before the Uninstall process.
   Console.WriteLine("Code for AfterUninstallEventHandler"); 
}

[C++] 
// MyInstaller is derived from the class 'Installer'.
MyInstaller() {
    AfterUninstall += new InstallEventHandler(this, &MyInstaller::AfterUninstallEventHandler);
}

void AfterUninstallEventHandler(Object* sender, InstallEventArgs* e) {
    // Add steps to perform any actions before the Uninstall process.
    Console::WriteLine(S"Code for AfterUninstallEventHandler");
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Installer Class | Installer Members | System.Configuration.Install Namespace | BeforeUninstall | OnAfterUninstall | OnBeforeUninstall

Show:
© 2014 Microsoft. All rights reserved.