I tried OnBeforeUninstallto stop my application installation project, deleting it under certain circumstances, but it looks like it just isn't invoked and has no effect.
protected override void OnBeforeUninstall(IDictionary savedState)
{
if (ApplicationIsBusy())
throw new ApplicationException("Prevent uninstall while application busy.");
}
I can cancel the deletion by overriding the method Uninstall, but by then the installation project has already closed my application. How to "fail" the uninstall attempt when my application is busy before the installation project tries to close it when it is running and interrupts my workflow?
source
share