Custom uninstall Action c#
===

I have some condition, which I have to check at the time of uninstall, if conditions match then I want to stop the installation process and want to roll back the uninstall process.

Currently I am using the custom actions for the uninstalling using installer class. In which I check for condition whether match or not? if match then I have done rollback and no then the uninstallation will continue.

I have used following code in uninstall script action.

    public override void Uninstall(IDictionary savedState)
    		{
    			if (Condition)
    			{
    				Rollback(savedState);
    			}
    			else
    			{
    				base.Uninstall(savedState);
    			}
    			
    		}
But this code is not able to rollback the uninstall process. Let me know what is wrong with this code. if any new idea then let me know.