diff options
Diffstat (limited to 'src')
20 files changed, 260 insertions, 16 deletions
diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 977a2326..0c7a0943 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs | |||
| @@ -28,7 +28,7 @@ namespace WixToolset.BuildTasks | |||
| 28 | 28 | ||
| 29 | public string AdditionalOptions { get; set; } | 29 | public string AdditionalOptions { get; set; } |
| 30 | 30 | ||
| 31 | public string Cultures { get; set; } | 31 | public string[] Cultures { get; set; } |
| 32 | 32 | ||
| 33 | public string[] DefineConstants { get; set; } | 33 | public string[] DefineConstants { get; set; } |
| 34 | 34 | ||
| @@ -145,7 +145,7 @@ namespace WixToolset.BuildTasks | |||
| 145 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); | 145 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); |
| 146 | commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); | 146 | commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); |
| 147 | commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); | 147 | commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); |
| 148 | commandLineBuilder.AppendSwitchIfNotNull("-cultures ", this.Cultures); | 148 | commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); |
| 149 | commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); | 149 | commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); |
| 150 | commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); | 150 | commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); |
| 151 | commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); | 151 | commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); |
diff --git a/src/WixToolset.BuildTasks/WixAssignCulture.cs b/src/WixToolset.BuildTasks/WixAssignCulture.cs index 7a03dc47..a8baa62f 100644 --- a/src/WixToolset.BuildTasks/WixAssignCulture.cs +++ b/src/WixToolset.BuildTasks/WixAssignCulture.cs | |||
| @@ -174,8 +174,6 @@ namespace WixToolset.BuildTasks | |||
| 174 | 174 | ||
| 175 | private class CultureGroup | 175 | private class CultureGroup |
| 176 | { | 176 | { |
| 177 | private List<string> cultures = new List<string>(); | ||
| 178 | |||
| 179 | /// <summary> | 177 | /// <summary> |
| 180 | /// TargetPath already has a '\', do not double it! | 178 | /// TargetPath already has a '\', do not double it! |
| 181 | /// </summary> | 179 | /// </summary> |
| @@ -193,11 +191,11 @@ namespace WixToolset.BuildTasks | |||
| 193 | Debug.Assert(!String.IsNullOrEmpty(cultureGroupString)); | 191 | Debug.Assert(!String.IsNullOrEmpty(cultureGroupString)); |
| 194 | foreach (string cultureString in cultureGroupString.Split(',')) | 192 | foreach (string cultureString in cultureGroupString.Split(',')) |
| 195 | { | 193 | { |
| 196 | this.cultures.Add(cultureString); | 194 | this.Cultures.Add(cultureString); |
| 197 | } | 195 | } |
| 198 | } | 196 | } |
| 199 | 197 | ||
| 200 | public List<string> Cultures { get { return cultures; } } | 198 | public List<string> Cultures { get; } = new List<string>(); |
| 201 | 199 | ||
| 202 | public string OutputFolder | 200 | public string OutputFolder |
| 203 | { | 201 | { |
| @@ -218,7 +216,7 @@ namespace WixToolset.BuildTasks | |||
| 218 | { | 216 | { |
| 219 | if (this.Cultures.Count > 0) | 217 | if (this.Cultures.Count > 0) |
| 220 | { | 218 | { |
| 221 | return String.Join(",", this.Cultures.ToArray()); | 219 | return String.Join(";", this.Cultures); |
| 222 | } | 220 | } |
| 223 | 221 | ||
| 224 | // We use a keyword for a null culture because MSBuild cannnot handle "" items | 222 | // We use a keyword for a null culture because MSBuild cannnot handle "" items |
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index 03cf344b..14b5d0cf 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs | |||
| @@ -232,7 +232,6 @@ namespace WixToolset.Core | |||
| 232 | 232 | ||
| 233 | var localizations = context.Localizations.Concat(context.IntermediateRepresentation.Localizations).ToList(); | 233 | var localizations = context.Localizations.Concat(context.IntermediateRepresentation.Localizations).ToList(); |
| 234 | 234 | ||
| 235 | // If there still is no filter, return all localizations. | ||
| 236 | AddFilteredLocalizations(result, filter, localizations); | 235 | AddFilteredLocalizations(result, filter, localizations); |
| 237 | 236 | ||
| 238 | // Filter localizations provided by extensions with data. | 237 | // Filter localizations provided by extensions with data. |
| @@ -270,6 +269,7 @@ namespace WixToolset.Core | |||
| 270 | 269 | ||
| 271 | private static void AddFilteredLocalizations(List<Localization> result, IEnumerable<string> filter, IEnumerable<Localization> localizations) | 270 | private static void AddFilteredLocalizations(List<Localization> result, IEnumerable<string> filter, IEnumerable<Localization> localizations) |
| 272 | { | 271 | { |
| 272 | // If there is no filter, return all localizations. | ||
| 273 | if (!filter.Any()) | 273 | if (!filter.Any()) |
| 274 | { | 274 | { |
| 275 | result.AddRange(localizations); | 275 | result.AddRange(localizations); |
diff --git a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs new file mode 100644 index 00000000..0559057f --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs | |||
| @@ -0,0 +1,29 @@ | |||
| 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.BuildTasks | ||
| 4 | { | ||
| 5 | using System.Collections; | ||
| 6 | using System.Diagnostics; | ||
| 7 | using Microsoft.Build.Framework; | ||
| 8 | |||
| 9 | internal class FakeBuildEngine : IBuildEngine | ||
| 10 | { | ||
| 11 | public int ColumnNumberOfTaskNode => 0; | ||
| 12 | |||
| 13 | public bool ContinueOnError => false; | ||
| 14 | |||
| 15 | public int LineNumberOfTaskNode => 0; | ||
| 16 | |||
| 17 | public string ProjectFileOfTaskNode => "fake_wix.targets"; | ||
| 18 | |||
| 19 | public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); | ||
| 20 | |||
| 21 | public void LogCustomEvent(CustomBuildEventArgs e) => Debug.Write(e.Message); | ||
| 22 | |||
| 23 | public void LogErrorEvent(BuildErrorEventArgs e) => Debug.Write(e.Message); | ||
| 24 | |||
| 25 | public void LogMessageEvent(BuildMessageEventArgs e) => Debug.Write(e.Message); | ||
| 26 | |||
| 27 | public void LogWarningEvent(BuildWarningEventArgs e) => Debug.Write(e.Message); | ||
| 28 | } | ||
| 29 | } | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs new file mode 100644 index 00000000..79975f37 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | |||
| @@ -0,0 +1,62 @@ | |||
| 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.BuildTasks | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using System.Linq; | ||
| 7 | using Microsoft.Build.Utilities; | ||
| 8 | using WixBuildTools.TestSupport; | ||
| 9 | using WixToolset.BuildTasks; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Data.Tuples; | ||
| 12 | using Xunit; | ||
| 13 | |||
| 14 | public partial class MsbuildFixture | ||
| 15 | { | ||
| 16 | [Fact] | ||
| 17 | public void CanBuildSingleFile() | ||
| 18 | { | ||
| 19 | var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | ||
| 20 | |||
| 21 | using (var fs = new DisposableFileSystem()) | ||
| 22 | { | ||
| 23 | var baseFolder = fs.GetFolder(); | ||
| 24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 25 | |||
| 26 | var task = new DoIt | ||
| 27 | { | ||
| 28 | BuildEngine = new FakeBuildEngine(), | ||
| 29 | SourceFiles = new[] | ||
| 30 | { | ||
| 31 | new TaskItem(Path.Combine(folder, "Package.wxs")), | ||
| 32 | new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), | ||
| 33 | }, | ||
| 34 | LocalizationFiles = new[] | ||
| 35 | { | ||
| 36 | new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), | ||
| 37 | }, | ||
| 38 | BindInputPaths = new[] | ||
| 39 | { | ||
| 40 | new TaskItem(Path.Combine(folder, "data")), | ||
| 41 | }, | ||
| 42 | IntermediateDirectory = new TaskItem(intermediateFolder), | ||
| 43 | OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), | ||
| 44 | }; | ||
| 45 | |||
| 46 | var result = task.Execute(); | ||
| 47 | Assert.True(result, "MSBuild task failed unexpectedly."); | ||
| 48 | |||
| 49 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
| 50 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
| 51 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); | ||
| 52 | |||
| 53 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); | ||
| 54 | var section = intermediate.Sections.Single(); | ||
| 55 | |||
| 56 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
| 57 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 58 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..e04ea43d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| 5 | <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
| 6 | <ProductVersion>0.9</ProductVersion> | ||
| 7 | <ProjectGuid>7fb77005-c6e0-454f-8c2d-0a4a79c918ba</ProjectGuid> | ||
| 8 | <OutputName>MsiPackage</OutputName> | ||
| 9 | <OutputType>Package</OutputType> | ||
| 10 | <Name>MsiPackage</Name> | ||
| 11 | <RootNamespace>MsiPackage</RootNamespace> | ||
| 12 | <Cultures>en-US,en;de-DE</Cultures> | ||
| 13 | </PropertyGroup> | ||
| 14 | |||
| 15 | <PropertyGroup> | ||
| 16 | <WixTargetsPath>..\..\..\..\..\..\build\Release\publish\net461\wix.targets</WixTargetsPath> | ||
| 17 | </PropertyGroup> | ||
| 18 | |||
| 19 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
| 20 | <PlatformName>$(Platform)</PlatformName> | ||
| 21 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 22 | <DefineConstants>Debug</DefineConstants> | ||
| 23 | </PropertyGroup> | ||
| 24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
| 25 | <PlatformName>$(Platform)</PlatformName> | ||
| 26 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 27 | </PropertyGroup> | ||
| 28 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> | ||
| 29 | <PlatformName>$(Platform)</PlatformName> | ||
| 30 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 31 | <DefineConstants>Debug</DefineConstants> | ||
| 32 | </PropertyGroup> | ||
| 33 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> | ||
| 34 | <PlatformName>$(Platform)</PlatformName> | ||
| 35 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 36 | </PropertyGroup> | ||
| 37 | |||
| 38 | <ItemGroup> | ||
| 39 | <Compile Include="Package.wxs" /> | ||
| 40 | <Compile Include="PackageComponents.wxs" /> | ||
| 41 | </ItemGroup> | ||
| 42 | |||
| 43 | <ItemGroup> | ||
| 44 | <EmbeddedResource Include="Package.en-us.wxl" /> | ||
| 45 | <EmbeddedResource Include="Package.de-de.wxl" /> | ||
| 46 | </ItemGroup> | ||
| 47 | |||
| 48 | <ItemGroup> | ||
| 49 | <BindInputPaths Include="data" /> | ||
| 50 | </ItemGroup> | ||
| 51 | |||
| 52 | <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> | ||
| 53 | <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " /> | ||
| 54 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> | ||
| 55 | <Error Text="WiX Toolset build tools (v3.11 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." /> | ||
| 56 | </Target> | ||
| 57 | </Project> | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl new file mode 100644 index 00000000..23493ace --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.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="de-DE"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">German DowngradeError</String> | ||
| 9 | <String Id="FeatureTitle">German FeatureTitle</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl index 38c12ac1..38c12ac1 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/Package.en-us.wxl +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs index d5a5a40d..d5a5a40d 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs index e26c4509..e26c4509 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt index cd0db0e1..cd0db0e1 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/data/test.txt +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln index 2c88704e..2c88704e 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/SimpleMsiPackage.sln +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj index 9c19a73d..31c3ec9c 100644 --- a/src/test/WixToolsetTest.BuildTasks/data/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | |||
| @@ -50,6 +50,6 @@ | |||
| 50 | <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> | 50 | <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> |
| 51 | <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " /> | 51 | <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " /> |
| 52 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> | 52 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> |
| 53 | <Error Text="FG-WiX or WiX Toolset build tools (v3.11 or later) must be installed to build this project. To download FG-WiX, go to https://www.firegiant.com/downloads/. To download the WiX Toolset, go to http://wixtoolset.org/releases/." /> | 53 | <Error Text="WiX Toolset build tools (v3.11 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." /> |
| 54 | </Target> | 54 | </Target> |
| 55 | </Project> \ No newline at end of file | 55 | </Project> \ No newline at end of file |
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/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.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/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" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="yes" 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.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/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.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt | |||
| @@ -0,0 +1 @@ | |||
| This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | | ||
| 2 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| 3 | # Visual Studio 15 | ||
| 4 | VisualStudioVersion = 15.0.26730.8 | ||
| 5 | MinimumVisualStudioVersion = 10.0.40219.1 | ||
| 6 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" | ||
| 7 | EndProject | ||
| 8 | Global | ||
| 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| 10 | Debug|x64 = Debug|x64 | ||
| 11 | Debug|x86 = Debug|x86 | ||
| 12 | Release|x64 = Release|x64 | ||
| 13 | Release|x86 = Release|x86 | ||
| 14 | EndGlobalSection | ||
| 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| 16 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 | ||
| 17 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 | ||
| 18 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 | ||
| 19 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 | ||
| 20 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 | ||
| 21 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 | ||
| 22 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 | ||
| 23 | {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 | ||
| 24 | EndGlobalSection | ||
| 25 | GlobalSection(SolutionProperties) = preSolution | ||
| 26 | HideSolutionNode = FALSE | ||
| 27 | EndGlobalSection | ||
| 28 | GlobalSection(ExtensibilityGlobals) = postSolution | ||
| 29 | SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} | ||
| 30 | EndGlobalSection | ||
| 31 | EndGlobal | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index dcacc55e..5ec5b7fd 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj | |||
| @@ -1,19 +1,32 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 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. --> | 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 | 3 | ||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
| 5 | <PropertyGroup> | 5 | <PropertyGroup> |
| 6 | <TargetFramework>netcoreapp2.1</TargetFramework> | 6 | <TargetFramework>net461</TargetFramework> |
| 7 | <Description></Description> | 7 | <IsPackable>false</IsPackable> |
| 8 | <Title>WiX Toolset Tests for MSBuild Tasks</Title> | ||
| 9 | <DebugType>embedded</DebugType> | 8 | <DebugType>embedded</DebugType> |
| 10 | </PropertyGroup> | 9 | </PropertyGroup> |
| 10 | |||
| 11 | <ItemGroup> | ||
| 12 | <Content Include="TestData\SimpleMsiPackage\MsiPackage\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 13 | <Content Include="TestData\SimpleMsiPackage\MsiPackage\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 14 | <Content Include="TestData\SimpleMsiPackage\MsiPackage\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 15 | <Content Include="TestData\SimpleMsiPackage\MsiPackage\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 16 | </ItemGroup> | ||
| 17 | |||
| 18 | <ItemGroup> | ||
| 19 | <ProjectReference Include="..\..\WixToolset.BuildTasks\WixToolset.BuildTasks.csproj" /> | ||
| 20 | </ItemGroup> | ||
| 11 | 21 | ||
| 12 | <ItemGroup> | 22 | <ItemGroup> |
| 13 | <!-- <ProjectReference Include="..\..\WixToolset.BuildTasks\WixToolset.BuildTasks.csproj" /> --> | 23 | <PackageReference Include="Microsoft.Build.Tasks.Core" Version="14.3" PrivateAssets="All" /> |
| 24 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 14 | </ItemGroup> | 25 | </ItemGroup> |
| 15 | 26 | ||
| 16 | <ItemGroup> | 27 | <ItemGroup> |
| 17 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" /> | 28 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" /> |
| 29 | <PackageReference Include="xunit" Version="2.3.1" /> | ||
| 30 | <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | ||
| 18 | </ItemGroup> | 31 | </ItemGroup> |
| 19 | </Project> | 32 | </Project> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 059cd45d..5f1fb3d3 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 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. --> | 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 | 3 | ||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
