Error Rolling Back Setup (Installer Class(deployment))
-
hi guys! need some help. i m deploying a .net application using the .net setup project and also using the installer class to add some custom actions every thing is running fine.. but i want to rollback the setup if a condition does not matches.. for which i m using the base.rollback(isavedstate) method but it gives an exception that "savedstate might be corrupted" and then rollback the setup from the catch block.. i m searching for it from a long time but couldnt figured it out. can any one tell me what i m missing.. i wrote the code some what like this: protected override void OnBeforeInstall(IDictionary savedState) { base.OnBeforeInstall (savedState); try { if(DialogResult.No==(MessageBox.Show("This Setup Will restart your Internet Infromation Service Mannager(IIS). Do you want to Continue ? ","Alert",MessageBoxButtons.YesNo,MessageBoxIcon.Hand))) { base.Rollback(savedState); return; } } catch(InstallException iex) {this.Rollback(savedState); } catch(Exception ex) {this.Rollback(savedState); } } but it gets rollback in the catch block gining the error. abhinav
abhinav