From 8ebde131206f1502cbff2055941ffe52e2802439 Mon Sep 17 00:00:00 2001 From: Charles Baker Date: Thu, 24 Oct 2024 13:13:26 +1300 Subject: Add bal:DisplayFilesInUseDialogCondition to disable Files In Use dialog Disabling display skips showing the "Files In Use" dialog and returning a result as if the user had chosen to ignore the dialog and reboot in the case of files that were unable to be replaced. --- .../BalExtensionFixture.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs') diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index 07d3dacb..576e7c6c 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs @@ -55,6 +55,44 @@ namespace WixToolsetTest.BootstrapperApplications } } + [TestMethod] + public void CanBuildUsingDisplayFilesInUseDialogCondition() + { + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); + var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa"); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var baFolderPath = Path.Combine(baseFolder, "ba"); + var extractFolderPath = Path.Combine(baseFolder, "extract"); + + var compileResult = WixRunner.Execute(new[] + { + "build", + Path.Combine(bundleSourceFolder, "DisplayFilesInUseDialogConditionBundle.wxs"), + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), + "-intermediateFolder", intermediateFolder, + "-bindpath", Path.Combine(bundleSourceFolder, "data"), + "-o", bundleFile, + }); + compileResult.AssertSuccess(); + + Assert.IsTrue(File.Exists(bundleFile)); + + var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); + extractResult.AssertSuccess(); + + var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); + WixAssert.CompareLineByLine(new string[] + { + "", + }, balPackageInfos); + + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); + } + } + [TestMethod] public void CanBuildUsingBootstrapperApplicationId() { @@ -298,6 +336,7 @@ namespace WixToolsetTest.BootstrapperApplications { "bal:Condition/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", "Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.", + "The *Package/@bal:DisplayFilesInUseDialogCondition attribute's value '=' is not a valid bundle condition.", "The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.", "The location of the Variable related to the previous error.", }, messages.ToArray()); -- cgit v1.2.3-55-g6feb