diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
6 files changed, 80 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 38ef2e2e..6fd02d5f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -253,6 +253,39 @@ namespace WixToolsetTest.CoreIntegration | |||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | [Fact] | 255 | [Fact] |
| 256 | public void PopulatesCreateFolderTableForNullKeypathComponents() | ||
| 257 | { | ||
| 258 | var folder = TestData.Get(@"TestData\Components"); | ||
| 259 | |||
| 260 | using (var fs = new DisposableFileSystem()) | ||
| 261 | { | ||
| 262 | var baseFolder = fs.GetFolder(); | ||
| 263 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 264 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 265 | |||
| 266 | var result = WixRunner.Execute(new[] | ||
| 267 | { | ||
| 268 | "build", | ||
| 269 | Path.Combine(folder, "Package.wxs"), | ||
| 270 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 271 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 272 | "-bindpath", Path.Combine(folder, "data"), | ||
| 273 | "-intermediateFolder", intermediateFolder, | ||
| 274 | "-o", msiPath | ||
| 275 | }); | ||
| 276 | |||
| 277 | result.AssertSuccess(); | ||
| 278 | |||
| 279 | Assert.True(File.Exists(msiPath)); | ||
| 280 | var results = Query.QueryDatabase(msiPath, new[] { "CreateFolder" }); | ||
| 281 | Assert.Equal(new[] | ||
| 282 | { | ||
| 283 | "CreateFolder:INSTALLFOLDER\tNullKeypathComponent", | ||
| 284 | }, results); | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | [Fact] | ||
| 256 | public void PopulatesCustomActionTable() | 289 | public void PopulatesCustomActionTable() |
| 257 | { | 290 | { |
| 258 | var folder = TestData.Get(@"TestData"); | 291 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/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/Components/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.wxs new file mode 100644 index 00000000..6da3dcbe --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/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="MsiPackage" 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/Components/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/PackageComponents.wxs new file mode 100644 index 00000000..beaf70bf --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/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 Id="NullKeypathComponent" Guid="{C493379B-D655-4331-8F03-B618C70EA779}" KeyPath="yes"> | ||
| 6 | <File Source="test.txt" /> | ||
| 7 | </Component> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/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 b17a27ff..a64ff93d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -156,6 +156,10 @@ | |||
| 156 | <Content Include="TestData\ProgId\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 156 | <Content Include="TestData\ProgId\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 157 | <Content Include="TestData\ProgId\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 157 | <Content Include="TestData\ProgId\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 158 | <Content Include="TestData\ProgId\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 158 | <Content Include="TestData\ProgId\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 159 | <Content Include="TestData\Components\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 160 | <Content Include="TestData\Components\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 161 | <Content Include="TestData\Components\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 162 | <Content Include="TestData\Components\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 159 | </ItemGroup> | 163 | </ItemGroup> |
| 160 | 164 | ||
| 161 | <ItemGroup> | 165 | <ItemGroup> |
