-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly handle top-level AppId element
Fixes 7738
- Loading branch information
Showing
5 changed files
with
97 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/wix/test/WixToolsetTest.CoreIntegration/AppIdFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
|
||
namespace WixToolsetTest.CoreIntegration | ||
{ | ||
using System.IO; | ||
using WixInternal.Core.TestPackage; | ||
using WixInternal.TestSupport; | ||
using Xunit; | ||
|
||
public class AppIdFixture | ||
{ | ||
[Fact] | ||
public void PopulatesAppIdTableAtTopLevel() | ||
{ | ||
var folder = TestData.Get(@"TestData"); | ||
|
||
using (var fs = new DisposableFileSystem()) | ||
{ | ||
var baseFolder = fs.GetFolder(); | ||
var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
var msiPath = Path.Combine(baseFolder, @"bin", "test.msi"); | ||
|
||
var result = WixRunner.Execute(new[] | ||
{ | ||
"build", | ||
Path.Combine(folder, "AppId", "TopLevelAppId.wxs"), | ||
"-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
"-intermediateFolder", intermediateFolder, | ||
"-o", msiPath | ||
}); | ||
|
||
result.AssertSuccess(); | ||
|
||
Assert.True(File.Exists(msiPath)); | ||
var results = Query.QueryDatabase(msiPath, new[] { "AppId" }); | ||
WixAssert.CompareLineByLine(new[] | ||
{ | ||
"AppId:{D6040299-B15C-4C94-AE26-0C9B60D14C35}\t\t\t\t\t\t", | ||
}, results); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void PopulatesAppIdTableWhenAdvertised() | ||
{ | ||
var folder = TestData.Get(@"TestData"); | ||
|
||
using (var fs = new DisposableFileSystem()) | ||
{ | ||
var baseFolder = fs.GetFolder(); | ||
var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
var msiPath = Path.Combine(baseFolder, @"bin", "test.msi"); | ||
|
||
var result = WixRunner.Execute(new[] | ||
{ | ||
"build", | ||
Path.Combine(folder, "AppId", "Advertised.wxs"), | ||
Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
"-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
"-intermediateFolder", intermediateFolder, | ||
"-o", msiPath | ||
}); | ||
|
||
result.AssertSuccess(); | ||
|
||
Assert.True(File.Exists(msiPath)); | ||
var results = Query.QueryDatabase(msiPath, new[] { "AppId" }); | ||
WixAssert.CompareLineByLine(new[] | ||
{ | ||
"AppId:{D6040299-B15C-4C94-AE26-0C9B60D14C35}\t\t\t\t\t\t", | ||
}, results); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/wix/test/WixToolsetTest.CoreIntegration/TestData/AppId/TopLevelAppId.wxs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
<Package Name="~AppId Top-Level" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="12E4699F-E774-4D05-8A01-5BDD41BBA127" Compressed="no"> | ||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
|
||
<AppId Id="D6040299-B15C-4C94-AE26-0C9B60D14C35" /> | ||
|
||
<Feature Id="ProductFeature" Title="MsiPackageTitle"> | ||
<Component Directory="INSTALLFOLDER"> | ||
<File Source="test.txt" /> | ||
</Component> | ||
</Feature> | ||
</Package> | ||
|
||
<Fragment> | ||
<StandardDirectory Id="ProgramFiles6432Folder"> | ||
<Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
</StandardDirectory> | ||
</Fragment> | ||
</Wix> |