diff --git a/src/VS.ConfigurationManager/Bundle.cs b/src/VS.ConfigurationManager/Bundle.cs index e9e48dc..48be243 100644 --- a/src/VS.ConfigurationManager/Bundle.cs +++ b/src/VS.ConfigurationManager/Bundle.cs @@ -179,13 +179,7 @@ public int Uninstall() Logger.Log("Bundle uninstall called and bundle is installed.", Logger.MessageLevel.Information, AppName); foreach (string file in Directory.GetFiles(LocalInstallLocation, "*.exe")) { - var bundlelogfilename = LogLocation + "_" + System.IO.Path.ChangeExtension(System.IO.Path.GetFileNameWithoutExtension(file), "log"); - Logger.Log(String.Format(CultureInfo.InvariantCulture, "Installer: {0}", file), Logger.MessageLevel.Information, AppName); - var args = String.Format(CultureInfo.InvariantCulture, BundleUninstallArguments, bundlelogfilename); - Logger.Log(String.Format(CultureInfo.InvariantCulture, "Arguments: {0}", args), Logger.MessageLevel.Information, AppName); - - Logger.LogWithOutput(string.Format("Uninstalling: {0}", file)); - exitcode = Utility.ExecuteProcess(file, args); + exitcode = ExecuteUninstallProcess(file); if (exitcode == 0) Logger.Log("Uninstall succeeded"); else @@ -205,5 +199,16 @@ public int Uninstall() return exitcode; } + + private int ExecuteUninstallProcess(string file) + { + var bundlelogfilename = LogLocation + "_" + System.IO.Path.ChangeExtension(System.IO.Path.GetFileNameWithoutExtension(file), "log"); + Logger.Log(String.Format(CultureInfo.InvariantCulture, "Installer: {0}", file), Logger.MessageLevel.Information, AppName); + var args = String.Format(CultureInfo.InvariantCulture, BundleUninstallArguments, bundlelogfilename); + Logger.Log(String.Format(CultureInfo.InvariantCulture, "Arguments: {0}", args), Logger.MessageLevel.Information, AppName); + + Logger.LogWithOutput(string.Format("Uninstalling: {0}", file)); + return Utility.ExecuteProcess(file, args); + } } }