From 8e8f724d90c6835febb8b5865009746aea73a334 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 22 Feb 2022 20:23:43 -0600 Subject: Add UnsafeUninstall action. Fixes #6721 --- src/test/burn/WixTestTools/BundleInstaller.cs | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/test/burn/WixTestTools/BundleInstaller.cs') diff --git a/src/test/burn/WixTestTools/BundleInstaller.cs b/src/test/burn/WixTestTools/BundleInstaller.cs index a49c4024..2b449ebf 100644 --- a/src/test/burn/WixTestTools/BundleInstaller.cs +++ b/src/test/burn/WixTestTools/BundleInstaller.cs @@ -3,6 +3,7 @@ namespace WixTestTools { using System; + using System.Collections.Generic; using System.IO; using System.Text; @@ -130,6 +131,35 @@ namespace WixTestTools return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Uninstall, arguments, bundlePath: bundlePath); } + /// + /// Uninstalls the bundle unsafely with optional arguments. + /// + /// Expected exit code, defaults to success. + /// Optional arguments to pass to the tool. + /// Path to the generated log file. + public string UnsafeUninstall(int expectedExitCode = (int)MSIExec.MSIExecReturnCode.SUCCESS, params string[] arguments) + { + var newArgumentList = new List(); + newArgumentList.Add("-unsafeuninstall"); + newArgumentList.AddRange(arguments); + return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Custom, newArgumentList.ToArray()); + } + + /// + /// Uninstalls the bundle unsafely at the given path with optional arguments. + /// + /// This should be the bundle in the package cache. + /// Expected exit code, defaults to success. + /// Optional arguments to pass to the tool. + /// Path to the generated log file. + public string UnsafeUninstall(string bundlePath, int expectedExitCode = (int)MSIExec.MSIExecReturnCode.SUCCESS, params string[] arguments) + { + var newArgumentList = new List(); + newArgumentList.Add("-unsafeuninstall"); + newArgumentList.AddRange(arguments); + return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Custom, newArgumentList.ToArray(), bundlePath: bundlePath); + } + /// /// Executes the bundle with optional arguments. /// -- cgit v1.2.3-55-g6feb