From 81146c7622baa614a541804b13251cba4a3776d9 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Wed, 10 Jun 2015 09:52:45 -0500 Subject: [PATCH] (GH-323) Do not run autouninstaller unless success If for any reason the package is in failure mode, we should continue to let it be in failure mode and not mess up the state of the uninstall, since the package uninstall will be considered a failure. --- .../infrastructure.app/services/ChocolateyPackageService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 5c6974d245..6259e1d646 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -493,7 +493,10 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi _powershellService.uninstall(config, packageResult); } - _autoUninstallerService.run(packageResult, config); + if (packageResult.Success) + { + _autoUninstallerService.run(packageResult, config); + } // we don't care about the exit code if (config.Information.PlatformType == PlatformType.Windows) CommandExecutor.execute("shutdown", "/a", config.CommandExecutionTimeoutSeconds, _fileSystem.get_current_directory(), (s, e) => { }, (s, e) => { }, false);