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 ++++++++++++++++++++++ .../InternalUIBAFixture.cs | 3 +- .../TestData/Overridable/WrongCaseBundle.wxs | 2 +- .../TestData/WixIuiBa/IuibaWarnings.wxs | 2 +- .../DisplayFilesInUseDialogConditionBundle.wxs | 12 +++++++ 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs (limited to 'src/ext/Bal/test/WixToolsetTest.BootstrapperApplications') 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()); diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs index 72e31540..7b4d00fc 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs @@ -168,6 +168,7 @@ namespace WixToolsetTest.BootstrapperApplications "WixInternalUIBootstrapperApplication does not support the value of 'force' for Cache on prereq packages. Prereq packages are only cached when they need to be installed.", "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown.", "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown.", + "WixInternalUIBootstrapperApplication ignores DisplayFilesInUseDialogCondition for the primary package so that the MSI UI is always shown.", "When using WixInternalUIBootstrapperApplication, all prereq packages should be before the primary package in the chain. The prereq packages are always installed before the primary package.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); @@ -181,7 +182,7 @@ namespace WixToolsetTest.BootstrapperApplications var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); WixAssert.CompareLineByLine(new string[] { - "", + "", }, balPackageInfos); var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs index 67dfc589..33b2d64c 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs @@ -9,7 +9,7 @@ - + diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs index 2cf9787d..9c9aa0f8 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs @@ -6,7 +6,7 @@ - + diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs new file mode 100644 index 00000000..1041eb39 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + -- cgit v1.2.3-55-g6feb