diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-07-21 07:36:34 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-07-21 07:36:34 -0700 |
| commit | 306f1d0c528cb6c151594ff96a41b5c01a5c4d9b (patch) | |
| tree | 95deb0884b59decc082eae7adf5d65d45c5f3848 /src/test/WixToolsetTest.BuildTasks | |
| parent | 6fc54af07b10742e883f3a39ef0114e55e6a36a0 (diff) | |
| download | wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.tar.gz wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.tar.bz2 wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.zip | |
Integrate tools from Core project
Diffstat (limited to 'src/test/WixToolsetTest.BuildTasks')
16 files changed, 400 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs new file mode 100644 index 00000000..8fd69414 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs | |||
| @@ -0,0 +1,33 @@ | |||
| 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.Text; | ||
| 7 | using Microsoft.Build.Framework; | ||
| 8 | |||
| 9 | internal class FakeBuildEngine : IBuildEngine | ||
| 10 | { | ||
| 11 | private StringBuilder output = new StringBuilder(); | ||
| 12 | |||
| 13 | public int ColumnNumberOfTaskNode => 0; | ||
| 14 | |||
| 15 | public bool ContinueOnError => false; | ||
| 16 | |||
| 17 | public int LineNumberOfTaskNode => 0; | ||
| 18 | |||
| 19 | public string ProjectFileOfTaskNode => "fake_wix.targets"; | ||
| 20 | |||
| 21 | public string Output => this.output.ToString(); | ||
| 22 | |||
| 23 | public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); | ||
| 24 | |||
| 25 | public void LogCustomEvent(CustomBuildEventArgs e) => this.output.AppendLine(e.Message); | ||
| 26 | |||
| 27 | public void LogErrorEvent(BuildErrorEventArgs e) => this.output.AppendLine(e.Message); | ||
| 28 | |||
| 29 | public void LogMessageEvent(BuildMessageEventArgs e) => this.output.AppendLine(e.Message); | ||
| 30 | |||
| 31 | public void LogWarningEvent(BuildWarningEventArgs e) => this.output.AppendLine(e.Message); | ||
| 32 | } | ||
| 33 | } | ||
diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs new file mode 100644 index 00000000..a27928d5 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | |||
| @@ -0,0 +1,64 @@ | |||
| 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 CanBuildSimpleMsiPackage() | ||
| 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 engine = new FakeBuildEngine(); | ||
| 27 | |||
| 28 | var task = new DoIt | ||
| 29 | { | ||
| 30 | BuildEngine = engine, | ||
| 31 | SourceFiles = new[] | ||
| 32 | { | ||
| 33 | new TaskItem(Path.Combine(folder, "Package.wxs")), | ||
| 34 | new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), | ||
| 35 | }, | ||
| 36 | LocalizationFiles = new[] | ||
| 37 | { | ||
| 38 | new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), | ||
| 39 | }, | ||
| 40 | BindInputPaths = new[] | ||
| 41 | { | ||
| 42 | new TaskItem(Path.Combine(folder, "data")), | ||
| 43 | }, | ||
| 44 | IntermediateDirectory = new TaskItem(intermediateFolder), | ||
| 45 | OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), | ||
| 46 | }; | ||
| 47 | |||
| 48 | var result = task.Execute(); | ||
| 49 | Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); | ||
| 50 | |||
| 51 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
| 52 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
| 53 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); | ||
| 54 | |||
| 55 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); | ||
| 56 | var section = intermediate.Sections.Single(); | ||
| 57 | |||
| 58 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
| 59 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 60 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } | ||
| 64 | } | ||
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/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/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/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/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/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/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/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/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/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.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/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..31c3ec9c --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | |||
| @@ -0,0 +1,55 @@ | |||
| 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 | </PropertyGroup> | ||
| 13 | |||
| 14 | <PropertyGroup> | ||
| 15 | <WixTargetsPath>..\..\..\..\..\..\build\Release\publish\wix.targets</WixTargetsPath> | ||
| 16 | </PropertyGroup> | ||
| 17 | |||
| 18 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
| 19 | <PlatformName>$(Platform)</PlatformName> | ||
| 20 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 21 | <DefineConstants>Debug</DefineConstants> | ||
| 22 | </PropertyGroup> | ||
| 23 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
| 24 | <PlatformName>$(Platform)</PlatformName> | ||
| 25 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 26 | </PropertyGroup> | ||
| 27 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> | ||
| 28 | <PlatformName>$(Platform)</PlatformName> | ||
| 29 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 30 | <DefineConstants>Debug</DefineConstants> | ||
| 31 | </PropertyGroup> | ||
| 32 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> | ||
| 33 | <PlatformName>$(Platform)</PlatformName> | ||
| 34 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
| 35 | </PropertyGroup> | ||
| 36 | |||
| 37 | <ItemGroup> | ||
| 38 | <Compile Include="Package.wxs" /> | ||
| 39 | <Compile Include="PackageComponents.wxs" /> | ||
| 40 | </ItemGroup> | ||
| 41 | |||
| 42 | <ItemGroup> | ||
| 43 | <EmbeddedResource Include="Package.en-us.wxl" /> | ||
| 44 | </ItemGroup> | ||
| 45 | |||
| 46 | <ItemGroup> | ||
| 47 | <BindInputPaths Include="data" /> | ||
| 48 | </ItemGroup> | ||
| 49 | |||
| 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') " /> | ||
| 52 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> | ||
| 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> | ||
| 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 new file mode 100644 index 00000000..5ec5b7fd --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj | |||
| @@ -0,0 +1,32 @@ | |||
| 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. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>net461</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | <DebugType>embedded</DebugType> | ||
| 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> | ||
| 21 | |||
| 22 | <ItemGroup> | ||
| 23 | <PackageReference Include="Microsoft.Build.Tasks.Core" Version="14.3" PrivateAssets="All" /> | ||
| 24 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 25 | </ItemGroup> | ||
| 26 | |||
| 27 | <ItemGroup> | ||
| 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" /> | ||
| 31 | </ItemGroup> | ||
| 32 | </Project> | ||
