diff options
author | Bob Arnson <bob@firegiant.com> | 2019-04-02 19:23:16 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2019-04-02 19:35:51 -0400 |
commit | d1dbe29f3856d012acf5f96e8e66c43b74ab490d (patch) | |
tree | f7ee5cb481010968524bb97a6184511c0152b8db | |
parent | 42727c42248d1cb12ef8d9bc6f8ce7dda3f404c9 (diff) | |
download | wix-d1dbe29f3856d012acf5f96e8e66c43b74ab490d.tar.gz wix-d1dbe29f3856d012acf5f96e8e66c43b74ab490d.tar.bz2 wix-d1dbe29f3856d012acf5f96e8e66c43b74ab490d.zip |
Add failing test to demonstrate ProgId bug.
When a parent ProgId has Advertise="yes" and a child ProgId omits Advertise, the compiler assumes it's a non-advertised ProgId. It should be advertised instead.
6 files changed, 92 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index b5e1ec3d..c70d276d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -539,6 +539,45 @@ namespace WixToolsetTest.CoreIntegration | |||
539 | } | 539 | } |
540 | } | 540 | } |
541 | 541 | ||
542 | [Fact] | ||
543 | public void CanBuildVersionIndependentProgId() | ||
544 | { | ||
545 | var folder = TestData.Get(@"TestData\ProgId"); | ||
546 | |||
547 | using (var fs = new DisposableFileSystem()) | ||
548 | { | ||
549 | var baseFolder = fs.GetFolder(); | ||
550 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
551 | |||
552 | var result = WixRunner.Execute(new[] | ||
553 | { | ||
554 | "build", | ||
555 | Path.Combine(folder, "Package.wxs"), | ||
556 | Path.Combine(folder, "PackageComponents.wxs"), | ||
557 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
558 | "-bindpath", Path.Combine(folder, "data"), | ||
559 | "-intermediateFolder", intermediateFolder, | ||
560 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
561 | }); | ||
562 | |||
563 | result.AssertSuccess(); | ||
564 | |||
565 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
566 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
567 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\Foo.exe"))); | ||
568 | |||
569 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
570 | var section = intermediate.Sections.Single(); | ||
571 | |||
572 | var progids = section.Tuples.OfType<ProgIdTuple>().OrderBy(tuple => tuple.ProgId).ToList(); | ||
573 | Assert.Equal(2, progids.Count); | ||
574 | Assert.Equal("Foo.File.hol", progids[0].ProgId); | ||
575 | Assert.Equal("Foo.File.hol.15", progids[0].ProgId_Parent); | ||
576 | Assert.Equal("Foo.File.hol.15", progids[1].ProgId); | ||
577 | Assert.Null(progids[1].ProgId_Parent); | ||
578 | } | ||
579 | } | ||
580 | |||
542 | [Fact(Skip = "Not implemented yet.")] | 581 | [Fact(Skip = "Not implemented yet.")] |
543 | public void CanBuildInstanceTransform() | 582 | public void CanBuildInstanceTransform() |
544 | { | 583 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.en-us.wxl | |||
@@ -0,0 +1,11 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | |||
3 | <!-- | ||
4 | This file contains the declaration of all the localizable strings. | ||
5 | --> | ||
6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
7 | |||
8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
9 | <String Id="FeatureTitle">MsiPackage</String> | ||
10 | |||
11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.wxs new file mode 100644 index 00000000..d4b53cd6 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/Package.wxs | |||
@@ -0,0 +1,21 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Product Id="*" Name="ProgId" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
5 | |||
6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
7 | <MediaTemplate /> | ||
8 | |||
9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
10 | <ComponentGroupRef Id="ProductComponents" /> | ||
11 | </Feature> | ||
12 | </Product> | ||
13 | |||
14 | <Fragment> | ||
15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
16 | <Directory Id="ProgramFilesFolder"> | ||
17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
18 | </Directory> | ||
19 | </Directory> | ||
20 | </Fragment> | ||
21 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/PackageComponents.wxs new file mode 100644 index 00000000..5166be16 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/PackageComponents.wxs | |||
@@ -0,0 +1,16 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
5 | <Component> | ||
6 | <File Name="Foo.exe" Source="test.txt" /> | ||
7 | <ProgId Id="Foo.File.hol.15" Advertise="yes" Description="Foo Holiday File"> | ||
8 | <ProgId Id="Foo.File.hol" /> | ||
9 | <Extension Id="hol"> | ||
10 | <Verb Id="Open" Argument="/hol "%1"" Sequence="1" /> | ||
11 | </Extension> | ||
12 | </ProgId> | ||
13 | </Component> | ||
14 | </ComponentGroup> | ||
15 | </Fragment> | ||
16 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProgId/data/test.txt | |||
@@ -0,0 +1 @@ | |||
This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 874ee70b..8f78725a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -85,6 +85,10 @@ | |||
85 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 85 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
86 | <Content Include="TestData\Wixipl\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 86 | <Content Include="TestData\Wixipl\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
87 | <Content Include="TestData\Wixipl\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 87 | <Content Include="TestData\Wixipl\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
88 | <Content Include="TestData\ProgId\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
89 | <Content Include="TestData\ProgId\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
90 | <Content Include="TestData\ProgId\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
91 | <Content Include="TestData\ProgId\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
88 | </ItemGroup> | 92 | </ItemGroup> |
89 | 93 | ||
90 | <ItemGroup> | 94 | <ItemGroup> |