aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.MSBuild
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-05-28 23:00:05 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-05-28 23:10:12 +1000
commitef0dbdc18c4335fef395fb954845031ea90503be (patch)
tree1d9bec91f1fbef5b24cdfdb45a05ef2ee5e6caee /src/WixToolset.MSBuild
parent551f2a43de0465202e3a3aca24379481cc35733e (diff)
downloadwix-ef0dbdc18c4335fef395fb954845031ea90503be.tar.gz
wix-ef0dbdc18c4335fef395fb954845031ea90503be.tar.bz2
wix-ef0dbdc18c4335fef395fb954845031ea90503be.zip
Move the targets files into the top-level tools folder.
Diffstat (limited to 'src/WixToolset.MSBuild')
-rw-r--r--src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec4
-rw-r--r--src/WixToolset.MSBuild/WixToolset.MSBuild.props3
-rw-r--r--src/WixToolset.MSBuild/wix.ca.targets123
-rw-r--r--src/WixToolset.MSBuild/wix.harvest.targets499
-rw-r--r--src/WixToolset.MSBuild/wix.signing.targets370
-rw-r--r--src/WixToolset.MSBuild/wix.targets1060
6 files changed, 2057 insertions, 2 deletions
diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec
index c9e5cdf2..00cf440b 100644
--- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec
+++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec
@@ -12,6 +12,10 @@
12 12
13 <files> 13 <files>
14 <file src="$projectFolder$$id$.props" target="build" /> 14 <file src="$projectFolder$$id$.props" target="build" />
15 <file src="$projectFolder$wix.ca.targets" target="tools" />
16 <file src="$projectFolder$wix.harvest.targets" target="tools" />
17 <file src="$projectFolder$wix.signing.targets" target="tools" />
18 <file src="$projectFolder$wix.targets" target="tools" />
15 <file src="net461\*" target="tools\net461" /> 19 <file src="net461\*" target="tools\net461" />
16 <file src="netcoreapp2.1\*" target="tools\netcoreapp2.1" /> 20 <file src="netcoreapp2.1\*" target="tools\netcoreapp2.1" />
17 </files> 21 </files>
diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props
index b1d207f4..b453361b 100644
--- a/src/WixToolset.MSBuild/WixToolset.MSBuild.props
+++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.props
@@ -3,7 +3,6 @@
3 3
4<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> 4<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5 <PropertyGroup> 5 <PropertyGroup>
6 <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\wix.targets'))</WixTargetsPath> 6 <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets'))</WixTargetsPath>
7 <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\net461\wix.targets'))</WixTargetsPath>
8 </PropertyGroup> 7 </PropertyGroup>
9</Project> 8</Project>
diff --git a/src/WixToolset.MSBuild/wix.ca.targets b/src/WixToolset.MSBuild/wix.ca.targets
new file mode 100644
index 00000000..4578c2d8
--- /dev/null
+++ b/src/WixToolset.MSBuild/wix.ca.targets
@@ -0,0 +1,123 @@
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
5<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6
7 <Import Project="$(CustomBeforeWixCATargets)" Condition=" '$(CustomBeforeWixCATargets)' != '' and Exists('$(CustomBeforeWixCATargets)')" />
8
9 <PropertyGroup>
10 <WixCATargetsImported>true</WixCATargetsImported>
11
12 <TargetCAFileName Condition=" '$(TargetCAFileName)' == '' ">$(TargetName).CA$(TargetExt)</TargetCAFileName>
13
14 <WixSdkPath Condition=" '$(WixSdkPath)' == '' ">$(MSBuildThisFileDirectory)</WixSdkPath>
15 <WixSdkX86Path Condition=" '$(WixSdkX86Path)' == '' ">$(WixSdkPath)x86\</WixSdkX86Path>
16 <WixSdkX64Path Condition=" '$(WixSdkX64Path)' == '' ">$(WixSdkPath)x64\</WixSdkX64Path>
17
18 <MakeSfxCA Condition=" '$(MakeSfxCA)' == '' ">$(WixSdkPath)MakeSfxCA.exe</MakeSfxCA>
19 <SfxCADll Condition=" '$(SfxCADll)' == '' and '$(Platform)' == 'x64' ">$(WixSdkX64Path)SfxCA.dll</SfxCADll>
20 <SfxCADll Condition=" '$(SfxCADll)' == '' ">$(WixSdkX86Path)SfxCA.dll</SfxCADll>
21 </PropertyGroup>
22
23 <!--
24 ==================================================================================================
25 PackCustomAction
26
27 Creates an MSI managed custom action package that includes the custom action assembly,
28 local assembly dependencies, and project content files.
29
30 [IN]
31 @(IntermediateAssembly) - Managed custom action assembly.
32 @(Content) - Project items of type Content will be included in the package.
33 $(CustomActionContents) - Optional space-delimited list of additional files to include.
34
35 [OUT]
36 $(IntermediateOutputPath)$(TargetCAFileName) - Managed custom action package with unmanaged stub.
37 ==================================================================================================
38 -->
39 <Target Name="PackCustomAction"
40 Inputs="@(IntermediateAssembly);@(Content);$(CustomActionContents)"
41 Outputs="$(IntermediateOutputPath)$(TargetCAFileName)">
42
43 <!-- Find all referenced items marked CopyLocal, but exclude non-binary files. -->
44 <ItemGroup>
45 <CustomActionReferenceContents Include="@(ReferenceCopyLocalPaths)"
46 Condition=" '%(Extension)' == '.dll' or '%(Extension)' == '.exe' " />
47 <CustomActionReferenceContents Include="@(ReferenceComWrappersToCopyLocal)"
48 Condition=" '%(Extension)' == '.dll' or '%(Extension)' == '.exe' " />
49
50 <!-- include PDBs for Debug only -->
51 <CustomActionReferenceContents Include="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).pdb')"
52 Condition=" Exists('%(RootDir)%(Directory)%(Filename).pdb') and '$(Configuration)' == 'Debug' " />
53 <CustomActionReferenceContents Include="@(ReferenceCopyLocalPaths)"
54 Condition=" '%(Extension)' == '.pdb' and '$(Configuration)' == 'Debug' " />
55 <CustomActionReferenceContents Include="@(ReferenceComWrappersToCopyLocal)"
56 Condition=" '%(Extension)' == '.pdb' and '$(Configuration)' == 'Debug' " />
57 </ItemGroup>
58
59 <!--
60 Items to include in the CA package:
61 - Reference assemblies marked CopyLocal
62 - Project items of type Content
63 - Additional items in the CustomActionContents property
64 -->
65 <PropertyGroup>
66 <CustomActionContents>@(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents)</CustomActionContents>
67 </PropertyGroup>
68
69 <ItemGroup>
70 <IntermediateCAAssembly Include="@(IntermediateAssembly->'%(FullPath)')" />
71 <IntermediateCAPackage Include="@(IntermediateAssembly->'%(RootDir)%(Directory)$(TargetCAFileName)')" />
72 </ItemGroup>
73
74 <!-- Run the MakeSfxCA.exe CA packaging tool. -->
75 <Exec Command='"$(MakeSfxCA)" "@(IntermediateCAPackage)" "$(SfxCADll)" "@(IntermediateCAAssembly)" "$(CustomActionContents)"'
76 WorkingDirectory="$(ProjectDir)" />
77
78 <!-- Add modules to be copied to output dir. -->
79 <ItemGroup>
80 <AddModules Include="@(IntermediateCAPackage)" />
81 </ItemGroup>
82 </Target>
83
84 <!--
85 ==================================================================================================
86 CleanCustomAction
87
88 Cleans the .CA.dll binary created by the PackCustomAction target.
89
90 ==================================================================================================
91 -->
92 <Target Name="CleanCustomAction">
93 <Delete Files="$(IntermediateOutputPath)$(TargetCAFileName)"
94 TreatErrorsAsWarnings="true" />
95 </Target>
96
97 <!--
98 ==================================================================================================
99 AfterCompile (redefinition)
100
101 Calls the PackCustomAction target after compiling.
102 Overrides the empty AfterCompile target from Microsoft.Common.targets.
103
104 ==================================================================================================
105 -->
106 <Target Name="AfterCompile"
107 DependsOnTargets="PackCustomAction" />
108
109 <!--
110 ==================================================================================================
111 BeforeClean (redefinition)
112
113 Calls the CleanCustomAction target before cleaning.
114 Overrides the empty AfterCompile target from Microsoft.Common.targets.
115
116 ==================================================================================================
117 -->
118 <Target Name="BeforeClean"
119 DependsOnTargets="CleanCustomAction" />
120
121 <Import Project="$(CustomAfterWixCATargets)" Condition=" '$(CustomAfterWixCATargets)' != '' and Exists('$(CustomAfterWixCATargets)')" />
122
123</Project>
diff --git a/src/WixToolset.MSBuild/wix.harvest.targets b/src/WixToolset.MSBuild/wix.harvest.targets
new file mode 100644
index 00000000..e4d866ea
--- /dev/null
+++ b/src/WixToolset.MSBuild/wix.harvest.targets
@@ -0,0 +1,499 @@
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
5<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6
7 <!-- These tasks are extensions for harvesting WiX source code from other sources. -->
8 <UsingTask TaskName="HeatFile" AssemblyFile="$(WixTasksPath)" />
9 <UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixTasksPath)" />
10 <UsingTask TaskName="HeatProject" AssemblyFile="$(WixTasksPath)" />
11
12 <UsingTask TaskName="RefreshGeneratedFile" AssemblyFile="$(WixTasksPath)"/>
13 <UsingTask TaskName="RefreshBundleGeneratedFile" AssemblyFile="$(WixTasksPath)"/>
14
15 <!-- Default Harvester properties-->
16 <PropertyGroup>
17 <HarvestNoLogo Condition=" '$(HarvestNoLogo)' == '' ">$(NoLogo)</HarvestNoLogo>
18 <HarvestSuppressAllWarnings Condition=" '$(HarvestSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</HarvestSuppressAllWarnings>
19 <HarvestSuppressSpecificWarnings Condition=" '$(HarvestSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</HarvestSuppressSpecificWarnings>
20 <HarvestTreatWarningsAsErrors Condition=" '$(HarvestTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</HarvestTreatWarningsAsErrors>
21 <HarvestTreatSpecificWarningsAsErrors Condition=" '$(HarvestTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</HarvestTreatSpecificWarningsAsErrors>
22 <HarvestVerboseOutput Condition=" '$(HarvestVerboseOutput)' == '' ">$(VerboseOutput)</HarvestVerboseOutput>
23 <HarvestAutogenerateGuids Condition=" '$(HarvestAutogenerateGuids)' == '' ">true</HarvestAutogenerateGuids>
24 <HarvestGenerateGuidsNow Condition=" '$(HarvestGenerateGuidsNow)' == '' ">false</HarvestGenerateGuidsNow>
25 <HarvestSuppressFragments Condition=" '$(HarvestSuppressFragments)' == '' ">true</HarvestSuppressFragments>
26 <HarvestSuppressUniqueIds Condition=" '$(HarvestSuppressUniqueIds)' == '' ">false</HarvestSuppressUniqueIds>
27 </PropertyGroup>
28
29 <!-- Default HarvestProjects properties -->
30 <PropertyGroup>
31 <!-- Project harvesting is defaulted to off until it works more consistently. -->
32 <EnableProjectHarvesting Condition=" '$(EnableProjectHarvesting)'=='' ">false</EnableProjectHarvesting>
33
34 <HarvestProjectsNoLogo Condition=" '$(HarvestProjectsNoLogo)' == '' ">$(HarvestNoLogo)</HarvestProjectsNoLogo>
35 <HarvestProjectsSuppressAllWarnings Condition=" '$(HarvestProjectsSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestProjectsSuppressAllWarnings>
36 <HarvestProjectsSuppressSpecificWarnings Condition=" '$(HarvestProjectsSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestProjectsSuppressSpecificWarnings>
37 <HarvestProjectsTreatWarningsAsErrors Condition=" '$(HarvestProjectsTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestProjectsTreatWarningsAsErrors>
38 <HarvestProjectsTreatSpecificWarningsAsErrors Condition=" '$(HarvestProjectsTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestProjectsTreatSpecificWarningsAsErrors>
39 <HarvestProjectsVerboseOutput Condition=" '$(HarvestProjectsVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestProjectsVerboseOutput>
40 <HarvestProjectsAutogenerateGuids Condition=" '$(HarvestProjectsAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestProjectsAutogenerateGuids>
41 <HarvestProjectsGenerateGuidsNow Condition=" '$(HarvestProjectsGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestProjectsGenerateGuidsNow>
42 <HarvestProjectsSuppressFragments Condition=" '$(HarvestProjectsSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestProjectsSuppressFragments>
43 <HarvestProjectsSuppressUniqueIds Condition=" '$(HarvestProjectsSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestProjectsSuppressUniqueIds>
44 <HarvestProjectsTransforms Condition=" '$(HarvestProjectsTransforms)' == '' ">$(HarvestTransforms)</HarvestProjectsTransforms>
45 <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' != 'Bundle' ">$(IntermediateOutputPath)Product.Generated.wxs</HarvestProjectsGeneratedFile>
46 <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' == 'Bundle' ">$(IntermediateOutputPath)Bundle.Generated.wxs</HarvestProjectsGeneratedFile>
47 </PropertyGroup>
48
49 <!-- Default HarvestDirectory properties -->
50 <PropertyGroup>
51 <HarvestDirectoryNoLogo Condition=" '$(HarvestDirectoryNoLogo)' == '' ">$(HarvestNoLogo)</HarvestDirectoryNoLogo>
52 <HarvestDirectorySuppressAllWarnings Condition=" '$(HarvestDirectorySuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestDirectorySuppressAllWarnings>
53 <HarvestDirectorySuppressSpecificWarnings Condition=" '$(HarvestDirectorySuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestDirectorySuppressSpecificWarnings>
54 <HarvestDirectoryTreatWarningsAsErrors Condition=" '$(HarvestDirectoryTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestDirectoryTreatWarningsAsErrors>
55 <HarvestDirectoryTreatSpecificWarningsAsErrors Condition=" '$(HarvestDirectoryTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestDirectoryTreatSpecificWarningsAsErrors>
56 <HarvestDirectoryVerboseOutput Condition=" '$(HarvestDirectoryVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestDirectoryVerboseOutput>
57 <HarvestDirectoryAutogenerateGuids Condition=" '$(HarvestDirectoryAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestDirectoryAutogenerateGuids>
58 <HarvestDirectoryGenerateGuidsNow Condition=" '$(HarvestDirectoryGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestDirectoryGenerateGuidsNow>
59 <HarvestDirectorySuppressFragments Condition=" '$(HarvestDirectorySuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestDirectorySuppressFragments>
60 <HarvestDirectorySuppressUniqueIds Condition=" '$(HarvestDirectorySuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestDirectorySuppressUniqueIds>
61 <HarvestDirectoryTransforms Condition=" '$(HarvestDirectoryTransforms)' == '' ">$(HarvestTransforms)</HarvestDirectoryTransforms>
62 </PropertyGroup>
63
64 <!-- Default HarvestFile properties -->
65 <PropertyGroup>
66 <HarvestFileNoLogo Condition=" '$(HarvestFileNoLogo)' == '' ">$(HarvestNoLogo)</HarvestFileNoLogo>
67 <HarvestFileSuppressAllWarnings Condition=" '$(HarvestFileSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestFileSuppressAllWarnings>
68 <HarvestFileSuppressSpecificWarnings Condition=" '$(HarvestFileSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestFileSuppressSpecificWarnings>
69 <HarvestFileTreatWarningsAsErrors Condition=" '$(HarvestFileTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestFileTreatWarningsAsErrors>
70 <HarvestFileTreatSpecificWarningsAsErrors Condition=" '$(HarvestFileTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestFileTreatSpecificWarningsAsErrors>
71 <HarvestFileVerboseOutput Condition=" '$(HarvestFileVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestFileVerboseOutput>
72 <HarvestFileAutogenerateGuids Condition=" '$(HarvestFileAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestFileAutogenerateGuids>
73 <HarvestFileGenerateGuidsNow Condition=" '$(HarvestFileGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestFileGenerateGuidsNow>
74 <HarvestFileSuppressFragments Condition=" '$(HarvestFileSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestFileSuppressFragments>
75 <HarvestFileSuppressUniqueIds Condition=" '$(HarvestFileSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestFileSuppressUniqueIds>
76 <HarvestFileTransforms Condition=" '$(HarvestFileTransforms)' == '' ">$(HarvestTransforms)</HarvestFileTransforms>
77 </PropertyGroup>
78
79 <!--
80 ==================================================================================================
81 Harvest
82 ==================================================================================================
83 -->
84 <PropertyGroup>
85 <HarvestDependsOn>
86 ConvertReferences;
87 ConvertBundleReferences;
88 HarvestProjects;
89 HarvestDirectory;
90 HarvestFile;
91 GenerateCode;
92 </HarvestDependsOn>
93 </PropertyGroup>
94 <Target
95 Name="Harvest"
96 DependsOnTargets="$(HarvestDependsOn)" />
97
98 <!--
99 ==================================================================================================
100 GenerateCode
101 ==================================================================================================
102 -->
103 <PropertyGroup>
104 <GenerateCodeDependsOn>
105 RefreshGeneratedFile;
106 RefreshBundleGeneratedFile
107 </GenerateCodeDependsOn>
108 </PropertyGroup>
109 <Target
110 Name="GenerateCode"
111 DependsOnTargets="$(GenerateCodeDependsOn)" />
112
113 <!--
114 ================================================================================================
115 ConvertReferences
116
117 Converts project references to HeatProject items to auto generate authoring.
118 ================================================================================================
119 -->
120 <Target
121 Name="ConvertReferences"
122 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module') ">
123
124 <ItemGroup>
125 <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
126 <DirectoryIds>%(_MSBuildProjectReferenceExistent.RefTargetDir)</DirectoryIds>
127 <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
128 <ProjectName>%(_MSBuildProjectReferenceExistent.Name)</ProjectName>
129 <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
130 </_HeatProjectReference>
131 <HeatProject Include="@(_HeatProjectReference)" />
132 </ItemGroup>
133
134 <Error
135 Text="The following files are deprecated and should be removed from your project(s): @(Compile->'%(Identity)', ', ')"
136 Condition=" '%(Compile.GenerateComponentGroups)' != '' " />
137
138 <ItemGroup>
139 <!-- Unconditionally generate Compile items so they are always linked in. -->
140 <Compile Include="$(HarvestProjectsGeneratedFile)" />
141 <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
142 </ItemGroup>
143
144 </Target>
145
146 <!--
147 ================================================================================================
148 ConvertBundleReferences
149
150 Converts project references in Bundle projects to HeatProject items to auto generate authoring.
151 ================================================================================================
152 -->
153 <Target
154 Name="ConvertBundleReferences"
155 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Bundle') ">
156
157 <ItemGroup>
158 <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
159 <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
160 <GenerateType>payloadgroup</GenerateType>
161 <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
162 </_HeatProjectReference>
163 <HeatProject Include="@(_HeatProjectReference)" />
164 </ItemGroup>
165
166 <Error
167 Text="The following files are deprecated and should be removed from your project(s): @(Compile->'%(Identity)', ', ')"
168 Condition=" '%(Compile.GenerateComponentGroups)' != '' " />
169
170 <ItemGroup>
171 <!-- Unconditionally generate Compile items so they are always linked in. -->
172 <Compile Include="$(HarvestProjectsGeneratedFile)" />
173 <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
174 </ItemGroup>
175
176 </Target>
177
178 <!--
179 ================================================================================================
180 CombineHarvestProjects
181
182 Combines HeatProject and HarvestProject items together and ensures each has HeatOutput metadata.
183 ================================================================================================
184 -->
185 <Target
186 Name="CombineHarvestProjects"
187 Condition=" '@(HeatProject)' != '' or '@(HarvestProject)' != '' ">
188
189 <!-- Add default HeatOutputs for those without one specified -->
190 <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' == '' "
191 AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HeatProject.Filename).wxs">
192 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
193 </CreateItem>
194 <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' == '' "
195 AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HarvestProject.Filename).wxs">
196 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
197 </CreateItem>
198
199
200 <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' != '' ">
201 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
202 </CreateItem>
203 <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' != '' ">
204 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
205 </CreateItem>
206
207 </Target>
208
209 <!--
210 ================================================================================================
211 HarvestProjects
212
213 Harvests outputs of other MSBuild projects files using the VS project extension to heat.exe.
214
215 [IN]
216 @(HarvestProject)
217 @(HeatProject)
218 - The list of projects to harvest. HeatProject is provided for backward compatibility.
219 You should use HarvestProject instead.
220
221 %(HarvestProject.Transforms)
222 %(HeatProject.Transforms)
223 - XSL transforms to apply to the harvested WiX.
224
225 %(HarvestProject.ProjectOutputGroups)
226 %(HeatProjects.ProjectOutputGroups)
227 - The project output groups to harvest
228
229 [OUT]
230 %(HeatOutput)
231 - The generated .wxs files which are added to the @(Compile) item list.
232 ================================================================================================
233 -->
234 <ItemDefinitionGroup>
235 <HeatProject>
236 <Transforms>$(HarvestProjectsTransforms)</Transforms>
237 <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
238 <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
239 </HeatProject>
240 <HarvestProject>
241 <Transforms>$(HarvestProjectsTransforms)</Transforms>
242 <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
243 <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
244 </HarvestProject>
245 </ItemDefinitionGroup>
246
247 <PropertyGroup>
248 <HarvestProjectsDependsOn>CombineHarvestProjects</HarvestProjectsDependsOn>
249 </PropertyGroup>
250 <Target Name="HarvestProjects"
251 DependsOnTargets="$(HarvestProjectsDependsOn)"
252 Inputs="@(_AllHeatProjects);%(_AllHeatProjects.Transforms);$(MSBuildAllProjects);$(ProjectPath)"
253 Outputs="@(_AllHeatProjects -> '%(HeatOutput)')"
254 Condition=" $(EnableProjectHarvesting) and ('@(HeatProject)' != '' or '@(HarvestProject)' != '') ">
255
256 <HeatProject
257 NoLogo="true"
258 SuppressAllWarnings="$(HarvestProjectsSuppressAllWarnings)"
259 SuppressSpecificWarnings="$(HarvestProjectsSuppressSpecificWarnings)"
260 TreatWarningsAsErrors="$(HarvestProjectsTreatWarningsAsErrors)"
261 TreatSpecificWarningsAsErrors="$(HarvestProjectsTreatSpecificWarningsAsErrors)"
262 VerboseOutput="$(HarvestProjectsVerboseOutput)"
263 AutogenerateGuids="$(HarvestProjectsAutogenerateGuids)"
264 GenerateGuidsNow="$(HarvestProjectsGenerateGuidsNow)"
265 OutputFile="%(_AllHeatProjects.HeatOutput)"
266 SuppressFragments="$(HarvestProjectsSuppressFragments)"
267 SuppressUniqueIds="$(HarvestProjectsSuppressUniqueIds)"
268 Transforms="%(_AllHeatProjects.Transforms)"
269 Project="%(_AllHeatProjects.FullPath)"
270 ProjectOutputGroups="%(_AllHeatProjects.ProjectOutputGroups)"
271 GenerateType="%(_AllHeatProjects.GenerateType)"
272 DirectoryIds="%(_AllHeatProjects.DirectoryIds)"
273 ProjectName="%(_AllHeatProjects.ProjectName)"
274 Configuration="%(_AllHeatProjects.Configuration)"
275 Platform="%(_AllHeatProjects.Platform)"
276 GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)"
277 AdditionalOptions="$(HarvestProjectsAdditionalOptions)">
278
279 <Output TaskParameter="OutputFile" ItemName="Compile" />
280 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
281
282 </HeatProject>
283
284 </Target>
285
286 <!--
287 ================================================================================================
288 HarvestDirectory
289
290 Harvests directories using heat.exe.
291
292 [IN]
293 @(HarvestDirectory) - The list of directories to harvest.
294 %(HarvestDirectory.Transforms) - XSL transforms to apply to the harvested WiX.
295 %(HarvestDirectory.ComponentGroupName) - The name of the ComponentGroup to create.
296 %(HarvestDirectory.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
297 %(HarvestDirectory.KeepEmptyDirectories) - Whether to create Directory entries for empty directories.
298 %(HarvestDirectory.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
299 %(HarvestDirectory.SuppressCom) - Suppress COM elements.
300 %(HarvestDirectory.SuppressRootDirectory) - Suppress a Directory element for the root directory.
301 $(HarvestDirectory.SuppressRegistry) - Suppress registry harvesting.
302
303 [OUT]
304 $(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs
305 - The generated .wxs files which are added to the @(Compile) item list.
306 ================================================================================================
307 -->
308
309 <ItemDefinitionGroup>
310 <HarvestDirectory>
311 <Transforms>$(HarvestDirectoryTransforms)</Transforms>
312 <ComponentGroupName>$(HarvestDirectoryComponentGroupName)</ComponentGroupName>
313 <DirectoryRefId>$(HarvestDirectoryDirectoryRefId)</DirectoryRefId>
314 <KeepEmptyDirectories>$(HarvestDirectoryKeepEmptyDirectories)</KeepEmptyDirectories>
315 <PreprocessorVariable>$(HarvestDirectoryPreprocessorVariable)</PreprocessorVariable>
316 <SuppressCom>$(HarvestDirectorySuppressCom)</SuppressCom>
317 <SuppressRootDirectory>$(HarvestDirectorySuppressRootDirectory)</SuppressRootDirectory>
318 <SuppressRegistry>$(HarvestDirectorySuppressRegistry)</SuppressRegistry>
319 </HarvestDirectory>
320 </ItemDefinitionGroup>
321
322 <PropertyGroup>
323 <HarvestDirectoryDependsOn>
324 GetHarvestDirectoryContent
325 </HarvestDirectoryDependsOn>
326 </PropertyGroup>
327
328 <!-- Creates items to include content since wildcards will not work in Target/@Inputs. -->
329 <Target Name="GetHarvestDirectoryContent">
330 <CreateItem Include="@(HarvestDirectory->'%(FullPath)\**\*')">
331 <Output TaskParameter="Include" ItemName="_HarvestDirectoryContent" />
332 </CreateItem>
333 </Target>
334
335 <Target Name="HarvestDirectory"
336 DependsOnTargets="$(HarvestDirectoryDependsOn)"
337 Inputs="@(_HarvestDirectoryContent);%(HarvestDirectory.Transforms)"
338 Outputs="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
339 Condition=" '@(HarvestDirectory)' != '' ">
340
341 <HeatDirectory
342 NoLogo="true"
343 SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)"
344 SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings)"
345 TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)"
346 TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)"
347 VerboseOutput="$(HarvestDirectoryVerboseOutput)"
348 AutogenerateGuids="$(HarvestDirectoryAutogenerateGuids)"
349 GenerateGuidsNow="$(HarvestDirectoryGenerateGuidsNow)"
350 OutputFile="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
351 SuppressFragments="$(HarvestDirectorySuppressFragments)"
352 SuppressUniqueIds="$(HarvestDirectorySuppressUniqueIds)"
353 Transforms="%(HarvestDirectory.Transforms)"
354 Directory="@(HarvestDirectory)"
355 ComponentGroupName="%(HarvestDirectory.ComponentGroupName)"
356 DirectoryRefId="%(HarvestDirectory.DirectoryRefId)"
357 KeepEmptyDirectories="%(HarvestDirectory.KeepEmptyDirectories)"
358 PreprocessorVariable="%(HarvestDirectory.PreprocessorVariable)"
359 SuppressCom="%(HarvestDirectory.SuppressCom)"
360 SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)"
361 SuppressRegistry="%(HarvestDirectory.SuppressRegistry)"
362 AdditionalOptions="$(HarvestDirectoryAdditionalOptions)">
363
364 <Output TaskParameter="OutputFile" ItemName="Compile" />
365 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
366
367 </HeatDirectory>
368
369 </Target>
370
371 <!--
372 ================================================================================================
373 HarvestFile
374
375 Harvests files of different types using heat.exe. This can harvest registry from
376 self-registering files, files with typelibs, and more.
377
378 [IN]
379 @(HarvestFile) - The list of files to harvest.
380 %(HarvestFile.Transforms) - XSL transforms to apply to the harvested WiX.
381 %(HarvestFile.ComponentGroupName) - The name of the ComponentGroup to create.
382 %(HarvestFile.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
383 %(HarvestFile.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
384 %(HarvestFile.SuppressCom) - Suppress COM elements.
385 %(HarvestFile.SuppressRootDirectory) - Suppress a Directory element for the root directory.
386 $(HarvestFile.SuppressRegistry) - Suppress registry harvesting.
387
388 [OUT]
389 $(IntermediateOutputPath)_%(HarvestFile.Filename)_file.wxs
390 - The generated .wxs files which are added to the @(Compile) item list.
391 ================================================================================================
392 -->
393
394 <ItemDefinitionGroup>
395 <HarvestFile>
396 <Transforms>$(HarvestFileTransforms)</Transforms>
397 <ComponentGroupName>$(HarvestFileComponentGroupName)</ComponentGroupName>
398 <DirectoryRefId>$(HarvestFileDirectoryRefId)</DirectoryRefId>
399 <PreprocessorVariable>$(HarvestFilePreprocessorVariable)</PreprocessorVariable>
400 <SuppressCom>$(HarvestFileSuppressCom)</SuppressCom>
401 <SuppressRegistry>$(HarvestFileSuppressRegistry)</SuppressRegistry>
402 <SuppressRootDirectory>$(HarvestFileSuppressRootDirectory)</SuppressRootDirectory>
403 </HarvestFile>
404 </ItemDefinitionGroup>
405
406 <PropertyGroup>
407 <HarvestFileDependsOn></HarvestFileDependsOn>
408 </PropertyGroup>
409 <Target Name="HarvestFile"
410 DependsOnTargets="$(HarvestFileDependsOn)"
411 Inputs="@(HarvestFile);%(HarvestFile.Transforms)"
412 Outputs="@(HarvestFile->'$(IntermediateOutputPath)_%(ComponentGroupName)_%(DirectoryRefId)_%(Filename)%(Extension)_file.wxs')"
413 Condition=" '@(HarvestFile)' != '' ">
414
415 <HeatFile
416 NoLogo="true"
417 SuppressAllWarnings="$(HarvestFileSuppressAllWarnings)"
418 SuppressSpecificWarnings="$(HarvestFileSuppressSpecificWarnings)"
419 TreatWarningsAsErrors="$(HarvestFileTreatWarningsAsErrors)"
420 TreatSpecificWarningsAsErrors="$(HarvestFileTreatSpecificWarningsAsErrors)"
421 VerboseOutput="$(HarvestFileVerboseOutput)"
422 AutogenerateGuids="$(HarvestFileAutogenerateGuids)"
423 GenerateGuidsNow="$(HarvestFileGenerateGuidsNow)"
424 OutputFile="$(IntermediateOutputPath)_%(HarvestFile.ComponentGroupName)_%(HarvestFile.DirectoryRefId)_%(HarvestFile.Filename)%(HarvestFile.Extension)_file.wxs"
425 SuppressFragments="$(HarvestFileSuppressFragments)"
426 SuppressUniqueIds="$(HarvestFileSuppressUniqueIds)"
427 Transforms="%(HarvestFile.Transforms)"
428 File="@(HarvestFile)"
429 ComponentGroupName="%(HarvestFile.ComponentGroupName)"
430 DirectoryRefId="%(HarvestFile.DirectoryRefId)"
431 PreprocessorVariable="%(HarvestFile.PreprocessorVariable)"
432 SuppressCom="%(HarvestFile.SuppressCom)"
433 SuppressRegistry="%(HarvestFile.SuppressRegistry)"
434 SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)"
435 AdditionalOptions="$(HarvestFileAdditionalOptions)">
436
437 <Output TaskParameter="OutputFile" ItemName="Compile" />
438 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
439
440 </HeatFile>
441
442 </Target>
443
444 <!--
445 ================================================================================================
446 RefreshGeneratedFile
447
448 Generates code based on metadata defined in project references.
449
450 [IN]
451 @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
452
453 [OUT]
454 @(_GeneratedFiles) - The generated source file.
455 ================================================================================================
456 -->
457 <PropertyGroup>
458 <RefreshGeneratedFileDependsOn></RefreshGeneratedFileDependsOn>
459 </PropertyGroup>
460 <Target Name="RefreshGeneratedFile"
461 DependsOnTargets="$(RefreshGeneratedFileDependsOn)"
462 Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
463 Outputs="@(_GeneratedFiles)"
464 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module') and '@(_GeneratedFiles)' != '' ">
465
466 <RefreshGeneratedFile
467 GeneratedFiles="@(_GeneratedFiles)"
468 ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
469
470 </Target>
471
472 <!--
473 ================================================================================================
474 RefreshBundleGeneratedFile
475
476 Generates code for bundle projects based on metadata defined in project references.
477
478 [IN]
479 @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
480
481 [OUT]
482 @(_GeneratedFiles) - The generated source file.
483 ================================================================================================
484 -->
485 <PropertyGroup>
486 <RefreshBundleGeneratedFileDependsOn></RefreshBundleGeneratedFileDependsOn>
487 </PropertyGroup>
488 <Target Name="RefreshBundleGeneratedFile"
489 DependsOnTargets="$(RefreshBundleGeneratedFileDependsOn)"
490 Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
491 Outputs="@(_GeneratedFiles)"
492 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Bundle' and '@(_GeneratedFiles)' != '') ">
493
494 <RefreshBundleGeneratedFile
495 GeneratedFiles="@(_GeneratedFiles)"
496 ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
497 </Target>
498
499</Project>
diff --git a/src/WixToolset.MSBuild/wix.signing.targets b/src/WixToolset.MSBuild/wix.signing.targets
new file mode 100644
index 00000000..7c25175f
--- /dev/null
+++ b/src/WixToolset.MSBuild/wix.signing.targets
@@ -0,0 +1,370 @@
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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <PropertyGroup>
6 <SignedFileName Condition=" '$(SignedFileName)' == '' ">$(MSBuildProjectFile).Signed.txt</SignedFileName>
7 <SignedFilePath>$(IntermediateOutputPath)$(SignedFileName)</SignedFilePath>
8 </PropertyGroup>
9
10 <UsingTask TaskName="Insignia" AssemblyFile="$(WixTasksPath)" />
11 <UsingTask TaskName="GetCabList" AssemblyFile="$(WixTasksPath)" />
12 <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" />
13
14 <!-- Default Inscribe properties. -->
15 <PropertyGroup>
16 <InscribeNoLogo Condition=" '$(InscribeNoLogo)' == '' ">$(NoLogo)</InscribeNoLogo>
17 <InscribeSuppressAllWarnings Condition=" '$(InscribeSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</InscribeSuppressAllWarnings>
18 <InscribeSuppressSpecificWarnings Condition=" '$(InscribeSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</InscribeSuppressSpecificWarnings>
19 <InscribeTreatWarningsAsErrors Condition=" '$(InscribeTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</InscribeTreatWarningsAsErrors>
20 <InscribeTreatSpecificWarningsAsErrors Condition=" '$(InscribeTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</InscribeTreatSpecificWarningsAsErrors>
21 <InscribeVerboseOutput Condition=" '$(InscribeVerboseOutput)' == '' ">$(VerboseOutput)</InscribeVerboseOutput>
22 </PropertyGroup>
23
24 <!--
25 ==================================================================================================
26 Signing
27 ==================================================================================================
28 -->
29 <PropertyGroup>
30 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Module' ">
31 GetMsmsToSign;
32 InternalSignMsm;
33 </InternalSignDependsOn>
34 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Package' ">
35 GetCabsToSign;
36 GetMsiToSign;
37 InternalSignCabs;
38 InscribeMsi;
39 InternalSignMsi;
40 </InternalSignDependsOn>
41 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Bundle' ">
42 GetContainersToSign;
43 InternalSignContainers;
44 InscribeBundleEngine;
45 InternalSignBundleEngine;
46 InscribeBundle;
47 InternalSignBundle;
48 </InternalSignDependsOn>
49
50 <SigningDependsOn>
51 WixBuild;
52 CalculateSignTargetFiles;
53 BeforeSigning;
54 $(InternalSignDependsOn);
55 AfterSigning
56 </SigningDependsOn>
57 </PropertyGroup>
58 <Target
59 Name="Signing"
60 DependsOnTargets="$(SigningDependsOn)"
61 Inputs="$(TargetPath)"
62 Outputs="$(SignedFilePath)"
63 Condition=" '$(SignOutput)' == 'true' ">
64
65 <ItemGroup>
66 <FileWrites Include="$(SignedFilePath)" />
67 </ItemGroup>
68
69 <WriteLinesToFile
70 File="$(SignedFilePath)"
71 Lines="^$(MSBuildProjectFullPath);@(SignMsm);@(SignCabs);@(SignMsi);@(SignContainers);@(SignBundleEngine);@(SignBundle)"
72 Overwrite="true" />
73 </Target>
74
75 <!-- Internal targets so correct signing targets are called. -->
76 <Target
77 Name="CalculateSignTargetFiles">
78 <ItemGroup>
79 <SignTargetPath Include="$(TargetPath)" />
80 </ItemGroup>
81 </Target>
82
83 <Target
84 Name="GetMsmsToSign"
85 Inputs="@(SignTargetPath)"
86 Outputs="$(SignedFilePath)">
87
88 <ItemGroup>
89 <SignMsm Include="@(SignTargetPath)" />
90 </ItemGroup>
91 </Target>
92
93 <Target
94 Name="InternalSignMsm"
95 DependsOnTargets="SignMsm"
96 Condition=" '@(SignMsm)' != '' " />
97
98 <Target
99 Name="GetCabsToSign"
100 Inputs="@(SignTargetPath)"
101 Outputs="$(SignedFilePath)">
102 <GetCabList Database="%(SignTargetPath.FullPath)">
103 <Output TaskParameter="CabList" ItemName="SignCabs" />
104 <Output TaskParameter="CabList" ItemName="FileWrites" />
105 </GetCabList>
106 </Target>
107
108 <Target
109 Name="InternalSignCabs"
110 DependsOnTargets="SignCabs"
111 Condition=" '@(SignCabs)' != '' " />
112
113 <Target
114 Name="GetMsiToSign"
115 Inputs="@(SignTargetPath)"
116 Outputs="$(SignedFilePath)">
117 <CreateItemAvoidingInference InputProperties="@(SignTargetPath)">
118 <Output TaskParameter="OuputItems" ItemName="SignMsi" />
119 <Output TaskParameter="OuputItems" ItemName="FileWrites" />
120 </CreateItemAvoidingInference>
121 </Target>
122
123 <Target
124 Name="InternalSignMsi"
125 DependsOnTargets="SignMsi"
126 Inputs="@(SignTargetPath)"
127 Outputs="$(SignedFilePath)"
128 Condition=" '@(SignMsi)' != '' " />
129
130 <Target
131 Name="GetContainersToSign"
132 Inputs="@(SignTargetPath)"
133 Outputs="$(SignedFilePath)">
134 <!-- TODO: implement signing detached containers -->
135 </Target>
136
137 <Target
138 Name="InternalSignContainers"
139 DependsOnTargets="SignContainers"
140 Condition=" '@(SignContainers)' != '' " />
141
142 <Target
143 Name="InternalSignBundleEngine"
144 DependsOnTargets="SignBundleEngine"
145 Condition=" '@(SignBundleEngine)' != '' " />
146
147 <Target
148 Name="InternalSignBundle"
149 DependsOnTargets="SignBundle"
150 Condition=" '@(SignBundle)' != '' " />
151
152 <!--
153 ================================================================================================
154 InscribeMsi
155
156 To be called after signing an MSI's cabs - inscribes an MSI with the digital signature of its
157 external cabs.
158
159 [IN/OUT]
160 @(SignTargetPath) - The database file to inscribe - database file will be modified in-place.
161
162 [OUT]
163 @(SignMsi) - The database file to sign.
164 ================================================================================================
165 -->
166 <PropertyGroup>
167 <InscribeMsiDependsOn>
168 </InscribeMsiDependsOn>
169 </PropertyGroup>
170 <Target
171 Name="InscribeMsi"
172 DependsOnTargets="$(InscribeMsiDependsOn)"
173 Inputs="@(SignTargetPath)"
174 Outputs="$(SignedFilePath)"
175 Condition=" '@(SignCabs)' != '' ">
176
177 <Insignia
178 DatabaseFile="%(SignTargetPath.FullPath)"
179 OutputFile="%(SignTargetPath.FullPath)"
180 ToolPath="$(WixToolPath)"
181 NoLogo="$(InscribeNoLogo)"
182 RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
183 SuppressAllWarnings="$(InscribeSuppressAllWarnings)"
184 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)"
185 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)"
186 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)"
187 VerboseOutput="$(InscribeVerboseOutput)"
188 AdditionalOptions="$(InscribeAdditionalOptions)" />
189 </Target>
190
191 <!--
192 ================================================================================================
193 InscribeBundleEngine
194
195 To be called after signing a bundle's detached containers. Also removes attached container
196 so engine can be signed without attached container.
197
198 [IN]
199 @(SignTargetPath) - The bundle to inscribe.
200
201 [OUT]
202 @(SignBundleEngine) - The bundle engine file to be signed.
203 ================================================================================================
204 -->
205 <PropertyGroup>
206 <InscribeBundleEngineDependsOn>
207 </InscribeBundleEngineDependsOn>
208 </PropertyGroup>
209 <Target
210 Name="InscribeBundleEngine"
211 DependsOnTargets="$(InscribeBundleEngineDependsOn)"
212 Inputs="@(SignTargetPath)"
213 Outputs="$(SignedFilePath)">
214
215 <Insignia
216 BundleFile="@(SignTargetPath)"
217 OutputFile="$(IntermediateOutputPath)%(SignTargetPath.Filename)%(SignTargetPath.Extension)"
218 ToolPath="$(WixToolPath)"
219 NoLogo="$(InscribeNoLogo)"
220 RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
221 SuppressAllWarnings="$(InscribeSuppressAllWarnings)"
222 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)"
223 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)"
224 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)"
225 VerboseOutput="$(InscribeVerboseOutput)"
226 AdditionalOptions="$(InscribeAdditionalOptions)">
227 <Output TaskParameter="Output" ItemName="SignBundleEngine" />
228 </Insignia>
229
230 <!-- Explicitly add output to FileWrites to ensure they are included even when the target is up to date. -->
231 <ItemGroup>
232 <FileWrites Include="$(IntermediateOutputPath)%(SignTargetPath.Filename)%(SignTargetPath.Extension)" />
233 </ItemGroup>
234 </Target>
235
236 <!--
237 ================================================================================================
238 InscribeBundle
239
240 To be called after signing the bundle engine to reattach the attached container.
241
242 [IN]
243 @(Inscribe) - The bundle to inscribe.
244
245 [OUT]
246 @(SignBundle) - The bundle engine file to be signed.
247 ================================================================================================
248 -->
249 <PropertyGroup>
250 <InscribeBundleDependsOn>
251 </InscribeBundleDependsOn>
252 </PropertyGroup>
253 <Target
254 Name="InscribeBundle"
255 DependsOnTargets="$(InscribeBundleDependsOn)"
256 Inputs="@(SignTargetPath)"
257 Outputs="$(SignedFilePath)">
258
259 <Insignia
260 BundleFile="@(SignBundleEngine)"
261 OriginalBundleFile="@(SignTargetPath)"
262 OutputFile="@(SignTargetPath)"
263 ToolPath="$(WixToolPath)"
264 NoLogo="$(InscribeNoLogo)"
265 RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
266 SuppressAllWarnings="$(InscribeSuppressAllWarnings)"
267 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)"
268 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)"
269 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)"
270 VerboseOutput="$(InscribeVerboseOutput)"
271 AdditionalOptions="$(InscribeAdditionalOptions)">
272 <Output TaskParameter="Output" ItemName="SignBundle" />
273 <Output TaskParameter="Output" ItemName="FileWrites" />
274 </Insignia>
275 </Target>
276
277 <!--
278 ==================================================================================================
279 BeforeSigning
280
281 Redefine this target in your project in order to run tasks just before all signing tasks.
282 ==================================================================================================
283 -->
284 <Target Name="BeforeSigning" />
285
286 <!--
287 ==================================================================================================
288 SignMsm
289
290 Redefine this target in your project in order to sign merge modules.
291
292 [IN]
293 @(SignMsm) - merge module files to sign.
294 ==================================================================================================
295 -->
296 <Target Name="SignMsm" />
297
298 <!--
299 ==================================================================================================
300 SignCabs
301
302 Redefine this target in your project in order to sign the cabs of your database.
303
304 [IN]
305 @(SignCabs) - cabinet files to sign.
306 ==================================================================================================
307 -->
308 <Target Name="SignCabs" />
309
310 <!--
311 ==================================================================================================
312 SignMsi
313
314 Redefine this target in your project in order to sign your database, after it has been inscribed
315 with the signatures of your signed cabs.
316
317 [IN]
318 @(SignMsi) - database files to sign.
319 ==================================================================================================
320 -->
321 <Target Name="SignMsi" />
322
323 <!--
324 ==================================================================================================
325 SignContainers
326
327 Redefine this target in your project in order to sign your bundle's detached containers.
328
329 [IN]
330 @(SignContainers) - detached container files to sign.
331 ==================================================================================================
332 -->
333 <Target Name="SignContainers" />
334
335 <!--
336 ==================================================================================================
337 SignBundleEngine
338
339 Redefine this target in your project in order to sign your bundle, after it has been inscribed
340 with the signatures of your signed containers.
341
342 [IN]
343 @(SignBundleEngine) - bundle engine file to sign.
344 ==================================================================================================
345 -->
346 <Target Name="SignBundleEngine" />
347
348 <!--
349 ==================================================================================================
350 SignBundle
351
352 Redefine this target in your project in order to sign your bundle, after the attached container
353 is reattached.
354
355 [IN]
356 @(SignBundle) - bundle file to sign.
357 ==================================================================================================
358 -->
359 <Target Name="SignBundle" />
360
361 <!--
362 ==================================================================================================
363 AfterSigning
364
365 Redefine this target in your project in order to run tasks just after all signing tasks.
366 ==================================================================================================
367 -->
368 <Target Name="AfterSigning" />
369
370</Project>
diff --git a/src/WixToolset.MSBuild/wix.targets b/src/WixToolset.MSBuild/wix.targets
new file mode 100644
index 00000000..b35d18c7
--- /dev/null
+++ b/src/WixToolset.MSBuild/wix.targets
@@ -0,0 +1,1060 @@
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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="_CheckRequiredProperties" DefaultTargets="Build">
5 <PropertyGroup>
6 <WixTargetsImported>true</WixTargetsImported>
7 </PropertyGroup>
8
9 <!--
10 //////////////////////////////////////////////////////////////////////////////////////////////////
11 //////////////////////////////////////////////////////////////////////////////////////////////////
12 Extension Points
13 //////////////////////////////////////////////////////////////////////////////////////////////////
14 //////////////////////////////////////////////////////////////////////////////////////////////////
15 -->
16
17 <!-- Allow a user-customized targets files to be used as part of the build. -->
18 <Import Project="$(CustomBeforeWixTargets)" Condition=" '$(CustomBeforeWixTargets)' != '' and Exists('$(CustomBeforeWixTargets)')" />
19
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>
24 <WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(WixBinDir)WixToolset.BuildTasks.dll</WixTasksPath>
25 <WixHarvestTargetsPath Condition=" '$(WixHarvestTargetsPath)' == '' ">$(MSBuildThisFileDirectory)wix.harvest.targets</WixHarvestTargetsPath>
26 <WixSigningTargetsPath Condition=" '$(WixSigningTargetsPath)' == '' ">$(MSBuildThisFileDirectory)wix.signing.targets</WixSigningTargetsPath>
27 </PropertyGroup>
28
29 <!-- This makes the project files a dependency of all targets so that things rebuild if they change -->
30 <PropertyGroup>
31 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
32 <MSBuildAllProjects Condition="Exists('$(WixHarvestTargetsPath)')">$(MSBuildAllProjects);$(WixHarvestTargetsPath)</MSBuildAllProjects>
33 <MSBuildAllProjects Condition="Exists('$(WixSigningTargetsPath)')">$(MSBuildAllProjects);$(WixSigningTargetsPath)</MSBuildAllProjects>
34 <MSBuildAllProjects Condition="Exists('$(CustomBeforeWixTargets)')">$(MSBuildAllProjects);$(CustomBeforeWixTargets)</MSBuildAllProjects>
35 <MSBuildAllProjects Condition="Exists('$(CustomAfterWixTargets)')">$(MSBuildAllProjects);$(CustomAfterWixTargets)</MSBuildAllProjects>
36 </PropertyGroup>
37
38 <!--
39 //////////////////////////////////////////////////////////////////////////////////////////////////
40 //////////////////////////////////////////////////////////////////////////////////////////////////
41 Declarations for Microsoft.Common.targets
42 //////////////////////////////////////////////////////////////////////////////////////////////////
43 //////////////////////////////////////////////////////////////////////////////////////////////////
44 -->
45
46 <PropertyGroup>
47 <DefaultLanguageSourceExtension>.wxs</DefaultLanguageSourceExtension>
48 <Language>wix</Language>
49 <TargetRuntime>wix</TargetRuntime>
50
51 <!-- Use OutputName to set the AssemblyName for Microsoft.Common.targets -->
52 <OutputName Condition=" '$(OutputName)'=='' ">$(MSBuildProjectName)</OutputName>
53 <AssemblyName>$(OutputName)</AssemblyName>
54
55 <!-- Default OutputType to a known WiX Toolset type. -->
56 <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType>
57
58 <!-- Default WixPdbType to a known WiX Toolset type. -->
59 <WixPdbType Condition=" '$(WixPdbType)' == '' ">full</WixPdbType>
60 </PropertyGroup>
61
62 <!--
63 IDE Macros available from both integrated builds and from command line builds.
64 The following properties are 'macros' that are available via IDE for pre and post build steps.
65 All of them should be added to WixBuildMacroCollection to ensure that they are shown in the UI.
66 -->
67 <PropertyGroup Condition=" '$(TargetExt)' == '' ">
68 <TargetExt Condition=" '$(OutputType)' == 'Package' ">.msi</TargetExt>
69 <TargetExt Condition=" '$(OutputType)' == 'Module' ">.msm</TargetExt>
70 <TargetExt Condition=" '$(OutputType)' == 'PatchCreation' ">.pcp</TargetExt>
71 <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt>
72 <TargetExt Condition=" '$(OutputType)' == 'Bundle' ">.exe</TargetExt>
73 <TargetExt Condition=" '$(OutputType)' == 'IntermediatePostLink' ">.wixipl</TargetExt>
74 </PropertyGroup>
75
76 <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
77
78 <PropertyGroup>
79 <!-- Default pdb output path to the intermediate output directory -->
80 <PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(TargetDir)</PdbOutputDir>
81 <PdbOutputDir Condition=" !HasTrailingSlash('$(PdbOutputDir)') ">$(PdbOutputDir)\</PdbOutputDir>
82
83 <!-- Example, C:\MyProjects\MyProject\bin\debug\ -->
84 <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`))</TargetPdbDir>
85
86 <!-- Example, MySetup.wixpdb" -->
87 <TargetPdbFileName Condition=" '$(TargetPdbFileName)' == '' ">$(TargetName).wixpdb</TargetPdbFileName>
88
89 <!-- Example, C:\MyProjects\MyProject\bin\debug\MyPackage.wixpdb -->
90 <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbFileName)</TargetPdbPath>
91 </PropertyGroup>
92
93 <!--
94 //////////////////////////////////////////////////////////////////////////////////////////////////
95 //////////////////////////////////////////////////////////////////////////////////////////////////
96 Property Declarations
97 //////////////////////////////////////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////////////////////////////////////
99 -->
100
101 <!-- These tasks can be used as general-purpose build tasks. -->
102 <UsingTask TaskName="WixBuild" AssemblyFile="$(WixTasksPath)" />
103
104 <!-- 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)"/>
111
112 <PropertyGroup>
113 <BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile>
114 <BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile>
115 <BindBuiltOutputsFile Condition=" '$(BindBuiltOutputsFile)' == '' ">$(MSBuildProjectFile).BindBuiltOutputsFileList.txt</BindBuiltOutputsFile>
116 </PropertyGroup>
117
118 <PropertyGroup>
119 <CabinetCachePath Condition=" '$(CabinetCachePath)'=='' and '$(ReuseCabinetCache)'=='true' ">$(IntermediateOutputPath)cabcache\</CabinetCachePath>
120 </PropertyGroup>
121
122 <PropertyGroup>
123 <WixExtDir Condition=" '$(WixExtDir)' == ''">$(WixBinDir)</WixExtDir>
124 </PropertyGroup>
125
126 <!--
127 //////////////////////////////////////////////////////////////////////////////////////////////////
128 //////////////////////////////////////////////////////////////////////////////////////////////////
129 Default Compiler, Linker, and Librarian Property Declarations
130 //////////////////////////////////////////////////////////////////////////////////////////////////
131 //////////////////////////////////////////////////////////////////////////////////////////////////
132 -->
133
134 <!-- If WixExtension was passed in via the command line, then convert it to an ItemGroup -->
135 <ItemGroup>
136 <WixExtension Include="$(WixExtension)" Condition=" '$(WixExtension)' != '' " />
137 </ItemGroup>
138
139 <!-- Defaut Compiler properties. -->
140 <PropertyGroup>
141 <CompilerNoLogo Condition=" '$(CompilerNoLogo)' == '' ">$(NoLogo)</CompilerNoLogo>
142 <CompilerSuppressAllWarnings Condition=" '$(CompilerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</CompilerSuppressAllWarnings>
143 <CompilerSuppressSpecificWarnings Condition=" '$(CompilerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</CompilerSuppressSpecificWarnings>
144 <CompilerTreatWarningsAsErrors Condition=" '$(CompilerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</CompilerTreatWarningsAsErrors>
145 <CompilerTreatSpecificWarningsAsErrors Condition=" '$(CompilerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</CompilerTreatSpecificWarningsAsErrors>
146 <CompilerVerboseOutput Condition=" '$(CompilerVerboseOutput)' == '' ">$(VerboseOutput)</CompilerVerboseOutput>
147 <!-- TODO: This probably doesn't work any longer since Platform won't be defined until Microsoft.Common.targets is included -->
148 <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and '$(Platform)' != 'AnyCPU' and '$(Platform)' != 'Any CPU' ">$(Platform)</InstallerPlatform>
149 </PropertyGroup>
150
151 <!-- Default Lib properties. -->
152 <PropertyGroup>
153 <LibNoLogo Condition=" '$(LibNoLogo)' == '' ">$(NoLogo)</LibNoLogo>
154 <LibBindFiles Condition=" '$(LibBindFiles)' == '' ">$(BindFiles)</LibBindFiles>
155 <LibPedantic Condition=" '$(LibPedantic)' == '' ">$(Pedantic)</LibPedantic>
156 <LibSuppressAllWarnings Condition=" '$(LibSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LibSuppressAllWarnings>
157 <LibSuppressSpecificWarnings Condition=" '$(LibSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LibSuppressSpecificWarnings>
158 <LibSuppressSchemaValidation Condition=" '$(LibSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LibSuppressSchemaValidation>
159 <LibSuppressIntermediateFileVersionMatching Condition=" '$(LibSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LibSuppressIntermediateFileVersionMatching>
160 <LibTreatWarningsAsErrors Condition=" '$(LibTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LibTreatWarningsAsErrors>
161 <LibTreatSpecificWarningsAsErrors Condition=" '$(LibTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LibTreatSpecificWarningsAsErrors>
162 <LibVerboseOutput Condition=" '$(LibVerboseOutput)' == '' ">$(VerboseOutput)</LibVerboseOutput>
163 </PropertyGroup>
164
165 <!-- Default Linker properties. -->
166 <PropertyGroup>
167 <LinkerNoLogo Condition=" '$(LinkerNoLogo)' == '' ">$(NoLogo)</LinkerNoLogo>
168 <LinkerBindFiles Condition=" '$(LinkerBindFiles)' == '' ">$(BindFiles)</LinkerBindFiles>
169 <LinkerPedantic Condition=" '$(LinkerPedantic)' == '' ">$(Pedantic)</LinkerPedantic>
170 <LinkerSuppressAllWarnings Condition=" '$(LinkerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LinkerSuppressAllWarnings>
171 <LinkerSuppressSpecificWarnings Condition=" '$(LinkerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LinkerSuppressSpecificWarnings>
172 <LinkerSuppressSchemaValidation Condition=" '$(LinkerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LinkerSuppressSchemaValidation>
173 <LinkerSuppressIntermediateFileVersionMatching Condition=" '$(LinkerSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LinkerSuppressIntermediateFileVersionMatching>
174 <LinkerTreatWarningsAsErrors Condition=" '$(LinkerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LinkerTreatWarningsAsErrors>
175 <LinkerTreatSpecificWarningsAsErrors Condition=" '$(LinkerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LinkerTreatSpecificWarningsAsErrors>
176 <LinkerVerboseOutput Condition=" '$(LinkerVerboseOutput)' == '' ">$(VerboseOutput)</LinkerVerboseOutput>
177 </PropertyGroup>
178
179 <!-- If BindInputPaths (or LinkerBindInputPaths) was passed in via the command line, then convert it to an ItemGroup -->
180 <ItemGroup>
181 <BindInputPaths Include="$(BindInputPaths)" Condition=" '$(BindInputPaths)' != '' " />
182 <LinkerBindInputPaths Include="$(LinkerBindInputPaths)" Condition=" '$(LinkerBindInputPaths)' != '' " />
183 </ItemGroup>
184
185 <!-- Default Lit and Light "properties" -->
186 <ItemGroup>
187 <LinkerBindInputPaths Condition=" '@(LinkerBindInputPaths)' == '' " Include="@(BindInputPaths)" />
188 </ItemGroup>
189
190 <!--
191 //////////////////////////////////////////////////////////////////////////////////////////////////
192 //////////////////////////////////////////////////////////////////////////////////////////////////
193 Initial Targets
194 //////////////////////////////////////////////////////////////////////////////////////////////////
195 //////////////////////////////////////////////////////////////////////////////////////////////////
196 -->
197
198 <!--
199 ==================================================================================================
200 _CheckRequiredProperties
201
202 Checks properties that must be set in the main project file or on the command line before
203 using this .TARGETS file.
204
205 [IN]
206 $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension)
207 $(OutputType) - Possible values are 'Package', 'PatchCreation', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'
208 ==================================================================================================
209 -->
210 <PropertyGroup>
211 <_PleaseSetThisInProjectFile>Please set this in the project file before the &lt;Import&gt; of the wix.targets file.</_PleaseSetThisInProjectFile>
212 <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile)</_OutputTypeDescription>
213 </PropertyGroup>
214 <Target Name="_CheckRequiredProperties">
215
216 <Error
217 Code="WIX100"
218 Condition=" '$(OutputName)' == '' "
219 Text="The OutputName property is not set in project &quot;$(MSBuildProjectFile)&quot;. The OutputName defines the name of the output without a file extension. $(_PleaseSetThisInProjectFile)" />
220
221 <Error
222 Code="WIX101"
223 Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'PatchCreation' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' and '$(OutputType)' != 'Bundle' and '$(OutputType)' != 'IntermediatePostLink' "
224 Text="The OutputType property '$(OutputType)' is not valid in project &quot;$(MSBuildProjectFile)&quot;. $(_OutputTypeDescription)" />
225
226 <Error
227 Code="WIX102"
228 Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' &lt; '4.0' "
229 Text="MSBuild v$(MSBuildToolsVersion) is not supported by the project &quot;$(MSBuildProjectFile)&quot;. You must use MSBuild v4.0 or later." />
230
231 <Error
232 Code="WIX103"
233 Condition=" '$(WixPdbType)' != 'none' and '$(WixPdbType)' != 'full' "
234 Text="The WixPdbType property '$(WixPdbType)' is not valid in project &quot;$(MSBuildProjectFile)&quot;. Supported values are: 'full', 'none'" />
235
236 </Target>
237
238 <!--
239 //////////////////////////////////////////////////////////////////////////////////////////////////
240 //////////////////////////////////////////////////////////////////////////////////////////////////
241 Build Targets
242 //////////////////////////////////////////////////////////////////////////////////////////////////
243 //////////////////////////////////////////////////////////////////////////////////////////////////
244 -->
245
246 <!--
247 ==================================================================================================
248 CoreBuild - OVERRIDE DependsOn
249
250 The core build step calls each of the build targets.
251
252 This is where we insert our targets into the build process.
253 ==================================================================================================
254 -->
255 <PropertyGroup>
256 <CoreBuildDependsOn>
257 BuildOnlySettings;
258 PrepareForBuild;
259 PreBuildEvent;
260
261 WixBuild;
262 Signing;
263
264 GetTargetPath;
265 PrepareForRun;
266 IncrementalClean;
267 PostBuildEvent
268 </CoreBuildDependsOn>
269 </PropertyGroup>
270
271
272 <!--
273 //////////////////////////////////////////////////////////////////////////////////////////////////
274 //////////////////////////////////////////////////////////////////////////////////////////////////
275 Resolve References Targets
276 //////////////////////////////////////////////////////////////////////////////////////////////////
277 //////////////////////////////////////////////////////////////////////////////////////////////////
278 -->
279
280 <!--
281 ==================================================================================================
282 ResolveReferences - OVERRIDE DependsOn
283
284 ==================================================================================================
285 -->
286 <PropertyGroup>
287 <ResolveReferencesDependsOn>
288 BeforeResolveReferences;
289 AssignProjectConfiguration;
290 ResolveProjectReferences;
291 ResolveWixLibraryReferences;
292 ResolveWixExtensionReferences;
293 AfterResolveReferences
294 </ResolveReferencesDependsOn>
295 </PropertyGroup>
296
297 <!--
298 ================================================================================================
299 ResolveProjectReferences
300
301 Builds all of the referenced projects to get their outputs.
302
303 [IN]
304 @(NonVCProjectReference) - The list of non-VC project references.
305
306 [OUT]
307 @(ProjectReferenceWithConfiguration) - The list of non-VC project references.
308 @(WixLibProjects) - Paths to any .wixlibs that were built by referenced projects.
309 ================================================================================================
310 -->
311 <Target
312 Name="ResolveProjectReferences"
313 DependsOnTargets="AssignProjectConfiguration;_SplitProjectReferencesByFileExistence"
314 Condition=" '@(ProjectReferenceWithConfiguration)' != '' ">
315
316 <!-- Issue a warning for each non-existent project. -->
317 <Warning
318 Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist."
319 Condition=" '@(_MSBuildProjectReferenceNonexistent)' != '' " />
320
321 <!--
322 When building this project from the IDE or when building a .sln from the command line or
323 when only building .wixlib project references, gather the referenced build outputs. The
324 code that builds the .sln will already have built the project, so there's no need to do
325 it again here and when building only .wixlib project references we'll use the results to
326 determine which projects to build.
327
328 The ContinueOnError setting is here so that, during project load, as much information as
329 possible will be passed to the compilers.
330 -->
331 <MSBuild
332 Projects="@(_MSBuildProjectReferenceExistent)"
333 Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath"
334 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);%(_MSBuildProjectReferenceExistent.SetPlatform)"
335 Condition="('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '@(_MSBuildProjectReferenceExistent)' != '' "
336 ContinueOnError="!$(BuildingProject)">
337
338 <Output TaskParameter="TargetOutputs" ItemName="_GatheredProjectReferencePaths" />
339 </MSBuild>
340
341 <!--
342 Determine which project references should be built. Note: we will not build any project references
343 if building in the IDE because it builds project references directly.
344
345 If BuildProjectReferences is 'true' (the default) then take all MSBuild project references that exist
346 on disk and add them to the list of things to build. This is the easy case.
347 -->
348 <CreateItem
349 Include="@(_MSBuildProjectReferenceExistent)"
350 Condition=" '$(BuildProjectReferences)' == 'true' and '$(BuildingInsideVisualStudio)' != 'true' ">
351
352 <Output TaskParameter="Include" ItemName="_ProjectReferencesToBuild" />
353 </CreateItem>
354
355 <!--
356 If BuildProjectReferences is 'wixlib' then build only the MSBuild project references that exist and
357 create a .wixlib file. That requires us to first filter the gathered project references down to only
358 those that build .wixlibs.
359 -->
360 <CreateItem
361 Include="@(_GatheredProjectReferencePaths)"
362 Condition=" '$(BuildProjectReferences)' == 'wixlib' and '%(Extension)' == '.wixlib' and '$(BuildingInsideVisualStudio)' != 'true' ">
363
364 <Output TaskParameter="Include" ItemName="_ReferencedWixLibPaths" />
365 </CreateItem>
366
367 <!--
368 The second step when building only 'wixlib' project references is to create the list of existing MSBuild
369 project references that do *not* build a .wixlib. These are the projects that will be skipped.
370 -->
371 <CreateItem
372 Include="@(_MSBuildProjectReferenceExistent->'%(FullPath)')"
373 Exclude="@(_ReferencedWixLibPaths->'%(MSBuildSourceProjectFile)')"
374 Condition=" '$(BuildProjectReferences)' == 'wixlib' and '$(BuildingInsideVisualStudio)' != 'true' ">
375
376 <Output TaskParameter="Include" ItemName="_ProjectReferencesToSkip" />
377 </CreateItem>
378
379 <!--
380 Finally, when building only 'wixlib' project references, the list of projects to build are naturally the
381 list of projects *not* being skipped.
382 -->
383 <CreateItem
384 Include="@(_MSBuildProjectReferenceExistent->'%(FullPath)')"
385 Exclude="@(_ProjectReferencesToSkip)"
386 Condition=" '$(BuildProjectReferences)' == 'wixlib' and '$(BuildingInsideVisualStudio)' != 'true' ">
387
388 <Output TaskParameter="Include" ItemName="_ProjectReferencesToBuild" />
389 </CreateItem>
390
391 <!-- Display a warning for all projects being skipped. -->
392 <Warning
393 Text="BuildProjectReferences set to '$(BuildProjectReferences)'. Skipping the non-Library project: %(_ProjectReferencesToSkip.Identity)"
394 Condition=" '@(_ProjectReferencesToSkip)' != '' " />
395
396 <Message
397 Importance="low"
398 Text="Project reference to build: %(_ProjectReferencesToBuild.Identity), properties: %(_ProjectReferencesToBuild.Properties)"
399 Condition=" '@(_ProjectReferencesToBuild)' != '' " />
400
401 <!--
402 Build referenced projects when building from the command line.
403
404 The $(ProjectReferenceBuildTargets) will normally be blank so that the project's default target
405 is used during a P2P reference. However if a custom build process requires that the referenced
406 project has a different target to build it can be specified.
407 -->
408 <MSBuild
409 Projects="@(_ProjectReferencesToBuild)"
410 Targets="$(ProjectReferenceBuildTargets)"
411 Properties="%(_ProjectReferencesToBuild.SetConfiguration);%(_ProjectReferencesToBuild.SetPlatform)"
412 Condition=" '@(_ProjectReferencesToBuild)' != '' ">
413
414 <Output TaskParameter="TargetOutputs" ItemName="_BuiltProjectReferencePaths" />
415 </MSBuild>
416
417 <!--
418 VC project references must build GetNativeTargetPath because neither GetTargetPath nor the return of the default build
419 target return the output for a native .vcxproj.
420 -->
421 <MSBuild
422 Projects="@(_MSBuildProjectReferenceExistent)"
423 Targets="GetNativeTargetPath"
424 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);%(_MSBuildProjectReferenceExistent.SetPlatform)"
425 Condition=" '@(ProjectReferenceWithConfiguration)' != '' and '%(_MSBuildProjectReferenceExistent.Extension)' == '.vcxproj' ">
426
427 <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" />
428 <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" />
429 </MSBuild>
430
431 <!-- Assign the unique gathered and built project references to the resolved project
432 reference paths. -->
433 <RemoveDuplicates Inputs="@(_GatheredProjectReferencePaths);@(_BuiltProjectReferencePaths)">
434 <Output TaskParameter="Filtered" ItemName="_ResolvedProjectReferencePaths" />
435 <Output TaskParameter="Filtered" ItemName="_MSBuildResolvedProjectReferencePaths" />
436 </RemoveDuplicates>
437
438 <!-- Create list of all .wixlib project references. -->
439 <CreateItem
440 Include="@(_ResolvedProjectReferencePaths)"
441 Condition=" '%(Extension)' == '.wixlib' ">
442
443 <Output TaskParameter="Include" ItemName="WixLibProjects" />
444 </CreateItem>
445
446 <Message
447 Importance="low"
448 Text="Library from referenced projects: %(WixLibProjects.Identity)"
449 Condition=" '@(WixLibProjects)' != '' " />
450
451 </Target>
452
453 <!--
454 ================================================================================================
455 ResolveWixLibraryReferences
456
457 Resolve the library references to full paths.
458
459 [IN]
460 @(WixLibrary) - The list of .wixlib files.
461
462 [OUT]
463 @(_ResolvedWixLibraryPaths) - Item group with full paths to libraries
464 ================================================================================================
465 -->
466 <PropertyGroup>
467 <ResolveWixLibraryReferencesDependsOn></ResolveWixLibraryReferencesDependsOn>
468 </PropertyGroup>
469 <Target
470 Name="ResolveWixLibraryReferences"
471 DependsOnTargets="$(ResolveWixLibraryReferencesDependsOn)"
472 Condition=" '@(WixLibrary)' != ''">
473
474 <!--
475 The WixLibrarySearchPaths property is set to find assemblies in the following order:
476
477 (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file.
478 (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
479 (3) Treat the reference's Include as if it were a real file name.
480 (4) Path specified by the WixExtDir property.
481 -->
482 <CreateProperty Condition=" '$(WixLibrarySearchPaths)' == '' " Value="
483 $(ReferencePaths);
484 {HintPathFromItem};
485 {RawFileName};
486 $(WixExtDir)
487 ">
488 <Output TaskParameter="Value" PropertyName="WixLibrarySearchPaths" />
489 </CreateProperty>
490
491 <ResolveWixReferences
492 WixReferences="@(WixLibrary)"
493 SearchPaths="$(WixLibrarySearchPaths)"
494 SearchFilenameExtensions=".wixlib">
495 <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixLibraryPaths" />
496 </ResolveWixReferences>
497
498 <!-- Remove duplicate library items that would cause build errors -->
499 <RemoveDuplicates Inputs="@(_AllResolvedWixLibraryPaths)">
500 <Output TaskParameter="Filtered" ItemName="_ResolvedWixLibraryPaths" />
501 </RemoveDuplicates>
502
503 </Target>
504
505 <!--
506 ==================================================================================================
507 ResolveWixExtensionReferences
508
509 Resolves WiX extension references to full paths. Any properties you use
510 to resolve paths to extensions must be defined before importing this
511 file or the extensions will be automatically resolved to $(WixExtDir).
512
513 [IN]
514 @(WixExtension) - WixExtension item group
515
516 [OUT]
517 @(_ResolvedWixExtensionPaths) - Item group with full paths to extensions
518 ==================================================================================================
519 -->
520 <PropertyGroup>
521 <ResolveWixExtensionReferencesDependsOn></ResolveWixExtensionReferencesDependsOn>
522 </PropertyGroup>
523 <Target
524 Name="ResolveWixExtensionReferences"
525 DependsOnTargets="$(ResolveWixExtensionReferencesDependsOn)"
526 Condition=" '@(WixExtension)' != ''">
527
528 <!--
529 The WixExtensionSearchPaths property is set to find assemblies in the following order:
530
531 (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file.
532 (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
533 (3) Treat the reference's Include as if it were a real file name.
534 (4) Path specified by the WixExtDir property.
535 -->
536 <CreateProperty Condition=" '$(WixExtensionSearchPaths)' == '' " Value="
537 $(ReferencePaths);
538 {HintPathFromItem};
539 {RawFileName};
540 $(WixExtDir)
541 ">
542 <Output TaskParameter="Value" PropertyName="WixExtensionSearchPaths" />
543 </CreateProperty>
544
545 <ResolveWixReferences
546 WixReferences="@(WixExtension)"
547 SearchPaths="$(WixExtensionSearchPaths)"
548 SearchFilenameExtensions=".dll">
549 <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixExtensionPaths" />
550 </ResolveWixReferences>
551
552 <!-- Remove duplicate extension items that would cause build errors -->
553 <RemoveDuplicates Inputs="@(_AllResolvedWixExtensionPaths)">
554 <Output TaskParameter="Filtered" ItemName="_ResolvedWixExtensionPaths" />
555 </RemoveDuplicates>
556 </Target>
557
558 <!--
559 ================================================================================================
560 GetTargetPath - OVERRIDE DependsOn
561
562 This stand-alone target returns the name of the build product (i.e. MSI, MSM) that would be
563 produced if we built this project.
564 ================================================================================================
565 -->
566 <PropertyGroup>
567 <GetTargetPathDependsOn>AssignTargetPaths</GetTargetPathDependsOn>
568 </PropertyGroup>
569
570
571 <!--
572 //////////////////////////////////////////////////////////////////////////////////////////////////
573 //////////////////////////////////////////////////////////////////////////////////////////////////
574 WixBuild Targets
575 //////////////////////////////////////////////////////////////////////////////////////////////////
576 //////////////////////////////////////////////////////////////////////////////////////////////////
577 -->
578
579 <!--
580 ==================================================================================================
581 WixBuild
582 ==================================================================================================
583 -->
584 <PropertyGroup>
585 <WixBuildDependsOn>
586 ResolveReferences;
587 BeforeCompile;
588 _TimeStampBeforeCompile;
589
590 CalculateDefineConstants;
591 Harvest;
592
593 GenerateCompileWithObjectPath;
594
595 AssignTargetPaths;
596 ReadPreviousBindInputsAndBuiltOutputs;
597
598 CoreWixBuild;
599
600 UpdateLinkFileWrites;
601 _TimeStampAfterCompile;
602 AfterCompile
603 </WixBuildDependsOn>
604 </PropertyGroup>
605 <Target
606 Name="WixBuild"
607 DependsOnTargets="$(WixBuildDependsOn)" />
608
609 <Target
610 Name="CoreWixBuild"
611 Inputs="@(Compile);
612 @(Content);
613 @(EmbeddedResource);
614 @(WixObject);
615 @(_ResolvedProjectReferencePaths);
616 @(_ResolvedWixLibraryPaths);
617 @(_ResolvedWixExtensionPaths);
618 @(_BindInputs);
619 $(MSBuildAllProjects)"
620 Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)"
621 Condition=" '@(Compile)' != '' ">
622
623 <PropertyGroup>
624 <!--<OutputFile>$([System.IO.Path]::GetFullPath($(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)))</OutputFile>-->
625 <OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)))</OutputFile>
626 <!--<OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)))</OutputFile>-->
627 <PdbOutputFile>$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)</PdbOutputFile>
628 </PropertyGroup>
629
630 <WixBuild
631 SourceFiles="@(_CompileWithObjectPath)"
632 LibraryFiles="@(WixLibProjects);@(_ResolvedWixLibraryPaths)"
633 LocalizationFiles="@(EmbeddedResource)"
634
635 Cultures="%(CultureGroup.Identity)"
636
637 ExtensionDirectory="$(WixExtDir)"
638 Extensions="@(_ResolvedWixExtensionPaths)"
639
640 IntermediateDirectory="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)"
641
642 OutputFile="$(OutputFile)"
643 OutputType="$(OutputType)"
644 PdbFile="$(PdbOutputFile)"
645 PdbType="$(WixPdbType)"
646
647 AdditionalOptions="$(CompilerAdditionalOptions) $(LinkerAdditionalOptions)"
648 DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)"
649 IncludeSearchPaths="$(IncludeSearchPaths)"
650 InstallerPlatform="$(InstallerPlatform)"
651 NoLogo="true"
652 Pedantic="$(Pedantic)"
653 ReferencePaths="$(ReferencePaths)"
654
655 SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings);$(LinkerSuppressSpecificWarnings)"
656 TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)"
657
658 BindInputPaths="@(LinkerBindInputPaths)"
659 BindFiles="$(LinkerBindFiles)"
660 BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)"
661 BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"
662 BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)"
663
664 CabinetCachePath="$(CabinetCachePath)"
665 CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
666 DefaultCompressionLevel="$(DefaultCompressionLevel)"
667
668 UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
669 WixProjectFile="$(ProjectPath)"
670 WixVariables="$(WixVariables)"
671
672 SuppressValidation="$(SuppressValidation)"
673 SuppressIces="$(SuppressIces)"
674 AdditionalCub="$(AdditionalCub)" />
675
676 <!--
677 SuppressAllWarnings="$(CompilerSuppressAllWarnings);$(LinkerSuppressAllWarnings)"
678 TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors);$(LinkerTreatWarningsAsErrors)"
679 VerboseOutput="$(CompilerVerboseOutput);$(LinkerVerboseOutput)"
680 -->
681 </Target>
682
683
684 <!--
685 ==================================================================================================
686 CalculateDefineConstants
687
688 Adds project references to the constants passed into the compiler.
689
690 [IN]
691 @(_ResolvedProjectReferencePaths) - paths to projects' outputs
692 $(VSProjectConfigurations) - map of project names to configurations, provided by VS when building in the IDE
693
694 [OUT]
695 $(ProjectReferenceDefineConstants) - the list of referenced project variables to be passed into the compiler
696 ==================================================================================================
697 -->
698 <PropertyGroup>
699 <CalculateDefineConstantsDependsOn>ResolveReferences</CalculateDefineConstantsDependsOn>
700 </PropertyGroup>
701 <Target
702 Name="CalculateDefineConstants"
703 DependsOnTargets="$(CalculateDefineConstantsDependsOn)"
704 Condition=" '@(_ResolvedProjectReferencePaths)' != '' ">
705
706 <PropertyGroup>
707 <ProjectDefineConstants>
708 Configuration=$(ConfigurationName);
709 OutDir=$(OutDir);
710 Platform=$(PlatformName);
711 ProjectDir=$(ProjectDir);
712 ProjectExt=$(ProjectExt);
713 ProjectFileName=$(ProjectFileName);
714 ProjectName=$(ProjectName);
715 ProjectPath=$(ProjectPath);
716 TargetDir=$(TargetDir);
717 TargetExt=$(TargetExt);
718 TargetFileName=$(TargetFileName);
719 TargetName=$(TargetName);
720 TargetPath=$(TargetPath);
721 </ProjectDefineConstants>
722 </PropertyGroup>
723
724 <PropertyGroup>
725 <SolutionDefineConstants Condition=" '$(DevEnvDir)'!='*Undefined*' ">$(SolutionDefineConstants);DevEnvDir=$(DevEnvDir)</SolutionDefineConstants>
726 <SolutionDefineConstants Condition=" '$(SolutionDir)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionDir=$(SolutionDir)</SolutionDefineConstants>
727 <SolutionDefineConstants Condition=" '$(SolutionExt)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionExt=$(SolutionExt)</SolutionDefineConstants>
728 <SolutionDefineConstants Condition=" '$(SolutionFileName)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionFileName=$(SolutionFileName)</SolutionDefineConstants>
729 <SolutionDefineConstants Condition=" '$(SolutionName)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionName=$(SolutionName)</SolutionDefineConstants>
730 <SolutionDefineConstants Condition=" '$(SolutionPath)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionPath=$(SolutionPath)</SolutionDefineConstants>
731 </PropertyGroup>
732
733 <CreateProjectReferenceDefineConstants
734 ProjectReferencePaths="@(_ResolvedProjectReferencePaths)"
735 ProjectConfigurations="$(VSProjectConfigurations)">
736
737 <Output TaskParameter="DefineConstants" PropertyName="ProjectReferenceDefineConstants" />
738 </CreateProjectReferenceDefineConstants>
739
740 <ItemGroup>
741 <LinkerBindInputPaths Include="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)" />
742 </ItemGroup>
743 </Target>
744
745 <!--
746 ================================================================================================
747 GenerateCompileWithObjectPath
748
749 Generates metadata on the for compile output objects.
750
751 ================================================================================================
752 -->
753 <PropertyGroup>
754 <GenerateCompileWithObjectPathDependsOn></GenerateCompileWithObjectPathDependsOn>
755 </PropertyGroup>
756 <Target
757 Name="GenerateCompileWithObjectPath"
758 Condition=" '@(Compile)' != '' ">
759
760 <GenerateCompileWithObjectPath
761 Compile="@(Compile)"
762 IntermediateOutputPath="$(IntermediateOutputPath)">
763 <Output TaskParameter="CompileWithObjectPath" ItemName="_CompileWithObjectPath" />
764 </GenerateCompileWithObjectPath>
765 </Target>
766
767 <!--
768 ================================================================================================
769 AssignTargetPaths - OVERRIDE Target
770
771 Determines the final list of culture groups to build based on either the Cultures property or
772 those specified in .wxl files.
773
774 Culture groups specified in the Cultures property must be specified as a semi-colon
775 delimited list of groups, with comma-delimited cultures within a group.
776 For example:
777 <Cultures>en-US,en;en-GB,en</Cultures>
778 This will build 2 targets, outputing to en-US and en-GB sub-folders. Light will first look
779 for strings in the first culture (en-US or en-GB) then the second (en).
780
781 Cultures of .wxl files will be used when the Culture property is not set. The culture of a
782 .wxl file is determined by the Culture attribute in the WixLocalization element in the file
783
784 Sets the OutputFolder metadata on each culture group. In most cases this is the same as the
785 first culture in the culture group. When the Culture's property is unspecified and no .wxl
786 files are provided this is the same as the output directory. When the Culture's property
787 specifies a single culture group and no .wxl files are provided this is the same as the output
788 directory.
789
790 Updates the TargetPath and TargetPdbPath properties to be used in subsequent targets.
791
792 [IN]
793 @(EmbeddedResource) - The list of wxl files to use for localization.
794 $(Cultures) - The list of culture groups to build.
795
796 [OUT]
797 @(CultureGroup) - The list of culture group strings with OutputFolder metadata
798 $(TargetPath) - Property list of target link output MSIs/MSMs
799 $(TargetPdbPath) - Property list of target output pdbs
800
801 ================================================================================================
802 -->
803 <Target
804 Name="AssignTargetPaths"
805 Condition=" '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' ">
806
807 <WixAssignCulture Cultures="$(Cultures)" Files="@(EmbeddedResource)">
808 <Output TaskParameter="CultureGroups" ItemName="CultureGroup" />
809 </WixAssignCulture>
810
811 <!-- Expand the culture groups then put them back into the appropriate property -->
812 <ItemGroup>
813 <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" />
814 <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" />
815 </ItemGroup>
816
817 <PropertyGroup>
818 <TargetPath>@(_CulturedTargetPath)</TargetPath>
819 <TargetPdbPath>@(_CulturedTargetPdbPath)</TargetPdbPath>
820 </PropertyGroup>
821 </Target>
822
823 <!--
824 ================================================================================================
825 ReadPreviousBindInputsAndBuiltOutputs
826
827 Reads a previous build's Bind contents and built outputs file into @(_BindInputs) and
828 @(_BindBuiltOutputs) respectively.
829
830 Note: Only the *built* outputs are used because using files copied to output folder
831 can cause perpetual incremental build.
832
833 Imagine the case where you have: Msi.wixproj -> Lib.wixproj -> Exe.csproj. The
834 Exe.csproj cannot be both an input to Lib.wixproj and an output of Msi.wixproj
835 (as an uncompressed file) because the Lib.wixproj will always newer than the
836 Exe.csproj.
837
838 [IN]
839
840 [OUT]
841 @(_BindInputs) - the content files required to bind (i.e. the Binary/@SourceFile and File/@Source files).
842 @(_BindBuiltOutputs) - the previously built .msi, .msm, .pcp, .exe .wixpdb, .cabs, etc.
843 Does not include content copied to output folder.
844 ================================================================================================
845 -->
846 <Target
847 Name="ReadPreviousBindInputsAndBuiltOutputs">
848
849 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)">
850 <Output TaskParameter="Lines" ItemName="_BindInputs" />
851 </ReadLinesFromFile>
852
853 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
854 <Output TaskParameter="Lines" ItemName="_BindBuiltOutputs" />
855 </ReadLinesFromFile>
856
857 <Message Importance="low" Text="Previous bind inputs: @(_BindInputs)" />
858 <Message Importance="low" Text="Previous bind outputs: @(_BindBuiltOutputs)" />
859 </Target>
860
861 <!--
862 ================================================================================================
863 UpdateLinkFileWrites
864
865 Reads the bind outputs file(s) output generated during WixBuild to correctly set the @(FileWrites)
866 item. Most targets have it easy because they can do a static mapping from inputs to the outputs.
867 However, the WixBuild target outputs are determined after a rather complex calculation we call
868 linking and binding!
869
870 This target runs independently after Link to ensure that @(FileWrites) is updated even if the
871 "WixBuild" task fails.
872
873 [IN]
874 Path to bind outputs file(s).
875
876 [OUT]
877 @(FileWrites) updated with outputs from bind.
878 ================================================================================================
879 -->
880 <Target
881 Name="UpdateLinkFileWrites">
882
883 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)">
884 <Output TaskParameter="Lines" ItemName="FileWrites"/>
885 </ReadLinesFromFile>
886
887 <ItemGroup>
888 <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)') " />
889 <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)') " />
890 <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)') " />
891 </ItemGroup>
892
893 <Message Importance="low" Text="Build files after link: @(FileWrites)" />
894 </Target>
895
896 <!--
897 //////////////////////////////////////////////////////////////////////////////////////////////////
898 //////////////////////////////////////////////////////////////////////////////////////////////////
899 AllProjectOutputGroups Section
900 //////////////////////////////////////////////////////////////////////////////////////////////////
901 //////////////////////////////////////////////////////////////////////////////////////////////////
902 -->
903
904 <!--
905 ==================================================================================================
906 AllProjectOutputGroups - OVERRIDE Target
907
908 ==================================================================================================
909 -->
910 <Target
911 Name="AllProjectOutputGroups"
912 DependsOnTargets="
913 BuiltProjectOutputGroup;
914 DebugSymbolsProjectOutputGroup;
915 SourceFilesProjectOutputGroup;
916 ContentFilesProjectOutputGroup" />
917
918 <!--
919 This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE.
920 Reading an item is faster than invoking a target.
921 -->
922 <ItemGroup>
923 <BuiltProjectOutputGroupKeyOutput Include="$(TargetPath)">
924 <IsKeyOutput>true</IsKeyOutput>
925 <FinalOutputPath>$(TargetPath)</FinalOutputPath>
926 <TargetPath>$(TargetFileName)</TargetPath>
927 </BuiltProjectOutputGroupKeyOutput>
928 </ItemGroup>
929
930 <!--
931 ==================================================================================================
932 BuiltProjectOutputGroup - OVERRIDE Target
933 ==================================================================================================
934 -->
935 <PropertyGroup>
936 <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</BuiltProjectOutputGroupDependsOn>
937 </PropertyGroup>
938 <Target
939 Name="BuiltProjectOutputGroup"
940 Outputs="@(BuiltProjectOutputGroupOutput)"
941 DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)">
942
943 <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below -->
944
945 <!-- Try to read the outputs from the bind outputs text file since that's the output list straight from linker. -->
946 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
947 <Output TaskParameter="Lines" ItemName="_BuiltProjectOutputGroupOutputIntermediate"/>
948 </ReadLinesFromFile>
949
950 <!-- If we didn't get anything from the bind outputs text file, default to the target path. -->
951 <ItemGroup Condition=" '@(_BuiltProjectOutputGroupOutputIntermediate)'=='' ">
952 <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" />
953 </ItemGroup>
954
955 <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
956 <ItemGroup>
957 <BuiltProjectOutputGroupOutput Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')">
958 <!-- For compatibility with 2.0 -->
959 <OriginalItemSpec Condition="'%(_BuiltProjectOutputGroupOutputIntermediate.OriginalItemSpec)' == ''">%(_BuiltProjectOutputGroupOutputIntermediate.FullPath)</OriginalItemSpec>
960 </BuiltProjectOutputGroupOutput>
961 </ItemGroup>
962 </Target>
963
964 <!--
965 ==================================================================================================
966 DebugSymbolsProjectOutputGroup
967
968 Populates the Debug Symbols project output group.
969 ==================================================================================================
970 -->
971 <PropertyGroup>
972 <DebugSymbolsProjectOutputGroupDependsOn>AssignTargetPaths</DebugSymbolsProjectOutputGroupDependsOn>
973 </PropertyGroup>
974 <Target
975 Name="DebugSymbolsProjectOutputGroup"
976 Outputs="@(DebugSymbolsProjectOutputGroupOutput)"
977 DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)">
978
979 <!-- Include build output pdb(s). Different than predefined itemgroup since AssignTargetPaths target may change -->
980 <ItemGroup>
981 <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(SuppressPdbOutput)' != 'true' "/>
982 </ItemGroup>
983 </Target>
984
985
986 <!--
987 ==================================================================================================
988 CopyFilesToOutputDirectory - OVERRIDE Target
989
990 Copy all build outputs, satellites and other necessary files to the final directory.
991 ============================================================
992 -->
993 <Target
994 Name="CopyFilesToOutputDirectory">
995
996 <PropertyGroup>
997 <!-- By default we're using hard links to copy to the output directory, disabling this could slow the build significantly -->
998 <CreateHardLinksForCopyFilesToOutputDirectoryIfPossible Condition=" '$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)' == '' ">true</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>
999 </PropertyGroup>
1000
1001 <PropertyGroup>
1002 <CopyBuildOutputToOutputDirectory Condition="'$(CopyBuildOutputToOutputDirectory)'==''">true</CopyBuildOutputToOutputDirectory>
1003 <CopyOutputSymbolsToOutputDirectory Condition="'$(CopyOutputSymbolsToOutputDirectory)'==''">true</CopyOutputSymbolsToOutputDirectory>
1004 <FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)))</FullIntermediateOutputPath>
1005 </PropertyGroup>
1006
1007 <!-- Copy the bound files. -->
1008 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
1009 <Output TaskParameter="Lines" ItemName="_FullPathToCopy"/>
1010 </ReadLinesFromFile>
1011
1012 <ItemGroup>
1013 <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " />
1014 <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" />
1015 </ItemGroup>
1016
1017 <Copy
1018 SourceFiles="@(_RelativePath->'$(IntermediateOutputPath)%(Identity)')"
1019 DestinationFiles="@(_RelativePath->'$(OutDir)%(Identity)')"
1020 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
1021 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
1022 Retries="$(CopyRetryCount)"
1023 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
1024 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
1025 Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'"
1026 >
1027
1028 <Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/>
1029 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
1030
1031 </Copy>
1032
1033 <Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(TargetPath)" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />
1034 <!--<Message Importance="High" Text="$(MSBuildProjectName) -&gt; @(MainAssembly->'%(FullPath)')" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />-->
1035
1036 <!-- Copy the debug information file (.pdb), if any
1037 <Copy
1038 SourceFiles="@(_DebugSymbolsIntermediatePath)"
1039 DestinationFiles="@(_DebugSymbolsOutputPath)"
1040 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
1041 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
1042 Retries="$(CopyRetryCount)"
1043 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
1044 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
1045 Condition="'$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)'=='true'">
1046
1047 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
1048
1049 </Copy>
1050 -->
1051 </Target>
1052
1053
1054 <Import Project="$(WixHarvestTargetsPath)" Condition=" '$(WixHarvestTargetsPath)' != '' and Exists('$(WixHarvestTargetsPath)')" />
1055 <Import Project="$(WixSigningTargetsPath)" Condition=" '$(WixSigningTargetsPath)' != '' and Exists('$(WixSigningTargetsPath)')" />
1056
1057 <!-- Extension point: Define CustomAfterWixTargets to a .targets file that you want to include after this file. -->
1058 <Import Project="$(CustomAfterWixTargets)" Condition=" '$(CustomAfterWixTargets)' != '' and Exists('$(CustomAfterWixTargets)')" />
1059
1060</Project>