diff options
| author | Bob Arnson <bob@firegiant.com> | 2019-01-16 16:25:46 -0500 |
|---|---|---|
| committer | Rob Mensching <rob@robmensching.com> | 2019-01-16 13:31:40 -0800 |
| commit | 214f53de1c6500aa8dd46e9604c90178807fda1a (patch) | |
| tree | fab56b9447dc618ec0730703f131a23a669af11a /src/test/WixToolsetTest.CoreIntegration | |
| parent | a8e31958d7e1b0ef10ea8035abf1e3bf07170eb8 (diff) | |
| download | wix-214f53de1c6500aa8dd46e9604c90178807fda1a.tar.gz wix-214f53de1c6500aa8dd46e9604c90178807fda1a.tar.bz2 wix-214f53de1c6500aa8dd46e9604c90178807fda1a.zip | |
Fix overridable actions being tagged as duplicates.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
6 files changed, 129 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs new file mode 100644 index 00000000..fcbff1aa --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | |||
| 2 | // 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. | ||
| 3 | |||
| 4 | namespace WixToolsetTest.CoreIntegration | ||
| 5 | { | ||
| 6 | using System.IO; | ||
| 7 | using System.Linq; | ||
| 8 | using WixBuildTools.TestSupport; | ||
| 9 | using WixToolset.Core.TestPackage; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Data.Tuples; | ||
| 12 | using WixToolset.Data.WindowsInstaller; | ||
| 13 | using Xunit; | ||
| 14 | |||
| 15 | public class LinkerFixture | ||
| 16 | { | ||
| 17 | [Fact] | ||
| 18 | public void CanBuildWithOverridableActions() | ||
| 19 | { | ||
| 20 | var folder = TestData.Get(@"TestData\OverridableActions"); | ||
| 21 | |||
| 22 | using (var fs = new DisposableFileSystem()) | ||
| 23 | { | ||
| 24 | var baseFolder = fs.GetFolder(); | ||
| 25 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 26 | |||
| 27 | var result = WixRunner.Execute(new[] | ||
| 28 | { | ||
| 29 | "build", | ||
| 30 | Path.Combine(folder, "Package.wxs"), | ||
| 31 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 32 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 33 | "-bindpath", Path.Combine(folder, "data"), | ||
| 34 | "-intermediateFolder", intermediateFolder, | ||
| 35 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 36 | }); | ||
| 37 | |||
| 38 | result.AssertSuccess(); | ||
| 39 | |||
| 40 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
| 41 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
| 42 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); | ||
| 43 | |||
| 44 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
| 45 | var section = intermediate.Sections.Single(); | ||
| 46 | |||
| 47 | var actions = section.Tuples.OfType<WixActionTuple>().Where(wat => wat.Action.StartsWith("Set")).ToList(); | ||
| 48 | Assert.Equal(2, actions.Count); | ||
| 49 | //Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 50 | //Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | } | ||
| 54 | } | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/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/OverridableActions/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/Package.wxs new file mode 100644 index 00000000..d8743747 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/Package.wxs | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 4 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 5 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 6 | |||
| 7 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 8 | <MediaTemplate /> | ||
| 9 | |||
| 10 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 11 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 12 | <ComponentGroupRef Id="Foo1" /> | ||
| 13 | <ComponentGroupRef Id="Foo2" /> | ||
| 14 | </Feature> | ||
| 15 | |||
| 16 | <!--<CustomActionRef Id="SetFoo" />--> | ||
| 17 | |||
| 18 | </Product> | ||
| 19 | |||
| 20 | <Fragment Id="SetFoo"> | ||
| 21 | <CustomAction Id="SetFoo" Property="FOO" Value="BOB" /> | ||
| 22 | <CustomAction Id="SetBar" Property="BAR" Value="BOB" /> | ||
| 23 | </Fragment> | ||
| 24 | |||
| 25 | <Fragment Id="Foo1"> | ||
| 26 | <ComponentGroup Id="Foo1" /> | ||
| 27 | |||
| 28 | <InstallExecuteSequence> | ||
| 29 | <Custom Action="SetFoo" Before="SetBar" /> | ||
| 30 | <Custom Action="SetBar" Overridable="yes" Before="AppSearch" /> | ||
| 31 | </InstallExecuteSequence> | ||
| 32 | </Fragment> | ||
| 33 | |||
| 34 | <Fragment Id="Foo2"> | ||
| 35 | <ComponentGroup Id="Foo2" /> | ||
| 36 | |||
| 37 | <InstallExecuteSequence> | ||
| 38 | <Custom Action="SetBar" Before="AppSearch" /> | ||
| 39 | </InstallExecuteSequence> | ||
| 40 | </Fragment> | ||
| 41 | |||
| 42 | <Fragment Id="Directories"> | ||
| 43 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 44 | <Directory Id="ProgramFilesFolder"> | ||
| 45 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 46 | </Directory> | ||
| 47 | </Directory> | ||
| 48 | </Fragment> | ||
| 49 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/PackageComponents.wxs | |||
| @@ -0,0 +1,10 @@ | |||
| 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 Source="test.txt" /> | ||
| 7 | </Component> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/OverridableActions/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 7365f140..2b202350 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -77,6 +77,10 @@ | |||
| 77 | <Content Include="TestData\Variables\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 77 | <Content Include="TestData\Variables\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 78 | <Content Include="TestData\Variables\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 78 | <Content Include="TestData\Variables\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 79 | <Content Include="TestData\Variables\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 79 | <Content Include="TestData\Variables\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 80 | <Content Include="TestData\OverridableActions\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 81 | <Content Include="TestData\OverridableActions\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 82 | <Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 83 | <Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 80 | </ItemGroup> | 84 | </ItemGroup> |
| 81 | 85 | ||
| 82 | <ItemGroup> | 86 | <ItemGroup> |
