Prevent uninstall in setup project with OnBeforeUninstall
I overrode OnBeforeUninstall to stop my application's setup project from uninstalling it under certain circumstances, but it seems like it is just not being called and has no effect. protected override void OnBeforeUninstall(IDictionary savedState) { if (ApplicationIsBusy()) throw new ApplicationException("Prevent uninstall while application busy."); } I am able to cancel uninstall by overriding the Uninstall method, but by then the setup project has already closed my application. How do I "fail" an uninstall attempt when my application is busy before the setup project tries to close it when