Provide x86 and x64 versions of net461 build tasks.
Sean Hall committed
May 30, 2020 at 23:01 UTC
ba0069bf9572d26a9deac77bac3613bc2f96e01a
13 files changed
+239
-12
appveyor.cmd
+2
-1
@@ -12,7 +12,8 @@ dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix
12
@rem dotnet publish -c %_C% -o %_P%\netfx-heat\ -f net461 src\heat
13
@rem dotnet publish -c %_C% -o %_P%\netfx-wix\ -f net461 src\wix
14
@rem dotnet publish -c %_C% -o %_P%\netfx-wixcop\ -f net461 src\wixcop
15
-dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\ -f net461 src\WixToolset.BuildTasks
15
+dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\WixToolset.BuildTasks
16
+dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\WixToolset.BuildTasks
17
dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks
18
dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild
19
src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj
+1
@@ -9,6 +9,7 @@
9
<DebugType>embedded</DebugType>
10
<PublishRepositoryUrl>true</PublishRepositoryUrl>
11
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)'=='' and '$(TargetFramework)'!='netcoreapp2.1' ">win-x86</RuntimeIdentifier>
12
+ <!-- https://github.com/Microsoft/msbuild/issues/2360 -->
13
<PlatformTarget>AnyCPU</PlatformTarget>
14
</PropertyGroup>
15
src/WixToolset.MSBuild/tools/wix.targets
+32
-8
@@ -20,8 +20,13 @@
20
<!-- These properties can be overridden to support non-default installations. -->
21
<PropertyGroup>
22
<WixBinDir Condition=" '$(WixBinDir)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">$(MSBuildThisFileDirectory)netcoreapp2.1\</WixBinDir>
23
- <WixBinDir Condition=" '$(WixBinDir)' == '' ">$(MSBuildThisFileDirectory)net461\</WixBinDir>
23
+ <WixBinDir Condition=" '$(WixBinDir)' == '' ">$(MSBuildThisFileDirectory)net461\x86\</WixBinDir>
24
+ <WixBinDir64 Condition=" '$(WixBinDir64)' == '' and '$(MSBuildRuntimeType)' != 'Core' ">$(MSBuildThisFileDirectory)net461\x64\</WixBinDir64>
25
<WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(WixBinDir)WixToolset.BuildTasks.dll</WixTasksPath>
26
+ <WixTasksPath64 Condition=" '$(WixTasksPath64)' == '' and '$(WixBinDir64)' != '' ">$(WixBinDir64)WixToolset.BuildTasks.dll</WixTasksPath64>
27
+ </PropertyGroup>
28
+
29
+ <PropertyGroup>
30
<WixHarvestTargetsPath Condition=" '$(WixHarvestTargetsPath)' == '' ">$(MSBuildThisFileDirectory)wix.harvest.targets</WixHarvestTargetsPath>
31
<WixSigningTargetsPath Condition=" '$(WixSigningTargetsPath)' == '' ">$(MSBuildThisFileDirectory)wix.signing.targets</WixSigningTargetsPath>
32
</PropertyGroup>
@@ -99,15 +104,34 @@
104
-->
105
106
<!-- These tasks can be used as general-purpose build tasks. -->
102
- <UsingTask TaskName="WixBuild" AssemblyFile="$(WixTasksPath)" />
107
+ <UsingTask TaskName="WixBuild" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
108
+ <UsingTask TaskName="WixBuild" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
109
+ <UsingTask TaskName="WixBuild" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
110
111
<!-- These tasks are specific to the build process defined in this file, and are not considered general-purpose build tasks. -->
105
- <UsingTask TaskName="CreateItemAvoidingInference" AssemblyFile="$(WixTasksPath)" />
106
- <UsingTask TaskName="CreateProjectReferenceDefineConstants" AssemblyFile="$(WixTasksPath)" />
107
- <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" />
108
- <UsingTask TaskName="ResolveWixReferences" AssemblyFile="$(WixTasksPath)"/>
109
- <UsingTask TaskName="ReplaceString" AssemblyFile="$(WixTasksPath)"/>
110
- <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/>
112
+ <UsingTask TaskName="CreateItemAvoidingInference" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
113
+ <UsingTask TaskName="CreateItemAvoidingInference" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
114
+ <UsingTask TaskName="CreateItemAvoidingInference" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
115
+
116
+ <UsingTask TaskName="CreateProjectReferenceDefineConstants" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
117
+ <UsingTask TaskName="CreateProjectReferenceDefineConstants" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
118
+ <UsingTask TaskName="CreateProjectReferenceDefineConstants" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
119
+
120
+ <UsingTask TaskName="WixAssignCulture" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
121
+ <UsingTask TaskName="WixAssignCulture" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
122
+ <UsingTask TaskName="WixAssignCulture" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
123
+
124
+ <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
125
+ <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
126
+ <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
127
+
128
+ <UsingTask TaskName="ReplaceString" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
129
+ <UsingTask TaskName="ReplaceString" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
130
+ <UsingTask TaskName="ReplaceString" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
131
+
132
+ <UsingTask TaskName="GenerateCompileWithObjectPath" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
133
+ <UsingTask TaskName="GenerateCompileWithObjectPath" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
134
+ <UsingTask TaskName="GenerateCompileWithObjectPath" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
135
136
<PropertyGroup>
137
<BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile>
src/heat/heat.csproj
-1
@@ -11,7 +11,6 @@
11
<PublishRepositoryUrl>true</PublishRepositoryUrl>
12
<!-- <PackAsTool>true</PackAsTool> -->
13
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)'=='' and '$(TargetFramework)'!='netcoreapp2.1' ">win-x86</RuntimeIdentifier>
14
- <PlatformTarget>AnyCPU</PlatformTarget>
14
<AppConfig>app.config</AppConfig>
15
<ApplicationManifest>heat.exe.manifest</ApplicationManifest>
16
</PropertyGroup>
src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs
+68
@@ -46,6 +46,41 @@ namespace WixToolsetTest.MSBuild
46
}
47
}
48
49
+ [Theory]
50
+ [InlineData(BuildSystem.MSBuild)]
51
+ [InlineData(BuildSystem.MSBuild64)]
52
+ public void CanBuildSimpleMergeModule(BuildSystem buildSystem)
53
+ {
54
+ var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule");
55
+
56
+ using (var fs = new TestDataFolderFileSystem())
57
+ {
58
+ fs.Initialize(sourceFolder);
59
+ var baseFolder = fs.BaseFolder;
60
+ var binFolder = Path.Combine(baseFolder, @"bin\");
61
+ var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj");
62
+
63
+ var result = MsbuildUtilities.BuildProject(buildSystem, projectPath);
64
+ result.AssertSuccess();
65
+
66
+ var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86"));
67
+ Assert.Single(platformSwitches);
68
+
69
+ var warnings = result.Output.Where(line => line.Contains(": warning"));
70
+ Assert.Empty(warnings);
71
+
72
+ var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
73
+ .Select(s => s.Substring(baseFolder.Length + 1))
74
+ .OrderBy(s => s)
75
+ .ToArray();
76
+ Assert.Equal(new[]
77
+ {
78
+ @"bin\x86\Debug\SimpleMergeModule.msm",
79
+ @"bin\x86\Debug\SimpleMergeModule.wixpdb",
80
+ }, paths);
81
+ }
82
+ }
83
+
84
[Theory]
85
[InlineData(BuildSystem.MSBuild)]
86
[InlineData(BuildSystem.MSBuild64)]
@@ -82,6 +117,39 @@ namespace WixToolsetTest.MSBuild
117
}
118
}
119
120
+ [Theory]
121
+ [InlineData(BuildSystem.MSBuild)]
122
+ [InlineData(BuildSystem.MSBuild64)]
123
+ public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem)
124
+ {
125
+ var sourceFolder = TestData.Get(@"TestData\MergeModule");
126
+
127
+ using (var fs = new TestDataFolderFileSystem())
128
+ {
129
+ fs.Initialize(sourceFolder);
130
+ var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage");
131
+ var binFolder = Path.Combine(baseFolder, @"bin\");
132
+ var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj");
133
+
134
+ var result = MsbuildUtilities.BuildProject(buildSystem, projectPath);
135
+ result.AssertSuccess();
136
+
137
+ var warnings = result.Output.Where(line => line.Contains(": warning"));
138
+ Assert.Empty(warnings);
139
+
140
+ var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
141
+ .Select(s => s.Substring(baseFolder.Length + 1))
142
+ .OrderBy(s => s)
143
+ .ToArray();
144
+ Assert.Equal(new[]
145
+ {
146
+ @"bin\x86\Debug\cab1.cab",
147
+ @"bin\x86\Debug\MergeMsiPackage.msi",
148
+ @"bin\x86\Debug\MergeMsiPackage.wixpdb",
149
+ }, paths);
150
+ }
151
+ }
152
+
153
[Theory]
154
[InlineData(BuildSystem.MSBuild)]
155
[InlineData(BuildSystem.MSBuild64)]
src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj
new
+44
@@ -0,0 +1,44 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="$(WixMSBuildProps)" />
4
+ <PropertyGroup>
5
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7
+ </PropertyGroup>
8
+
9
+ <PropertyGroup>
10
+ <ProjectGuid>{B00939D5-7952-4ADF-BEB1-507D227B2FE2}</ProjectGuid>
11
+ </PropertyGroup>
12
+
13
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
14
+ <PlatformName>$(Platform)</PlatformName>
15
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
16
+ <DefineConstants>Debug</DefineConstants>
17
+ </PropertyGroup>
18
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
19
+ <PlatformName>$(Platform)</PlatformName>
20
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
21
+ </PropertyGroup>
22
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
23
+ <PlatformName>$(Platform)</PlatformName>
24
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
25
+ <DefineConstants>Debug</DefineConstants>
26
+ </PropertyGroup>
27
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
28
+ <PlatformName>$(Platform)</PlatformName>
29
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
30
+ </PropertyGroup>
31
+
32
+ <ItemGroup>
33
+ <Compile Include="Package.wxs" />
34
+ </ItemGroup>
35
+
36
+ <ItemGroup>
37
+ <ProjectReference Include="..\SimpleMergeModule\SimpleMergeModule.wixproj">
38
+ <Name>SimpleMergeModule</Name>
39
+ <Project>{9F84998B-7F45-4CB3-8795-915801DBBB74}</Project>
40
+ </ProjectReference>
41
+ </ItemGroup>
42
+
43
+ <Import Project="$(WixTargetsPath)" />
44
+</Project>
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs
new
+22
@@ -0,0 +1,22 @@
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
+ <MediaTemplate />
7
+
8
+ <Feature Id="ProductFeature" Title="ATitle">
9
+ <MergeRef Id="SimpleMM" />
10
+ </Feature>
11
+ </Product>
12
+
13
+ <Fragment>
14
+ <Directory Id="TARGETDIR" Name="SourceDir">
15
+ <Directory Id="ProgramFilesFolder">
16
+ <Directory Id="INSTALLFOLDER" Name="MsiPackage">
17
+ <Merge Id="SimpleMM" Language="1033" SourceFile="$(var.SimpleMergeModule.TargetPath)" DiskId="1" />
18
+ </Directory>
19
+ </Directory>
20
+ </Directory>
21
+ </Fragment>
22
+</Wix>
src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs
new
+22
@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Module Id="SimpleMM" Language="1033" Version="1.0.0.0">
4
+ <Package Id="86FB9E91-ACF3-4EDF-B711-72DAF2443692" InstallerVersion="200" Manufacturer="Example Corporation" />
5
+
6
+ <ComponentGroupRef Id="ProductComponents" />
7
+ </Module>
8
+
9
+ <Fragment>
10
+ <Directory Id="TARGETDIR" Name="SourceDir">
11
+ <Directory Id="MergeRedirectFolder" />
12
+ </Directory>
13
+ </Fragment>
14
+
15
+ <Fragment>
16
+ <ComponentGroup Id="ProductComponents" Directory="MergeRedirectFolder">
17
+ <Component Id="MMtxt" Guid="2D93B748-4926-4185-BC84-9F1D6883AF20">
18
+ <File Source="MergeModule.txt" />
19
+ </Component>
20
+ </ComponentGroup>
21
+ </Fragment>
22
+</Wix>
src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj
new
+42
@@ -0,0 +1,42 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="$(WixMSBuildProps)" />
4
+ <PropertyGroup>
5
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7
+ <OutputType>Module</OutputType>
8
+ </PropertyGroup>
9
+
10
+ <PropertyGroup>
11
+ <ProjectGuid>{9F84998B-7F45-4CB3-8795-915801DBBB74}</ProjectGuid>
12
+ </PropertyGroup>
13
+
14
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
15
+ <PlatformName>$(Platform)</PlatformName>
16
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
17
+ <DefineConstants>Debug</DefineConstants>
18
+ </PropertyGroup>
19
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
20
+ <PlatformName>$(Platform)</PlatformName>
21
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
22
+ </PropertyGroup>
23
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
24
+ <PlatformName>$(Platform)</PlatformName>
25
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
26
+ <DefineConstants>Debug</DefineConstants>
27
+ </PropertyGroup>
28
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
29
+ <PlatformName>$(Platform)</PlatformName>
30
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
31
+ </PropertyGroup>
32
+
33
+ <ItemGroup>
34
+ <Compile Include="MergeModule.wxs" />
35
+ </ItemGroup>
36
+
37
+ <ItemGroup>
38
+ <BindInputPaths Include="data" />
39
+ </ItemGroup>
40
+
41
+ <Import Project="$(WixTargetsPath)" />
42
+</Project>
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt
new
+1
@@ -0,0 +1 @@
1
+This is test.txt.
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj
+5
@@ -15,6 +15,11 @@
15
<Content Include="TestData\HeatFileMultipleFilesSameFileName\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
16
<Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.txt" CopyToOutputDirectory="PreserveNewest" />
17
<Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.json" CopyToOutputDirectory="PreserveNewest" />
18
+ <Content Include="TestData\MergeModule\MergeMsiPackage\MergeMsiPackage.wixproj" CopyToOutputDirectory="PreserveNewest" />
19
+ <Content Include="TestData\MergeModule\MergeMsiPackage\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
20
+ <Content Include="TestData\MergeModule\SimpleMergeModule\data\MergeModule.txt" CopyToOutputDirectory="PreserveNewest" />
21
+ <Content Include="TestData\MergeModule\SimpleMergeModule\MergeModule.wxs" CopyToOutputDirectory="PreserveNewest" />
22
+ <Content Include="TestData\MergeModule\SimpleMergeModule\SimpleMergeModule.wixproj" CopyToOutputDirectory="PreserveNewest" />
23
<Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\MsiPackage.wixproj" CopyToOutputDirectory="PreserveNewest" />
24
<Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.de-de.wxl" CopyToOutputDirectory="PreserveNewest" />
25
<Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
src/wix/wix.csproj
-1
@@ -11,7 +11,6 @@
11
<PublishRepositoryUrl>true</PublishRepositoryUrl>
12
<!-- <PackAsTool>true</PackAsTool> -->
13
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)'=='' and '$(TargetFramework)'!='netcoreapp2.1' ">win-x86</RuntimeIdentifier>
14
- <PlatformTarget>AnyCPU</PlatformTarget>
14
<AppConfig>app.config</AppConfig>
15
<ApplicationManifest>wix.exe.manifest</ApplicationManifest>
16
</PropertyGroup>
src/wixcop/WixCop.csproj
-1
@@ -11,7 +11,6 @@
11
<PublishRepositoryUrl>true</PublishRepositoryUrl>
12
<!-- <PackAsTool>true</PackAsTool> -->
13
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)'=='' and '$(TargetFramework)'!='netcoreapp2.1' ">win-x86</RuntimeIdentifier>
14
- <PlatformTarget>AnyCPU</PlatformTarget>
14
<AppConfig>app.config</AppConfig>
15
<ApplicationManifest>wixcop.exe.manifest</ApplicationManifest>
16
</PropertyGroup>