diff options
Diffstat (limited to 'src/test')
38 files changed, 39 insertions, 645 deletions
diff --git a/src/test/TestData/Example.Extension/Data/example.txt b/src/test/Example.Extension/Data/example.txt index 1b4ffe8a..1b4ffe8a 100644 --- a/src/test/TestData/Example.Extension/Data/example.txt +++ b/src/test/Example.Extension/Data/example.txt | |||
diff --git a/src/test/TestData/Example.Extension/Data/example.wir b/src/test/Example.Extension/Data/example.wir index 674f63fc..674f63fc 100644 --- a/src/test/TestData/Example.Extension/Data/example.wir +++ b/src/test/Example.Extension/Data/example.wir | |||
Binary files differ | |||
diff --git a/src/test/TestData/Example.Extension/Data/example.wxs b/src/test/Example.Extension/Data/example.wxs index 53531e99..53531e99 100644 --- a/src/test/TestData/Example.Extension/Data/example.wxs +++ b/src/test/Example.Extension/Data/example.wxs | |||
diff --git a/src/test/TestData/Example.Extension/Example.Extension.csproj b/src/test/Example.Extension/Example.Extension.csproj index 1dde5044..1dde5044 100644 --- a/src/test/TestData/Example.Extension/Example.Extension.csproj +++ b/src/test/Example.Extension/Example.Extension.csproj | |||
diff --git a/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs b/src/test/Example.Extension/ExampleCompilerExtension.cs index cd9e1fb9..cd9e1fb9 100644 --- a/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs +++ b/src/test/Example.Extension/ExampleCompilerExtension.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleExtensionData.cs b/src/test/Example.Extension/ExampleExtensionData.cs index 724f9eea..724f9eea 100644 --- a/src/test/TestData/Example.Extension/ExampleExtensionData.cs +++ b/src/test/Example.Extension/ExampleExtensionData.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleExtensionFactory.cs b/src/test/Example.Extension/ExampleExtensionFactory.cs index a081b758..a081b758 100644 --- a/src/test/TestData/Example.Extension/ExampleExtensionFactory.cs +++ b/src/test/Example.Extension/ExampleExtensionFactory.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs index 6f86e20d..6f86e20d 100644 --- a/src/test/TestData/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs b/src/test/Example.Extension/ExampleTableDefinitions.cs index dbd6491b..dbd6491b 100644 --- a/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs +++ b/src/test/Example.Extension/ExampleTableDefinitions.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleTuple.cs b/src/test/Example.Extension/ExampleTuple.cs index 0fc0d82c..0fc0d82c 100644 --- a/src/test/TestData/Example.Extension/ExampleTuple.cs +++ b/src/test/Example.Extension/ExampleTuple.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleTupleDefinitions.cs b/src/test/Example.Extension/ExampleTupleDefinitions.cs index 4775b827..4775b827 100644 --- a/src/test/TestData/Example.Extension/ExampleTupleDefinitions.cs +++ b/src/test/Example.Extension/ExampleTupleDefinitions.cs | |||
diff --git a/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs index f00a5102..f00a5102 100644 --- a/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs +++ b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs | |||
diff --git a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs deleted file mode 100644 index 8fd69414..00000000 --- a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
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 deleted file mode 100644 index a27928d5..00000000 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
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 deleted file mode 100644 index e04ea43d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
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 deleted file mode 100644 index 23493ace..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
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 deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
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 deleted file mode 100644 index d5a5a40d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
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 deleted file mode 100644 index e26c4509..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt +++ /dev/null | |||
@@ -1 +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 deleted file mode 100644 index 2c88704e..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
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 deleted file mode 100644 index 31c3ec9c..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
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 deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
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 deleted file mode 100644 index d5a5a40d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
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 deleted file mode 100644 index e26c4509..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt +++ /dev/null | |||
@@ -1 +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 deleted file mode 100644 index 2c88704e..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
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 deleted file mode 100644 index 5ec5b7fd..00000000 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
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> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index 5de61368..cc631c22 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
@@ -8,6 +8,7 @@ namespace WixToolsetTest.CoreIntegration | |||
8 | using Example.Extension; | 8 | using Example.Extension; |
9 | using WixBuildTools.TestSupport; | 9 | using WixBuildTools.TestSupport; |
10 | using WixToolset.Core; | 10 | using WixToolset.Core; |
11 | using WixToolset.Core.TestPackage; | ||
11 | using WixToolset.Data; | 12 | using WixToolset.Data; |
12 | using WixToolset.Data.Tuples; | 13 | using WixToolset.Data.Tuples; |
13 | using Xunit; | 14 | using Xunit; |
@@ -37,8 +38,7 @@ namespace WixToolsetTest.CoreIntegration | |||
37 | { | 38 | { |
38 | var intermediateFolder = fs.GetFolder(); | 39 | var intermediateFolder = fs.GetFolder(); |
39 | 40 | ||
40 | var program = new Program(); | 41 | var result = WixRunner.Execute(new[] |
41 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
42 | { | 42 | { |
43 | "build", | 43 | "build", |
44 | Path.Combine(folder, "Package.wxs"), | 44 | Path.Combine(folder, "Package.wxs"), |
@@ -48,7 +48,7 @@ namespace WixToolsetTest.CoreIntegration | |||
48 | "-bindpath", Path.Combine(folder, "data"), | 48 | "-bindpath", Path.Combine(folder, "data"), |
49 | "-intermediateFolder", intermediateFolder, | 49 | "-intermediateFolder", intermediateFolder, |
50 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") | 50 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") |
51 | }); | 51 | }, out var messages); |
52 | 52 | ||
53 | Assert.Equal(0, result); | 53 | Assert.Equal(0, result); |
54 | 54 | ||
@@ -80,8 +80,7 @@ namespace WixToolsetTest.CoreIntegration | |||
80 | { | 80 | { |
81 | var intermediateFolder = fs.GetFolder(); | 81 | var intermediateFolder = fs.GetFolder(); |
82 | 82 | ||
83 | var program = new Program(); | 83 | var result = WixRunner.Execute(new[] |
84 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
85 | { | 84 | { |
86 | "build", | 85 | "build", |
87 | Path.Combine(folder, "Package.wxs"), | 86 | Path.Combine(folder, "Package.wxs"), |
@@ -92,7 +91,7 @@ namespace WixToolsetTest.CoreIntegration | |||
92 | "-intermediateFolder", intermediateFolder, | 91 | "-intermediateFolder", intermediateFolder, |
93 | "-example", "test", | 92 | "-example", "test", |
94 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") | 93 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") |
95 | }); | 94 | }, out var messages); |
96 | 95 | ||
97 | Assert.Equal(0, result); | 96 | Assert.Equal(0, result); |
98 | 97 | ||
@@ -107,8 +106,7 @@ namespace WixToolsetTest.CoreIntegration | |||
107 | 106 | ||
108 | private static void Build(string[] args) | 107 | private static void Build(string[] args) |
109 | { | 108 | { |
110 | var program = new Program(); | 109 | var result = WixRunner.Execute(args, out var messages); |
111 | var result = program.Run(new WixToolsetServiceProvider(), null, args); | ||
112 | Assert.Equal(0, result); | 110 | Assert.Equal(0, result); |
113 | } | 111 | } |
114 | } | 112 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 5a3071c7..7a10f71e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -5,13 +5,13 @@ namespace WixToolsetTest.CoreIntegration | |||
5 | using System.IO; | 5 | using System.IO; |
6 | using System.Linq; | 6 | using System.Linq; |
7 | using WixBuildTools.TestSupport; | 7 | using WixBuildTools.TestSupport; |
8 | using WixToolset.Core; | 8 | using WixToolset.Core.TestPackage; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Tuples; | 10 | using WixToolset.Data.Tuples; |
11 | using WixToolset.Data.WindowsInstaller; | 11 | using WixToolset.Data.WindowsInstaller; |
12 | using Xunit; | 12 | using Xunit; |
13 | 13 | ||
14 | public class ProgramFixture | 14 | public class MsiFixture |
15 | { | 15 | { |
16 | [Fact] | 16 | [Fact] |
17 | public void CanBuildSingleFile() | 17 | public void CanBuildSingleFile() |
@@ -23,8 +23,7 @@ namespace WixToolsetTest.CoreIntegration | |||
23 | var baseFolder = fs.GetFolder(); | 23 | var baseFolder = fs.GetFolder(); |
24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
25 | 25 | ||
26 | var program = new Program(); | 26 | var result = WixRunner.Execute(new[] |
27 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
28 | { | 27 | { |
29 | "build", | 28 | "build", |
30 | Path.Combine(folder, "Package.wxs"), | 29 | Path.Combine(folder, "Package.wxs"), |
@@ -33,8 +32,7 @@ namespace WixToolsetTest.CoreIntegration | |||
33 | "-bindpath", Path.Combine(folder, "data"), | 32 | "-bindpath", Path.Combine(folder, "data"), |
34 | "-intermediateFolder", intermediateFolder, | 33 | "-intermediateFolder", intermediateFolder, |
35 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | 34 | "-o", Path.Combine(baseFolder, @"bin\test.msi") |
36 | }); | 35 | }, out var messages); |
37 | |||
38 | Assert.Equal(0, result); | 36 | Assert.Equal(0, result); |
39 | 37 | ||
40 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | 38 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); |
@@ -59,8 +57,7 @@ namespace WixToolsetTest.CoreIntegration | |||
59 | { | 57 | { |
60 | var intermediateFolder = fs.GetFolder(); | 58 | var intermediateFolder = fs.GetFolder(); |
61 | 59 | ||
62 | var program = new Program(); | 60 | var result = WixRunner.Execute(new[] |
63 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
64 | { | 61 | { |
65 | "build", | 62 | "build", |
66 | Path.Combine(folder, "Package.wxs"), | 63 | Path.Combine(folder, "Package.wxs"), |
@@ -69,7 +66,7 @@ namespace WixToolsetTest.CoreIntegration | |||
69 | "-bindpath", Path.Combine(folder, "data"), | 66 | "-bindpath", Path.Combine(folder, "data"), |
70 | "-intermediateFolder", intermediateFolder, | 67 | "-intermediateFolder", intermediateFolder, |
71 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 68 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
72 | }); | 69 | }, out var messages); |
73 | 70 | ||
74 | Assert.Equal(0, result); | 71 | Assert.Equal(0, result); |
75 | 72 | ||
@@ -95,8 +92,7 @@ namespace WixToolsetTest.CoreIntegration | |||
95 | { | 92 | { |
96 | var intermediateFolder = fs.GetFolder(); | 93 | var intermediateFolder = fs.GetFolder(); |
97 | 94 | ||
98 | var program = new Program(); | 95 | var result = WixRunner.Execute(new[] |
99 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
100 | { | 96 | { |
101 | "build", | 97 | "build", |
102 | Path.Combine(folder, "Package.wxs"), | 98 | Path.Combine(folder, "Package.wxs"), |
@@ -106,7 +102,7 @@ namespace WixToolsetTest.CoreIntegration | |||
106 | "-bindpath", Path.Combine(folder, "data"), | 102 | "-bindpath", Path.Combine(folder, "data"), |
107 | "-intermediateFolder", intermediateFolder, | 103 | "-intermediateFolder", intermediateFolder, |
108 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 104 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
109 | }); | 105 | }, out var messages); |
110 | 106 | ||
111 | Assert.Equal(0, result); | 107 | Assert.Equal(0, result); |
112 | 108 | ||
@@ -125,8 +121,7 @@ namespace WixToolsetTest.CoreIntegration | |||
125 | { | 121 | { |
126 | var intermediateFolder = fs.GetFolder(); | 122 | var intermediateFolder = fs.GetFolder(); |
127 | 123 | ||
128 | var program = new Program(); | 124 | var result = WixRunner.Execute(new[] |
129 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
130 | { | 125 | { |
131 | "build", | 126 | "build", |
132 | Path.Combine(folder, "Package.wxs"), | 127 | Path.Combine(folder, "Package.wxs"), |
@@ -136,7 +131,7 @@ namespace WixToolsetTest.CoreIntegration | |||
136 | "-bindpath", Path.Combine(folder, "data"), | 131 | "-bindpath", Path.Combine(folder, "data"), |
137 | "-intermediateFolder", intermediateFolder, | 132 | "-intermediateFolder", intermediateFolder, |
138 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 133 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
139 | }); | 134 | }, out var messages); |
140 | 135 | ||
141 | Assert.Equal(0, result); | 136 | Assert.Equal(0, result); |
142 | 137 | ||
@@ -155,8 +150,7 @@ namespace WixToolsetTest.CoreIntegration | |||
155 | { | 150 | { |
156 | var intermediateFolder = fs.GetFolder(); | 151 | var intermediateFolder = fs.GetFolder(); |
157 | 152 | ||
158 | var program = new Program(); | 153 | var result = WixRunner.Execute(new[] |
159 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
160 | { | 154 | { |
161 | "build", | 155 | "build", |
162 | Path.Combine(folder, "Package.wxs"), | 156 | Path.Combine(folder, "Package.wxs"), |
@@ -166,7 +160,7 @@ namespace WixToolsetTest.CoreIntegration | |||
166 | "-bindpath", Path.Combine(folder, "data"), | 160 | "-bindpath", Path.Combine(folder, "data"), |
167 | "-intermediateFolder", intermediateFolder, | 161 | "-intermediateFolder", intermediateFolder, |
168 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 162 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
169 | }); | 163 | }, out var messages); |
170 | 164 | ||
171 | Assert.Equal(0, result); | 165 | Assert.Equal(0, result); |
172 | 166 | ||
@@ -185,8 +179,7 @@ namespace WixToolsetTest.CoreIntegration | |||
185 | { | 179 | { |
186 | var intermediateFolder = fs.GetFolder(); | 180 | var intermediateFolder = fs.GetFolder(); |
187 | 181 | ||
188 | var program = new Program(); | 182 | var result = WixRunner.Execute(new[] |
189 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
190 | { | 183 | { |
191 | "build", | 184 | "build", |
192 | Path.Combine(folder, "Package.wxs"), | 185 | Path.Combine(folder, "Package.wxs"), |
@@ -196,7 +189,7 @@ namespace WixToolsetTest.CoreIntegration | |||
196 | "-bindpath", Path.Combine(folder, "data"), | 189 | "-bindpath", Path.Combine(folder, "data"), |
197 | "-intermediateFolder", intermediateFolder, | 190 | "-intermediateFolder", intermediateFolder, |
198 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 191 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
199 | }); | 192 | }, out var messages); |
200 | 193 | ||
201 | Assert.Equal(0, result); | 194 | Assert.Equal(0, result); |
202 | 195 | ||
@@ -221,8 +214,7 @@ namespace WixToolsetTest.CoreIntegration | |||
221 | { | 214 | { |
222 | var intermediateFolder = fs.GetFolder(); | 215 | var intermediateFolder = fs.GetFolder(); |
223 | 216 | ||
224 | var program = new Program(); | 217 | var result = WixRunner.Execute(new[] |
225 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
226 | { | 218 | { |
227 | "build", | 219 | "build", |
228 | Path.Combine(folder, "Module.wxs"), | 220 | Path.Combine(folder, "Module.wxs"), |
@@ -230,7 +222,7 @@ namespace WixToolsetTest.CoreIntegration | |||
230 | "-bindpath", Path.Combine(folder, "data"), | 222 | "-bindpath", Path.Combine(folder, "data"), |
231 | "-intermediateFolder", intermediateFolder, | 223 | "-intermediateFolder", intermediateFolder, |
232 | "-o", Path.Combine(intermediateFolder, @"bin\test.msm") | 224 | "-o", Path.Combine(intermediateFolder, @"bin\test.msm") |
233 | }); | 225 | }, out var messages); |
234 | 226 | ||
235 | Assert.Equal(0, result); | 227 | Assert.Equal(0, result); |
236 | 228 | ||
@@ -255,8 +247,7 @@ namespace WixToolsetTest.CoreIntegration | |||
255 | { | 247 | { |
256 | var intermediateFolder = fs.GetFolder(); | 248 | var intermediateFolder = fs.GetFolder(); |
257 | 249 | ||
258 | var program = new Program(); | 250 | var result = WixRunner.Execute(new[] |
259 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
260 | { | 251 | { |
261 | "build", | 252 | "build", |
262 | Path.Combine(folder, "Package.wxs"), | 253 | Path.Combine(folder, "Package.wxs"), |
@@ -265,7 +256,7 @@ namespace WixToolsetTest.CoreIntegration | |||
265 | "-bindpath", Path.Combine(folder, "data"), | 256 | "-bindpath", Path.Combine(folder, "data"), |
266 | "-intermediateFolder", intermediateFolder, | 257 | "-intermediateFolder", intermediateFolder, |
267 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 258 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
268 | }); | 259 | }, out var messages); |
269 | 260 | ||
270 | Assert.Equal(0, result); | 261 | Assert.Equal(0, result); |
271 | 262 | ||
@@ -292,8 +283,7 @@ namespace WixToolsetTest.CoreIntegration | |||
292 | var baseFolder = fs.GetFolder(); | 283 | var baseFolder = fs.GetFolder(); |
293 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 284 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
294 | 285 | ||
295 | var program = new Program(); | 286 | var result = WixRunner.Execute(new[] |
296 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
297 | { | 287 | { |
298 | "build", | 288 | "build", |
299 | Path.Combine(folder, "Package.wxs"), | 289 | Path.Combine(folder, "Package.wxs"), |
@@ -302,7 +292,7 @@ namespace WixToolsetTest.CoreIntegration | |||
302 | "-bindpath", Path.Combine(folder, "data"), | 292 | "-bindpath", Path.Combine(folder, "data"), |
303 | "-intermediateFolder", intermediateFolder, | 293 | "-intermediateFolder", intermediateFolder, |
304 | "-o", Path.Combine(baseFolder, @"bin\test.wixipl") | 294 | "-o", Path.Combine(baseFolder, @"bin\test.wixipl") |
305 | }); | 295 | }, out var messages); |
306 | 296 | ||
307 | Assert.Equal(0, result); | 297 | Assert.Equal(0, result); |
308 | 298 | ||
@@ -324,8 +314,7 @@ namespace WixToolsetTest.CoreIntegration | |||
324 | var baseFolder = fs.GetFolder(); | 314 | var baseFolder = fs.GetFolder(); |
325 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 315 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
326 | 316 | ||
327 | var program = new Program(); | 317 | var result = WixRunner.Execute(new[] |
328 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
329 | { | 318 | { |
330 | "build", | 319 | "build", |
331 | Path.Combine(folder, "Package.wxs"), | 320 | Path.Combine(folder, "Package.wxs"), |
@@ -334,7 +323,7 @@ namespace WixToolsetTest.CoreIntegration | |||
334 | "-bindpath", Path.Combine(folder, "data"), | 323 | "-bindpath", Path.Combine(folder, "data"), |
335 | "-intermediateFolder", intermediateFolder, | 324 | "-intermediateFolder", intermediateFolder, |
336 | "-o", Path.Combine(baseFolder, @"bin\test.wixlib") | 325 | "-o", Path.Combine(baseFolder, @"bin\test.wixlib") |
337 | }); | 326 | }, out var messages); |
338 | 327 | ||
339 | Assert.Equal(0, result); | 328 | Assert.Equal(0, result); |
340 | 329 | ||
@@ -357,8 +346,7 @@ namespace WixToolsetTest.CoreIntegration | |||
357 | var baseFolder = fs.GetFolder(); | 346 | var baseFolder = fs.GetFolder(); |
358 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 347 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
359 | 348 | ||
360 | var program = new Program(); | 349 | var result = WixRunner.Execute(new[] |
361 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
362 | { | 350 | { |
363 | "build", | 351 | "build", |
364 | Path.Combine(folder, "Package.wxs"), | 352 | Path.Combine(folder, "Package.wxs"), |
@@ -368,7 +356,7 @@ namespace WixToolsetTest.CoreIntegration | |||
368 | "-intermediateFolder", intermediateFolder, | 356 | "-intermediateFolder", intermediateFolder, |
369 | "-o", Path.Combine(baseFolder, @"bin\test.msi"), | 357 | "-o", Path.Combine(baseFolder, @"bin\test.msi"), |
370 | "-i", bindpath, | 358 | "-i", bindpath, |
371 | }); | 359 | }, out var messages); |
372 | 360 | ||
373 | Assert.Equal(0, result); | 361 | Assert.Equal(0, result); |
374 | 362 | ||
@@ -395,8 +383,7 @@ namespace WixToolsetTest.CoreIntegration | |||
395 | var baseFolder = fs.GetFolder(); | 383 | var baseFolder = fs.GetFolder(); |
396 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 384 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
397 | 385 | ||
398 | var program = new Program(); | 386 | var result = WixRunner.Execute(new[] |
399 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
400 | { | 387 | { |
401 | "build", | 388 | "build", |
402 | Path.Combine(folder, "Package.wxs"), | 389 | Path.Combine(folder, "Package.wxs"), |
@@ -405,7 +392,7 @@ namespace WixToolsetTest.CoreIntegration | |||
405 | "-bindpath", Path.Combine(folder, "data"), | 392 | "-bindpath", Path.Combine(folder, "data"), |
406 | "-intermediateFolder", intermediateFolder, | 393 | "-intermediateFolder", intermediateFolder, |
407 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | 394 | "-o", Path.Combine(baseFolder, @"bin\test.msi") |
408 | }); | 395 | }, out var messages); |
409 | 396 | ||
410 | Assert.Equal(0, result); | 397 | Assert.Equal(0, result); |
411 | 398 | ||
@@ -434,8 +421,7 @@ namespace WixToolsetTest.CoreIntegration | |||
434 | { | 421 | { |
435 | var intermediateFolder = fs.GetFolder(); | 422 | var intermediateFolder = fs.GetFolder(); |
436 | 423 | ||
437 | var program = new Program(); | 424 | var result = WixRunner.Execute(new[] |
438 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
439 | { | 425 | { |
440 | "build", | 426 | "build", |
441 | Path.Combine(folder, "Package.wxs"), | 427 | Path.Combine(folder, "Package.wxs"), |
@@ -444,7 +430,7 @@ namespace WixToolsetTest.CoreIntegration | |||
444 | "-bindpath", Path.Combine(folder, "data"), | 430 | "-bindpath", Path.Combine(folder, "data"), |
445 | "-intermediateFolder", intermediateFolder, | 431 | "-intermediateFolder", intermediateFolder, |
446 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | 432 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") |
447 | }); | 433 | }, out var messages); |
448 | 434 | ||
449 | Assert.Equal(0, result); | 435 | Assert.Equal(0, result); |
450 | 436 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 5f1fb3d3..71e7dd68 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -52,8 +52,11 @@ | |||
52 | </ItemGroup> | 52 | </ItemGroup> |
53 | 53 | ||
54 | <ItemGroup> | 54 | <ItemGroup> |
55 | <ProjectReference Include="..\..\wix\wix.csproj" /> | 55 | <ProjectReference Include="..\..\WixToolset.Core\WixToolset.Core.csproj" /> |
56 | <ProjectReference Include="..\TestData\Example.Extension\Example.Extension.csproj" /> | 56 | <ProjectReference Include="..\..\WixToolset.Core.Burn\WixToolset.Core.Burn.csproj" /> |
57 | <ProjectReference Include="..\..\WixToolset.Core.WindowsInstaller\WixToolset.Core.WindowsInstaller.csproj" /> | ||
58 | <ProjectReference Include="..\..\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj" /> | ||
59 | <ProjectReference Include="..\Example.Extension\Example.Extension.csproj" /> | ||
57 | </ItemGroup> | 60 | </ItemGroup> |
58 | 61 | ||
59 | <ItemGroup> | 62 | <ItemGroup> |
diff --git a/src/test/WixToolsetTest.LightIntegration/LightFixture.cs b/src/test/WixToolsetTest.LightIntegration/LightFixture.cs deleted file mode 100644 index 21c10be9..00000000 --- a/src/test/WixToolsetTest.LightIntegration/LightFixture.cs +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
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.LightIntegration | ||
4 | { | ||
5 | using System.IO; | ||
6 | using System.Linq; | ||
7 | using WixToolset.Core; | ||
8 | using WixToolset.Tools; | ||
9 | using WixToolsetTest.LightIntegration.Utility; | ||
10 | using Xunit; | ||
11 | |||
12 | public class LightFixture | ||
13 | { | ||
14 | [Fact] | ||
15 | public void CanBuildFromWixout() | ||
16 | { | ||
17 | var folder = TestData.Get(@"TestData\Wixout"); | ||
18 | |||
19 | using (var fs = new DisposableFileSystem()) | ||
20 | { | ||
21 | var baseFolder = fs.GetFolder(); | ||
22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
23 | |||
24 | var program = new Light(); | ||
25 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
26 | { | ||
27 | Path.Combine(folder, "test.wixout"), | ||
28 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
29 | "-b", Path.Combine(folder, "data"), | ||
30 | "-intermediateFolder", intermediateFolder, | ||
31 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
32 | }); | ||
33 | |||
34 | Assert.Equal(0, result); | ||
35 | |||
36 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
37 | var builtFiles = Directory.GetFiles(binFolder, "*", SearchOption.AllDirectories); | ||
38 | |||
39 | Assert.Equal(new[]{ | ||
40 | "MsiPackage\\test.txt", | ||
41 | "test.msi", | ||
42 | "test.wir", | ||
43 | "test.wixpdb", | ||
44 | }, builtFiles.Select(f => f.Substring(binFolder.Length)).OrderBy(s => s).ToArray()); | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | } | ||
diff --git a/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/Package.en-us.wxl b/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/Package.en-us.wxl +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
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.LightIntegration/TestData/Wixout/data/test.txt b/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/data/test.txt +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | This is test.txt. \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/test.wixout b/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/test.wixout deleted file mode 100644 index 009b625f..00000000 --- a/src/test/WixToolsetTest.LightIntegration/TestData/Wixout/test.wixout +++ /dev/null | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.LightIntegration/Utility/DisposableFileSystem.cs b/src/test/WixToolsetTest.LightIntegration/Utility/DisposableFileSystem.cs deleted file mode 100644 index 3b8c0e19..00000000 --- a/src/test/WixToolsetTest.LightIntegration/Utility/DisposableFileSystem.cs +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
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.LightIntegration.Utility | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using System.IO; | ||
8 | |||
9 | public class DisposableFileSystem : IDisposable | ||
10 | { | ||
11 | protected bool Disposed { get; private set; } | ||
12 | |||
13 | private List<string> CleanupPaths { get; } = new List<string>(); | ||
14 | |||
15 | protected string GetFile(bool create = false) | ||
16 | { | ||
17 | var path = Path.GetTempFileName(); | ||
18 | |||
19 | if (!create) | ||
20 | { | ||
21 | File.Delete(path); | ||
22 | } | ||
23 | |||
24 | this.CleanupPaths.Add(path); | ||
25 | |||
26 | return path; | ||
27 | } | ||
28 | |||
29 | public string GetFolder(bool create = false) | ||
30 | { | ||
31 | var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | ||
32 | |||
33 | if (create) | ||
34 | { | ||
35 | Directory.CreateDirectory(path); | ||
36 | } | ||
37 | |||
38 | this.CleanupPaths.Add(path); | ||
39 | |||
40 | return path; | ||
41 | } | ||
42 | |||
43 | |||
44 | #region // IDisposable | ||
45 | |||
46 | public void Dispose() | ||
47 | { | ||
48 | this.Dispose(true); | ||
49 | GC.SuppressFinalize(this); | ||
50 | } | ||
51 | |||
52 | protected virtual void Dispose(bool disposing) | ||
53 | { | ||
54 | if (this.Disposed) | ||
55 | { | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | if (disposing) | ||
60 | { | ||
61 | foreach (var path in this.CleanupPaths) | ||
62 | { | ||
63 | try | ||
64 | { | ||
65 | if (File.Exists(path)) | ||
66 | { | ||
67 | File.Delete(path); | ||
68 | } | ||
69 | else if (Directory.Exists(path)) | ||
70 | { | ||
71 | Directory.Delete(path, true); | ||
72 | } | ||
73 | } | ||
74 | catch | ||
75 | { | ||
76 | // Best effort delete, so ignore any failures. | ||
77 | } | ||
78 | } | ||
79 | } | ||
80 | |||
81 | this.Disposed = true; | ||
82 | } | ||
83 | |||
84 | #endregion | ||
85 | } | ||
86 | } | ||
diff --git a/src/test/WixToolsetTest.LightIntegration/Utility/TestData.cs b/src/test/WixToolsetTest.LightIntegration/Utility/TestData.cs deleted file mode 100644 index c13e9d6d..00000000 --- a/src/test/WixToolsetTest.LightIntegration/Utility/TestData.cs +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
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.LightIntegration.Utility | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | |||
8 | public class TestData | ||
9 | { | ||
10 | public static string LocalPath => Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath); | ||
11 | |||
12 | public static string Get(params string[] paths) | ||
13 | { | ||
14 | return Path.Combine(LocalPath, Path.Combine(paths)); | ||
15 | } | ||
16 | } | ||
17 | } | ||
diff --git a/src/test/WixToolsetTest.LightIntegration/WixToolsetTest.LightIntegration.csproj b/src/test/WixToolsetTest.LightIntegration/WixToolsetTest.LightIntegration.csproj deleted file mode 100644 index 59068682..00000000 --- a/src/test/WixToolsetTest.LightIntegration/WixToolsetTest.LightIntegration.csproj +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
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\Wixout\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
13 | <Content Include="TestData\Wixout\Package.en-us.wxl"> | ||
14 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
15 | </Content> | ||
16 | <Content Include="TestData\Wixout\test.wixout"> | ||
17 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
18 | </Content> | ||
19 | </ItemGroup> | ||
20 | |||
21 | <ItemGroup> | ||
22 | <ProjectReference Include="..\..\light\light.csproj" /> | ||
23 | </ItemGroup> | ||
24 | |||
25 | <ItemGroup> | ||
26 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" /> | ||
27 | <PackageReference Include="xunit" Version="2.3.1" /> | ||
28 | <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | ||
29 | </ItemGroup> | ||
30 | </Project> | ||