Skip to content

Commit 4192528

Browse files
Test bal:DisplayFilesInUseDialog
1 parent 8a1a0eb commit 4192528

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+
[TestMethod]
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.IsTrue(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.IsTrue(File.Exists(Path.Combine(baFolderPath, "thm.wxl")));
89+
}
90+
}
91+
5492
[TestMethod]
5593
public void CanBuildUsingBootstrapperApplicationId()
5694
{
@@ -294,6 +332,7 @@ public void CannotBuildUsingOverridableWrongCase()
294332
{
295333
"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.",
296334
"Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.",
335+
"The *Package/@bal:DisplayFilesInUseDialogCondition attribute's value '=' is not a valid bundle condition.",
297336
"The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.",
298337
"The location of the Variable related to the previous error.",
299338
}, messages.ToArray());

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

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

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

187188
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)