How to raise the uninstall event in installer in c#
<p>I want to uninstall if a condition fails during installation process... how to do it?</p>

<pre><code>protected override void OnAfterInstall(IDictionary savedState)
{
    frmDataBaseSetup frmDataBaseSetup = new frmDataBaseSetup();
    frmDataBaseSetup.ShowDialog();
    if (frmDataBaseSetup.IsConnected)
    {
        // here i do something
        base.OnAfterInstall(savedState);
    }
    else
    {
        MessageBox.Show("Can not continue without server information", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        base.Rollback(savedState);
        base.Uninstall(savedState);
    }            
}
</code></pre>

<p>This is not working when condition is false
please help me</p>
