diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-07-21 14:31:53 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-07-21 14:41:12 -0700 |
| commit | b62a7a0beb7ceb7987de28ec768c7814cadb83b9 (patch) | |
| tree | 69a9183a3182334f0d48a39ab8e411ee3fc3aecd /src/test/WixToolsetTest.CoreIntegration | |
| parent | 414c07f7adce9c9fd0132ab0fade0267f743f665 (diff) | |
| download | wix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.tar.gz wix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.tar.bz2 wix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.zip | |
Support implicit standard directory reference and "3264" platform folders
Completes wixtoolset/issues#5798 and wixtoolset/issues#5835
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
7 files changed, 124 insertions, 13 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs new file mode 100644 index 00000000..83f2f2bb --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using System.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Core.TestPackage; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using Xunit; | ||
| 11 | |||
| 12 | public class DirectoryFixture | ||
| 13 | { | ||
| 14 | [Fact] | ||
| 15 | public void CanGet32bitProgramFiles6432Folder() | ||
| 16 | { | ||
| 17 | var folder = TestData.Get(@"TestData"); | ||
| 18 | |||
| 19 | using (var fs = new DisposableFileSystem()) | ||
| 20 | { | ||
| 21 | var baseFolder = fs.GetFolder(); | ||
| 22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 23 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 24 | |||
| 25 | var result = WixRunner.Execute(new[] | ||
| 26 | { | ||
| 27 | "build", | ||
| 28 | Path.Combine(folder, "Directory", "Empty.wxs"), | ||
| 29 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 30 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 31 | "-intermediateFolder", intermediateFolder, | ||
| 32 | "-o", msiPath | ||
| 33 | }); | ||
| 34 | |||
| 35 | result.AssertSuccess(); | ||
| 36 | |||
| 37 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
| 38 | var section = intermediate.Sections.Single(); | ||
| 39 | |||
| 40 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | ||
| 41 | Assert.Equal(new[] | ||
| 42 | { | ||
| 43 | "INSTALLFOLDER", | ||
| 44 | "ProgramFiles6432Folder", | ||
| 45 | "ProgramFilesFolder", | ||
| 46 | "TARGETDIR" | ||
| 47 | }, dirSymbols.Select(d => d.Id.Id).ToArray()); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | [Fact] | ||
| 52 | public void CanGet64bitProgramFiles6432Folder() | ||
| 53 | { | ||
| 54 | var folder = TestData.Get(@"TestData"); | ||
| 55 | |||
| 56 | using (var fs = new DisposableFileSystem()) | ||
| 57 | { | ||
| 58 | var baseFolder = fs.GetFolder(); | ||
| 59 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 60 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 61 | |||
| 62 | var result = WixRunner.Execute(new[] | ||
| 63 | { | ||
| 64 | "build", | ||
| 65 | "-arch", "x64", | ||
| 66 | Path.Combine(folder, "Directory", "Empty.wxs"), | ||
| 67 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 68 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 69 | "-intermediateFolder", intermediateFolder, | ||
| 70 | "-o", msiPath | ||
| 71 | }); | ||
| 72 | |||
| 73 | result.AssertSuccess(); | ||
| 74 | |||
| 75 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
| 76 | var section = intermediate.Sections.Single(); | ||
| 77 | |||
| 78 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | ||
| 79 | Assert.Equal(new[] | ||
| 80 | { | ||
| 81 | "INSTALLFOLDER", | ||
| 82 | "ProgramFiles6432Folder", | ||
| 83 | "ProgramFiles64Folder", | ||
| 84 | "TARGETDIR" | ||
| 85 | }, dirSymbols.Select(d => d.Id.Id).ToArray()); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 3ab218d1..4ff7f5f6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -365,14 +365,15 @@ namespace WixToolsetTest.CoreIntegration | |||
| 365 | 365 | ||
| 366 | Assert.True(File.Exists(msiPath)); | 366 | Assert.True(File.Exists(msiPath)); |
| 367 | var results = Query.QueryDatabase(msiPath, new[] { "Directory" }); | 367 | var results = Query.QueryDatabase(msiPath, new[] { "Directory" }); |
| 368 | Assert.Equal(new[] | 368 | WixAssert.CompareLineByLine(new[] |
| 369 | { | 369 | { |
| 370 | "Directory:DUPLICATENAMEANDSHORTNAME\tINSTALLFOLDER\tduplicat", | 370 | "Directory:DUPLICATENAMEANDSHORTNAME\tINSTALLFOLDER\tduplicat", |
| 371 | "Directory:INSTALLFOLDER\tProgramFilesFolder\toekcr5lq|MsiPackage", | 371 | "Directory:INSTALLFOLDER\tProgramFiles6432Folder\t1egc1laj|MsiPackage", |
| 372 | "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", | 372 | "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", |
| 373 | "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", | 373 | "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", |
| 374 | "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", | 374 | "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", |
| 375 | "Directory:ProgramFilesFolder\tTARGETDIR\t.", | 375 | "Directory:ProgramFiles6432Folder\tProgramFilesFolder\t.", |
| 376 | "Directory:ProgramFilesFolder\tTARGETDIR\tPFiles", | ||
| 376 | "Directory:SHORTNAMEANDLONGSOURCENAME\tINSTALLFOLDER\tSHNALSNM:6ukthv5q|ShortNameAndLongSourceName", | 377 | "Directory:SHORTNAMEANDLONGSOURCENAME\tINSTALLFOLDER\tSHNALSNM:6ukthv5q|ShortNameAndLongSourceName", |
| 377 | "Directory:SHORTNAMEONLY\tINSTALLFOLDER\tSHORTONL", | 378 | "Directory:SHORTNAMEONLY\tINSTALLFOLDER\tSHORTONL", |
| 378 | "Directory:SOURCENAME\tINSTALLFOLDER\ts2s5bq-i|NameAndSourceName:dhnqygng|SourceNameWithName", | 379 | "Directory:SOURCENAME\tINSTALLFOLDER\ts2s5bq-i|NameAndSourceName:dhnqygng|SourceNameWithName", |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/SimpleCustomAction.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/SimpleCustomAction.wxs new file mode 100644 index 00000000..72d5e4a5 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/SimpleCustomAction.wxs | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <ComponentGroup Id="ProductComponents"> | ||
| 5 | <ComponentGroupRef Id="MinimalComponentGroup" /> | ||
| 6 | </ComponentGroup> | ||
| 7 | |||
| 8 | <Binary Id="Binary1" SourceFile="test.txt" /> | ||
| 9 | <CustomAction Id="Action1" BinaryKey="Binary1" DllEntry="EntryPoint1" /> | ||
| 10 | |||
| 11 | <InstallExecuteSequence> | ||
| 12 | <Custom Action="Action1" After="InstallFiles" /> | ||
| 13 | </InstallExecuteSequence> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs index 68386612..c55f4ed0 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs | |||
| @@ -15,11 +15,13 @@ | |||
| 15 | </Row> | 15 | </Row> |
| 16 | </CustomTable> | 16 | </CustomTable> |
| 17 | <Directory Id="TARGETDIR" Name="SourceDir"> | 17 | <Directory Id="TARGETDIR" Name="SourceDir"> |
| 18 | <Directory Id="ProgramFilesFolder"> | 18 | <Directory Id="ProgramFilesFolder" Name="PFiles"> |
| 19 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="oekcr5lq"> | 19 | <Directory Id="ProgramFiles6432Folder"> |
| 20 | <Component Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Guid="{E597A58A-03CB-50D8-93E3-DABA263F233A}" Win64="no"> | 20 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="1egc1laj"> |
| 21 | <File Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Name="test.txt" KeyPath="yes" Source="SourceDir\\MsiPackage\test.txt" /> | 21 | <Component Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Guid="{E597A58A-03CB-50D8-93E3-DABA263F233A}" Win64="no"> |
| 22 | </Component> | 22 | <File Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Name="test.txt" KeyPath="yes" Source="SourceDir\PFiles\\MsiPackage\test.txt" /> |
| 23 | </Component> | ||
| 24 | </Directory> | ||
| 23 | </Directory> | 25 | </Directory> |
| 24 | </Directory> | 26 | </Directory> |
| 25 | </Directory> | 27 | </Directory> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/Empty.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/Empty.wxs new file mode 100644 index 00000000..50cf6850 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/Empty.wxs | |||
| @@ -0,0 +1,6 @@ | |||
| 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 | </Fragment> | ||
| 6 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs index b2f22b7d..5b26091a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs | |||
| @@ -11,10 +11,6 @@ | |||
| 11 | </Product> | 11 | </Product> |
| 12 | 12 | ||
| 13 | <Fragment> | 13 | <Fragment> |
| 14 | <Directory Id="TARGETDIR" Name="SourceDir"> | 14 | <Directory Id="INSTALLFOLDER" Name="ProgramFiles6432Folder:\MsiPackage" /> |
| 15 | <Directory Id="ProgramFilesFolder"> | ||
| 16 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 17 | </Directory> | ||
| 18 | </Directory> | ||
| 19 | </Fragment> | 15 | </Fragment> |
| 20 | </Wix> | 16 | </Wix> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 15078b8a..601a66e7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | <Content Include="TestData\Class\IconIndex0.wxs" CopyToOutputDirectory="PreserveNewest" /> | 36 | <Content Include="TestData\Class\IconIndex0.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 37 | <Content Include="TestData\Class\OldClassTableDef.msi" CopyToOutputDirectory="PreserveNewest" /> | 37 | <Content Include="TestData\Class\OldClassTableDef.msi" CopyToOutputDirectory="PreserveNewest" /> |
| 38 | <Content Include="TestData\CopyFile\CopyFile.wxs" CopyToOutputDirectory="PreserveNewest" /> | 38 | <Content Include="TestData\CopyFile\CopyFile.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 39 | <Content Include="TestData\CustomAction\SimpleCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 39 | <Content Include="TestData\CustomAction\CustomActionCycle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 40 | <Content Include="TestData\CustomAction\CustomActionCycle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 40 | <Content Include="TestData\CustomAction\UnscheduledCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" /> | 41 | <Content Include="TestData\CustomAction\UnscheduledCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 41 | <Content Include="TestData\CustomTable\CustomTable-Expected.wxs" CopyToOutputDirectory="PreserveNewest" /> | 42 | <Content Include="TestData\CustomTable\CustomTable-Expected.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| @@ -48,6 +49,7 @@ | |||
| 48 | <Content Include="TestData\CustomTable\LocalizedCustomTable.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 49 | <Content Include="TestData\CustomTable\LocalizedCustomTable.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 49 | <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> | 50 | <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 50 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 51 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 52 | <Content Include="TestData\Directory\Empty.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 51 | <Content Include="TestData\EnsureTable\EnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> | 53 | <Content Include="TestData\EnsureTable\EnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 52 | <Content Include="TestData\Environment\Environment.wxs" CopyToOutputDirectory="PreserveNewest" /> | 54 | <Content Include="TestData\Environment\Environment.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 53 | <Content Include="TestData\ErrorsInUI\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 55 | <Content Include="TestData\ErrorsInUI\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
