Skip to content

Commit 0b96838

Browse files
Test bal:DisplayFilesInUseDialog
1 parent 3b79ba2 commit 0b96838

File tree

5 files changed

+55
-3
lines changed

5 files changed

+55
-3
lines changed

src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,44 @@ public void CanBuildUsingDisplayInternalUICondition()
5151
}
5252
}
5353

54+
[Fact]
55+
public void CanBuildUsingDisplayFilesInUseDialogCondition()
56+
{
57+
using (var fs = new DisposableFileSystem())
58+
{
59+
var baseFolder = fs.GetFolder();
60+
var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
61+
var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa");
62+
var intermediateFolder = Path.Combine(baseFolder, "obj");
63+
var baFolderPath = Path.Combine(baseFolder, "ba");
64+
var extractFolderPath = Path.Combine(baseFolder, "extract");
65+
66+
var compileResult = WixRunner.Execute(new[]
67+
{
68+
"build",
69+
Path.Combine(bundleSourceFolder, "DisplayFilesInUseDialogConditionBundle.wxs"),
70+
"-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"),
71+
"-intermediateFolder", intermediateFolder,
72+
"-bindpath", Path.Combine(bundleSourceFolder, "data"),
73+
"-o", bundleFile,
74+
});
75+
compileResult.AssertSuccess();
76+
77+
Assert.True(File.Exists(bundleFile));
78+
79+
var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
80+
extractResult.AssertSuccess();
81+
82+
var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo");
83+
WixAssert.CompareLineByLine(new string[]
84+
{
85+
"<WixBalPackageInfo PackageId='test.msi' DisplayFilesInUseDialogCondition='1' />",
86+
}, balPackageInfos);
87+
88+
Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl")));
89+
}
90+
}
91+
5492
[Fact]
5593
public void CanBuildUsingOverridable()
5694
{
@@ -253,6 +291,7 @@ public void CannotBuildUsingOverridableWrongCase()
253291
{
254292
"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.",
255293
"Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.",
294+
"The *Package/@bal:DisplayFilesInUseDialogCondition attribute's value '=' is not a valid bundle condition.",
256295
"The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.",
257296
"The location of the Variable related to the previous error.",
258297
}, messages.ToArray());

src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public void CanBuildUsingWixIuiBaWithWarnings()
167167
"WixInternalUIBootstrapperApplication does not support the value of 'force' for Cache on prereq packages. Prereq packages are only cached when they need to be installed.",
168168
"WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown.",
169169
"WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown.",
170+
"WixInternalUIBootstrapperApplication ignores DisplayFilesInUseDialogCondition for the primary package so that the MSI UI is always shown.",
170171
"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.",
171172
}, compileResult.Messages.Select(m => m.ToString()).ToArray());
172173

@@ -180,7 +181,7 @@ public void CanBuildUsingWixIuiBaWithWarnings()
180181
var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo");
181182
WixAssert.CompareLineByLine(new string[]
182183
{
183-
"<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' PrimaryPackageType='default' />",
184+
"<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' DisplayFilesInUseDialogCondition='DISPLAYTEST' PrimaryPackageType='default' />",
184185
}, balPackageInfos);
185186

186187
var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation");

src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Variable Name="TEST1" bal:Overridable="yes" />
1010
<Chain>
1111
<ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" />
12-
<MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" />
12+
<MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" bal:DisplayFilesInUseDialogCondition="!(loc.NonsensePlanCondition)" />
1313
</Chain>
1414
<bal:Condition Condition="!(loc.NonsenseDetectCondition)" Message="Unsupported" />
1515
</Bundle>

src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<bal:WixInternalUIBootstrapperApplication />
77
</BootstrapperApplication>
88
<Chain>
9-
<MsiPackage SourceFile="test.msi" InstallCondition="INSTALLTEST" bal:DisplayInternalUICondition="DISPLAYTEST" />
9+
<MsiPackage SourceFile="test.msi" InstallCondition="INSTALLTEST" bal:DisplayInternalUICondition="DISPLAYTEST" bal:DisplayFilesInUseDialogCondition="DISPLAYTEST" />
1010
<ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" Cache="force" />
1111
</Chain>
1212
</Bundle>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3+
xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4+
<Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5+
<BootstrapperApplication>
6+
<bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" />
7+
</BootstrapperApplication>
8+
<Chain>
9+
<MsiPackage SourceFile="test.msi" bal:DisplayFilesInUseDialogCondition="1" />
10+
</Chain>
11+
</Bundle>
12+
</Wix>

0 commit comments

Comments
 (0)