~jterrell/nunitv2/nunitv2

« back to all changes in this revision

Viewing changes to tools/WiX/wix2010.targets

  • Committer: Charlie Poole
  • Date: 2012-02-02 01:55:11 UTC
  • mfrom: (3368.1.11 work)
  • Revision ID: charlie@nunit.org-20120202015511-0sspxs5miu16uzse
Merge changes from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<!--
 
3
****************************************************************************************************
 
4
wix.targets
 
5
 
 
6
WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
 
7
          created a backup copy.  Incorrect changes to this file will make it
 
8
          impossible to load or build your projects from the command-line or the IDE.
 
9
 
 
10
This file defines the steps in the standard build process for WiX projects (.wixproj).
 
11
 
 
12
Conventions:
 
13
  * Targets and properties that start with an underscore (_) are considered private and should not
 
14
    be used outside of this file.
 
15
 
 
16
Coding Conventions:
 
17
  * Two-space indentation of nested elements
 
18
 
 
19
  * Self-closing elements should have a space before the /> ("<MyProperty />")
 
20
 
 
21
  * Conditions should have a space before and after the "" and between any operators. For example:
 
22
    <MyProperty Condition=" '$(MyProperty)' == '' ">Value</MyProperty>
 
23
 
 
24
  * Targets should have each attribute on a single line and indented by two spaces. Also, there
 
25
    should be a blank line between the Target and the beginning of the contents (a blank line is
 
26
    optional before the closing </Target> tag).
 
27
    For example:
 
28
    <Target
 
29
      Name="MyTarget"
 
30
      DependsOnTargets="$(MyTargetDependsOn)">
 
31
 
 
32
      <Message Importance="low" Text="MyTarget is doing something." />
 
33
    </Target>
 
34
 
 
35
Copyright (c) Microsoft Corporation. All rights reserved.
 
36
****************************************************************************************************
 
37
-->
 
38
<Project
 
39
  xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
 
40
  InitialTargets="_CheckForInvalidConfigurationAndPlatform;
 
41
                  _CheckRequiredProperties">
 
42
  <!--
 
43
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
44
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
45
  Extension Points
 
46
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
47
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
48
  -->
 
49
 
 
50
  <!-- Allow a user-customized targets files to be used as part of the build. -->
 
51
  <PropertyGroup>
 
52
    <UserTargetsPath>$(MSBuildProjectFullPath).user</UserTargetsPath>
 
53
  </PropertyGroup>
 
54
  <Import Project="$(UserTargetsPath)" Condition="Exists('$(UserTargetsPath)')" />
 
55
  <Import Project="$(CustomBeforeWixTargets)" Condition=" '$(CustomBeforeWixTargets)' != '' and Exists('$(CustomBeforeWixTargets)')" />
 
56
 
 
57
  <!-- These properties can be overridden to support non-default installations. -->
 
58
  <PropertyGroup>
 
59
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
 
60
    <WixTasksPath Condition=" '$(WixTasksPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\WixTasks.dll</WixTasksPath>
 
61
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
 
62
    <WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\WixTasks.dll</WixTasksPath>
 
63
    <LuxTargetsPath Condition=" '$(LuxTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Lux.targets</LuxTargetsPath>
 
64
    <LuxTasksPath Condition=" '$(LuxTasksPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\LuxTasks.dll</LuxTasksPath>
 
65
    <LuxTargetsPath Condition=" '$(LuxTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Lux.targets</LuxTargetsPath>
 
66
    <LuxTasksPath Condition=" '$(LuxTasksPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\LuxTasks.dll</LuxTasksPath>
 
67
  </PropertyGroup>
 
68
 
 
69
  <!-- This makes the project files a dependency of all targets so that things rebuild if they change -->
 
70
  <PropertyGroup> 
 
71
    <MSBuildAllProjects Condition="Exists('$(MSBuildProjectFullPath)')">$(MSBuildAllProjects);$(MSBuildProjectFullPath)</MSBuildAllProjects>
 
72
    <MSBuildAllProjects Condition="Exists('$(WixTargetsPath)')">$(MSBuildAllProjects);$(WixTargetsPath)</MSBuildAllProjects>
 
73
    <MSBuildAllProjects Condition="Exists('$(LuxTargetsPath)')">$(MSBuildAllProjects);$(LuxTargetsPath)</MSBuildAllProjects>
 
74
    <MSBuildAllProjects Condition="Exists('$(UserTargetsPath)')">$(MSBuildAllProjects);$(UserTargetsPath)</MSBuildAllProjects>
 
75
    <MSBuildAllProjects Condition="Exists('$(CustomBeforeWixTargets)')">$(MSBuildAllProjects);$(CustomBeforeWixTargets)</MSBuildAllProjects>
 
76
    <MSBuildAllProjects Condition="Exists('$(CustomAfterWixTargets)')">$(MSBuildAllProjects);$(CustomAfterWixTargets)</MSBuildAllProjects>
 
77
  </PropertyGroup>
 
78
 
 
79
  <!--
 
80
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
81
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
82
  Property Declarations
 
83
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
84
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
85
  -->
 
86
 
 
87
  <!-- These tasks can be used as general-purpose build tasks. -->
 
88
  <UsingTask TaskName="Candle" AssemblyFile="$(WixTasksPath)" />
 
89
  <UsingTask TaskName="Insignia" AssemblyFile="$(WixTasksPath)" />
 
90
  <UsingTask TaskName="Lit" AssemblyFile="$(WixTasksPath)" />
 
91
  <UsingTask TaskName="Light" AssemblyFile="$(WixTasksPath)" />
 
92
  <UsingTask TaskName="Torch" AssemblyFile="$(WixTasksPath)" />
 
93
 
 
94
  <!-- These tasks are extensions for harvesting WiX source code from other sources. -->
 
95
  <UsingTask TaskName="HeatFile" AssemblyFile="$(WixTasksPath)" />
 
96
  <UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixTasksPath)" />
 
97
  <UsingTask TaskName="HeatProject" AssemblyFile="$(WixTasksPath)" />
 
98
 
 
99
  <!-- These tasks are specific to the build process defined in this file, and are not considered general-purpose build tasks. -->
 
100
  <UsingTask TaskName="AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 
101
  <UsingTask TaskName="AssignTargetPath" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 
102
  <UsingTask TaskName="ResolveNonMSBuildProjectOutput" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 
103
  <UsingTask TaskName="ResolveVCProjectOutput" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 
104
 
 
105
  <UsingTask TaskName="CreateProjectReferenceDefineConstants" AssemblyFile="$(WixTasksPath)" />
 
106
  <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" />
 
107
  <UsingTask TaskName="ResolveWixReferences" AssemblyFile="$(WixTasksPath)"/>
 
108
  <UsingTask TaskName="ReplaceString" AssemblyFile="$(WixTasksPath)"/>
 
109
  <UsingTask TaskName="GetCabList" AssemblyFile="$(WixTasksPath)" />
 
110
  <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" />
 
111
  <UsingTask TaskName="RefreshGeneratedFile" AssemblyFile="$(WixTasksPath)"/>
 
112
  <UsingTask TaskName="RefreshBundleGeneratedFile" AssemblyFile="$(WixTasksPath)"/>
 
113
 
 
114
  <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is not 32bit. -->
 
115
  <PropertyGroup>
 
116
    <RunWixToolsOutOfProc Condition=" '$(PROCESSOR_ARCHITECTURE)'!='x86' ">true</RunWixToolsOutOfProc>
 
117
  </PropertyGroup>
 
118
 
 
119
  <!--
 
120
  Several properties must be set in the main project file, before using this .targets file.
 
121
  However, if the properties are not set, we pick some defaults.
 
122
 
 
123
  OutDir:
 
124
  Indicates the final output location for the project or solution. When building a solution,
 
125
  OutDir can be used to gather multiple project outputs in one location. In addition,
 
126
  OutDir is included in AssemblySearchPaths used for resolving references.
 
127
 
 
128
  OutputPath:
 
129
  This property is usually specified in the project file and is used to initialize OutDir.
 
130
  OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.
 
131
 
 
132
  BaseIntermediateOutputPath:
 
133
  This is the top level folder where all configuration specific intermediate output folders will be created.
 
134
  Default value is obj\
 
135
 
 
136
  IntermediateOutputPath:
 
137
  This is the full intermediate Output Path, and is derived from BaseIntermediateOutputPath, if none specified
 
138
  (eg. obj\debug). If this property is overridden, then setting BaseIntermediateOutputPath has no effect.
 
139
  -->
 
140
 
 
141
  <PropertyGroup>
 
142
    <!-- Ensure any OutputPath has a trailing slash, so it can be concatenated -->
 
143
    <OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
 
144
    <AssemblyName Condition=" '$(AssemblyName)'=='' ">$(MSBuildProjectName)</AssemblyName>
 
145
    <!--
 
146
    Be careful not to give OutputPath a default value in the case of an invalid Configuration/Platform.
 
147
    We use OutputPath specifically to check for invalid configurations/platforms.
 
148
    -->
 
149
    <OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
 
150
    <_OriginalConfiguration>$(Configuration)</_OriginalConfiguration>
 
151
    <_OriginalPlatform>$(Platform)</_OriginalPlatform>
 
152
    <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>
 
153
    <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName>      <!-- Example, Debug -->
 
154
    <Platform Condition=" '$(Platform)'=='' ">AnyCPU</Platform>
 
155
    <_OriginalOutputType>$(OutputType)</_OriginalOutputType>
 
156
    <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType>
 
157
    <BuildProjectReferences Condition="'$(BuildProjectReferences)' == ''">true</BuildProjectReferences>
 
158
  </PropertyGroup>
 
159
 
 
160
  <PropertyGroup Condition=" '$(OutputPath)' == '' ">
 
161
      <!--
 
162
      A blank OutputPath at this point means that the user passed in an invalid Configuration/Platform
 
163
      combination.  Whether this is considered an error or a warning depends on the value of
 
164
      $(SkipInvalidConfigurations).
 
165
      -->
 
166
      <_InvalidConfigurationError Condition=" '$(SkipInvalidConfigurations)' != 'true' ">true</_InvalidConfigurationError>
 
167
      <_InvalidConfigurationWarning Condition=" '$(SkipInvalidConfigurations)' == 'true' ">true</_InvalidConfigurationWarning>
 
168
  </PropertyGroup>
 
169
 
 
170
  <!-- Properties for the intermediate object output -->
 
171
  <PropertyGroup>
 
172
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">obj\</BaseIntermediateOutputPath>
 
173
    <BaseIntermediateOutputPath Condition="!HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
 
174
    <IntermediateExt Condition=" '$(IntermediateExt)' == '' ">.wixobj</IntermediateExt>
 
175
    <CleanFile Condition=" '$(CleanFile)' == '' ">$(MSBuildProjectFile).FileList.txt</CleanFile>
 
176
  </PropertyGroup>
 
177
 
 
178
  <PropertyGroup Condition=" $(IntermediateOutputPath) == '' ">
 
179
      <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
 
180
      <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU' ">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
 
181
  </PropertyGroup>
 
182
  <PropertyGroup>
 
183
      <IntermediateOutputPath Condition="!HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
 
184
  </PropertyGroup>
 
185
  <ItemGroup>
 
186
      <IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"/>
 
187
      <FinalDocFile Include="@(DocFileItem->'$(OutDir)%(Filename)%(Extension)')"/>
 
188
  </ItemGroup>
 
189
 
 
190
  <PropertyGroup>
 
191
    <WixToolPath Condition=" '$(WixToolPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.5@InstallRoot)</WixToolPath>
 
192
    <WixToolPath Condition=" '$(WixToolPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.5@InstallRoot)</WixToolPath>
 
193
    <WixExtDir Condition=" '$(WixExtDir)' == ''">$(WixToolPath)</WixExtDir>
 
194
  </PropertyGroup>
 
195
 
 
196
  <!--
 
197
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
198
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
199
  IDE Macro Property Declarations
 
200
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
201
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
202
  -->
 
203
 
 
204
  <!--
 
205
  IDE Macros available from both integrated builds and from command line builds.
 
206
  The following properties are 'macros' that are available via IDE for pre and post build steps.
 
207
  All of them should be added to WixBuildMacroCollection to ensure that they are shown in the UI.
 
208
  -->
 
209
  <PropertyGroup>
 
210
    <TargetExt Condition=" '$(OutputType)' == 'Package' ">.msi</TargetExt>
 
211
    <TargetExt Condition=" '$(OutputType)' == 'Module' ">.msm</TargetExt>
 
212
    <TargetExt Condition=" '$(OutputType)' == 'PatchCreation' ">.pcp</TargetExt>
 
213
    <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt>
 
214
    <TargetExt Condition=" '$(OutputType)' == 'Bundle' ">.exe</TargetExt>
 
215
  </PropertyGroup>
 
216
 
 
217
  <PropertyGroup>
 
218
    <!-- Example, bin\Debug\ -->
 
219
    <OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>
 
220
    <!-- Ensure OutDir has a trailing slash, so it can be concatenated -->
 
221
    <OutDir Condition=" '$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)') ">$(OutDir)\</OutDir>
 
222
 
 
223
    <!-- Example, MySetup -->
 
224
    <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
 
225
 
 
226
    <!-- Example, MySetup.wixproj -->
 
227
    <ProjectFileName Condition=" '$(ProjectFileName)' == '' ">$(MSBuildProjectFile)</ProjectFileName>
 
228
 
 
229
    <!-- Example, .wixproj -->
 
230
    <ProjectExt Condition=" '$(ProjectExt)' == '' ">$(MSBuildProjectExtension)</ProjectExt>
 
231
 
 
232
    <!-- Example, c:\MyProjects\MySetup\ -->
 
233
    <ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\</ProjectDir>
 
234
 
 
235
    <!-- Example, c:\MyProjects\MySetup\MySetup.msi -->
 
236
    <ProjectPath Condition=" '$(ProjectPath)' == '' ">$(ProjectDir)$(ProjectFileName)</ProjectPath>
 
237
 
 
238
    <!-- Example, .wixpdb -->
 
239
    <TargetPdbExt Condition=" '$(TargetPdbExt)' == '' ">.wixpdb</TargetPdbExt>
 
240
 
 
241
    <!-- Example, MySetup -->
 
242
    <TargetName Condition=" '$(TargetName)' == '' ">$(OutputName)</TargetName>
 
243
 
 
244
    <!-- Example, MySetup.msi -->
 
245
    <TargetFileName Condition=" '$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
 
246
 
 
247
    <!-- Example, MySetup.wixpdb" -->
 
248
    <TargetPdbName Condition=" '$(TargetPdbName)' == '' ">$(TargetName)$(TargetPdbExt)</TargetPdbName>
 
249
 
 
250
    <!-- Example, Debug -->
 
251
    <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName>
 
252
 
 
253
    <!-- Example, AnyCPU -->
 
254
    <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
 
255
  </PropertyGroup>
 
256
 
 
257
  <ItemGroup>
 
258
    <!-- Create the output path as an item so that we can use %(FullPath) on it. -->
 
259
    <_OutputPathItem Include="$(OutDir)" />
 
260
    <_IntermediateOutputPathItem Include="$(IntermediateOutputPath)" />
 
261
  </ItemGroup>
 
262
 
 
263
  <PropertyGroup>
 
264
    <!-- Example, c:\MyProjects\MySetup\bin\debug\ -->
 
265
    <!--
 
266
    Condition intentionally omitted on this one, because it causes problems
 
267
    when we pick up the value of an environment variable named TargetDir
 
268
    -->
 
269
    <TargetDir Condition="'$(OutDir)' != ''">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`))</TargetDir>
 
270
 
 
271
    <!-- Example, C:\MyProjects\MySetup\bin\debug\MySetup.msi -->
 
272
    <TargetPath Condition=" '$(TargetPath)' == '' ">$(TargetDir)$(TargetFileName)</TargetPath>
 
273
 
 
274
    <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetDir)$(TargetPdbName)</TargetPdbPath>
 
275
  </PropertyGroup>
 
276
 
 
277
  <!--
 
278
  IDE Macros available only from integrated builds. The following properties are 'macros' that are
 
279
  available via IDE for pre and post build steps. However, they are not defined when directly
 
280
  building a project from the command line, only when building a solution.
 
281
  -->
 
282
  <PropertyGroup>
 
283
    <DevEnvDir Condition=" '$(DevEnvDir)' == '' ">*Undefined if not building from within Visual Studio*</DevEnvDir>
 
284
 
 
285
    <!-- Example, MySolution -->
 
286
    <SolutionName Condition=" '$(SolutionName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionName>
 
287
 
 
288
    <!-- Example, MySolution.sln -->
 
289
    <SolutionFileName Condition=" '$(SolutionFileName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionFileName>
 
290
 
 
291
    <!-- Example, C:\MySolutions\MySolution\MySolution.sln -->
 
292
    <SolutionPath Condition=" '$(SolutionPath)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionPath>
 
293
 
 
294
    <!-- Example, C:\MySolutions\MySolution\ -->
 
295
    <SolutionDir Condition=" '$(SolutionDir)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionDir>
 
296
 
 
297
    <!-- Example, .sln -->
 
298
    <SolutionExt Condition=" '$(SolutionExt)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionExt>
 
299
  </PropertyGroup>
 
300
 
 
301
  <!--
 
302
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
303
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
304
  Default Harvester, Compiler, Linker, and Librarian Property Declarations
 
305
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
306
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
307
  -->
 
308
 
 
309
  <!-- If WixExtension was passed in via the command line, then convert it to an ItemGroup -->
 
310
  <ItemGroup>
 
311
    <WixExtension Include="$(WixExtension)"  Condition=" '$(WixExtension)' != '' " />
 
312
  </ItemGroup>
 
313
 
 
314
  <!-- Default Harvester properties-->
 
315
  <PropertyGroup>
 
316
    <HarvestNoLogo Condition=" '$(HarvestNoLogo)' == '' ">$(NoLogo)</HarvestNoLogo>
 
317
    <HarvestSuppressAllWarnings Condition=" '$(HarvestSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</HarvestSuppressAllWarnings>
 
318
    <HarvestSuppressSpecificWarnings Condition=" '$(HarvestSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</HarvestSuppressSpecificWarnings>
 
319
    <HarvestTreatWarningsAsErrors Condition=" '$(HarvestTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</HarvestTreatWarningsAsErrors>
 
320
    <HarvestTreatSpecificWarningsAsErrors Condition=" '$(HarvestTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</HarvestTreatSpecificWarningsAsErrors>
 
321
    <HarvestVerboseOutput Condition=" '$(HarvestVerboseOutput)' == '' ">$(VerboseOutput)</HarvestVerboseOutput>
 
322
    <HarvestAutogenerateGuids Condition=" '$(HarvestAutogenerateGuids)' == '' ">true</HarvestAutogenerateGuids>
 
323
    <HarvestGenerateGuidsNow Condition=" '$(HarvestGenerateGuidsNow)' == '' ">false</HarvestGenerateGuidsNow>
 
324
    <HarvestSuppressFragments Condition=" '$(HarvestSuppressFragments)' == '' ">true</HarvestSuppressFragments>
 
325
    <HarvestSuppressUniqueIds Condition=" '$(HarvestSuppressUniqueIds)' == '' ">false</HarvestSuppressUniqueIds>
 
326
  </PropertyGroup>
 
327
 
 
328
  <!-- Default HarvestProjects properties -->
 
329
  <PropertyGroup>
 
330
    <HarvestProjectsNoLogo Condition=" '$(HarvestProjectsNoLogo)' == '' ">$(HarvestNoLogo)</HarvestProjectsNoLogo>
 
331
    <HarvestProjectsSuppressAllWarnings Condition=" '$(HarvestProjectsSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestProjectsSuppressAllWarnings>
 
332
    <HarvestProjectsSuppressSpecificWarnings Condition=" '$(HarvestProjectsSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestProjectsSuppressSpecificWarnings>
 
333
    <HarvestProjectsTreatWarningsAsErrors Condition=" '$(HarvestProjectsTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestProjectsTreatWarningsAsErrors>
 
334
    <HarvestProjectsTreatSpecificWarningsAsErrors Condition=" '$(HarvestProjectsTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestProjectsTreatSpecificWarningsAsErrors>
 
335
    <HarvestProjectsVerboseOutput Condition=" '$(HarvestProjectsVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestProjectsVerboseOutput>
 
336
    <HarvestProjectsAutogenerateGuids Condition=" '$(HarvestProjectsAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestProjectsAutogenerateGuids>
 
337
    <HarvestProjectsGenerateGuidsNow Condition=" '$(HarvestProjectsGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestProjectsGenerateGuidsNow>
 
338
    <HarvestProjectsSuppressFragments Condition=" '$(HarvestProjectsSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestProjectsSuppressFragments>
 
339
    <HarvestProjectsSuppressUniqueIds Condition=" '$(HarvestProjectsSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestProjectsSuppressUniqueIds>
 
340
    <HarvestProjectsTransforms Condition=" '$(HarvestProjectsTransforms)' == '' ">$(HarvestTransforms)</HarvestProjectsTransforms>
 
341
    <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' != 'Bundle' ">$(IntermediateOutputPath)Product.Generated.wxs</HarvestProjectsGeneratedFile>
 
342
    <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' == 'Bundle' ">$(IntermediateOutputPath)Bundle.Generated.wxs</HarvestProjectsGeneratedFile>
 
343
  </PropertyGroup>
 
344
 
 
345
  <!-- Default HarvestDirectory properties -->
 
346
  <PropertyGroup>
 
347
    <HarvestDirectoryNoLogo Condition=" '$(HarvestDirectoryNoLogo)' == '' ">$(HarvestNoLogo)</HarvestDirectoryNoLogo>
 
348
    <HarvestDirectorySuppressAllWarnings Condition=" '$(HarvestDirectorySuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestDirectorySuppressAllWarnings>
 
349
    <HarvestDirectorySuppressSpecificWarnings Condition=" '$(HarvestDirectorySuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestDirectorySuppressSpecificWarnings>
 
350
    <HarvestDirectoryTreatWarningsAsErrors Condition=" '$(HarvestDirectoryTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestDirectoryTreatWarningsAsErrors>
 
351
    <HarvestDirectoryTreatSpecificWarningsAsErrors Condition=" '$(HarvestDirectoryTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestDirectoryTreatSpecificWarningsAsErrors>
 
352
    <HarvestDirectoryVerboseOutput Condition=" '$(HarvestDirectoryVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestDirectoryVerboseOutput>
 
353
    <HarvestDirectoryAutogenerateGuids Condition=" '$(HarvestDirectoryAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestDirectoryAutogenerateGuids>
 
354
    <HarvestDirectoryGenerateGuidsNow Condition=" '$(HarvestDirectoryGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestDirectoryGenerateGuidsNow>
 
355
    <HarvestDirectorySuppressFragments Condition=" '$(HarvestDirectorySuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestDirectorySuppressFragments>
 
356
    <HarvestDirectorySuppressUniqueIds Condition=" '$(HarvestDirectorySuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestDirectorySuppressUniqueIds>
 
357
    <HarvestDirectoryTransforms Condition=" '$(HarvestDirectoryTransforms)' == '' ">$(HarvestTransforms)</HarvestDirectoryTransforms>
 
358
  </PropertyGroup>
 
359
 
 
360
  <!-- Default HarvestFile properties -->
 
361
  <PropertyGroup>
 
362
    <HarvestFileNoLogo Condition=" '$(HarvestFileNoLogo)' == '' ">$(HarvestNoLogo)</HarvestFileNoLogo>
 
363
    <HarvestFileSuppressAllWarnings Condition=" '$(HarvestFileSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestFileSuppressAllWarnings>
 
364
    <HarvestFileSuppressSpecificWarnings Condition=" '$(HarvestFileSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestFileSuppressSpecificWarnings>
 
365
    <HarvestFileTreatWarningsAsErrors Condition=" '$(HarvestFileTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestFileTreatWarningsAsErrors>
 
366
    <HarvestFileTreatSpecificWarningsAsErrors Condition=" '$(HarvestFileTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestFileTreatSpecificWarningsAsErrors>
 
367
    <HarvestFileVerboseOutput Condition=" '$(HarvestFileVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestFileVerboseOutput>
 
368
    <HarvestFileAutogenerateGuids Condition=" '$(HarvestFileAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestFileAutogenerateGuids>
 
369
    <HarvestFileGenerateGuidsNow Condition=" '$(HarvestFileGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestFileGenerateGuidsNow>
 
370
    <HarvestFileSuppressFragments Condition=" '$(HarvestFileSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestFileSuppressFragments>
 
371
    <HarvestFileSuppressUniqueIds Condition=" '$(HarvestFileSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestFileSuppressUniqueIds>
 
372
    <HarvestFileTransforms Condition=" '$(HarvestFileTransforms)' == '' ">$(HarvestTransforms)</HarvestFileTransforms>
 
373
  </PropertyGroup>
 
374
 
 
375
  <!-- Defaut Compiler properties. -->
 
376
  <PropertyGroup>
 
377
    <CompilerNoLogo Condition=" '$(CompilerNoLogo)' == '' ">$(NoLogo)</CompilerNoLogo>
 
378
    <CompilerSuppressAllWarnings Condition=" '$(CompilerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</CompilerSuppressAllWarnings>
 
379
    <CompilerSuppressSpecificWarnings Condition=" '$(CompilerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</CompilerSuppressSpecificWarnings>
 
380
    <CompilerSuppressSchemaValidation Condition=" '$(CompilerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</CompilerSuppressSchemaValidation>
 
381
    <CompilerTreatWarningsAsErrors Condition=" '$(CompilerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</CompilerTreatWarningsAsErrors>
 
382
    <CompilerTreatSpecificWarningsAsErrors Condition=" '$(CompilerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</CompilerTreatSpecificWarningsAsErrors>
 
383
    <CompilerVerboseOutput Condition=" '$(CompilerVerboseOutput)' == '' ">$(VerboseOutput)</CompilerVerboseOutput>
 
384
    <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and '$(Platform)' != 'AnyCPU' and '$(Platform)' != 'Any CPU' ">$(Platform)</InstallerPlatform>
 
385
  </PropertyGroup>
 
386
 
 
387
  <!-- Default Lib properties. -->
 
388
  <PropertyGroup>
 
389
    <LibNoLogo Condition=" '$(LibNoLogo)' == '' ">$(NoLogo)</LibNoLogo>
 
390
    <LibBindFiles Condition=" '$(LibBindFiles)' == '' ">$(BindFiles)</LibBindFiles>
 
391
    <LibPedantic Condition=" '$(LibPedantic)' == '' ">$(Pedantic)</LibPedantic>
 
392
    <LibSuppressAllWarnings Condition=" '$(LibSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LibSuppressAllWarnings>
 
393
    <LibSuppressSpecificWarnings Condition=" '$(LibSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LibSuppressSpecificWarnings>
 
394
    <LibSuppressSchemaValidation Condition=" '$(LibSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LibSuppressSchemaValidation>
 
395
    <LibSuppressIntermediateFileVersionMatching Condition=" '$(LibSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LibSuppressIntermediateFileVersionMatching>
 
396
    <LibTreatWarningsAsErrors Condition=" '$(LibTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LibTreatWarningsAsErrors>
 
397
    <LibTreatSpecificWarningsAsErrors Condition=" '$(LibTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LibTreatSpecificWarningsAsErrors>
 
398
    <LibVerboseOutput Condition=" '$(LibVerboseOutput)' == '' ">$(VerboseOutput)</LibVerboseOutput>
 
399
  </PropertyGroup>
 
400
 
 
401
  <!-- Default Linker properties. -->
 
402
  <PropertyGroup>
 
403
    <LinkerNoLogo Condition=" '$(LinkerNoLogo)' == '' ">$(NoLogo)</LinkerNoLogo>
 
404
    <LinkerBaseInputPaths Condition=" '$(LinkerBaseInputPaths)' == '' ">$(BaseInputPaths)</LinkerBaseInputPaths>
 
405
    <LinkerBindFiles Condition=" '$(LinkerBindFiles)' == '' ">$(BindFiles)</LinkerBindFiles>
 
406
    <LinkerPedantic Condition=" '$(LinkerPedantic)' == '' ">$(Pedantic)</LinkerPedantic>
 
407
    <LinkerSuppressAllWarnings Condition=" '$(LinkerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LinkerSuppressAllWarnings>
 
408
    <LinkerSuppressSpecificWarnings Condition=" '$(LinkerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LinkerSuppressSpecificWarnings>
 
409
    <LinkerSuppressSchemaValidation Condition=" '$(LinkerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LinkerSuppressSchemaValidation>
 
410
    <LinkerSuppressIntermediateFileVersionMatching Condition=" '$(LinkerSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LinkerSuppressIntermediateFileVersionMatching>
 
411
    <LinkerTreatWarningsAsErrors Condition=" '$(LinkerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LinkerTreatWarningsAsErrors>
 
412
    <LinkerTreatSpecificWarningsAsErrors Condition=" '$(LinkerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LinkerTreatSpecificWarningsAsErrors>
 
413
    <LinkerVerboseOutput Condition=" '$(LinkerVerboseOutput)' == '' ">$(VerboseOutput)</LinkerVerboseOutput>
 
414
  </PropertyGroup>
 
415
 
 
416
  <!-- Default Inscribe properties. -->
 
417
  <PropertyGroup>
 
418
    <InscribeNoLogo Condition=" '$(InscribeNoLogo)' == '' ">$(NoLogo)</InscribeNoLogo>
 
419
    <InscribeSuppressAllWarnings Condition=" '$(InscribeSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</InscribeSuppressAllWarnings>
 
420
    <InscribeSuppressSpecificWarnings Condition=" '$(InscribeSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</InscribeSuppressSpecificWarnings>
 
421
    <InscribeTreatWarningsAsErrors Condition=" '$(InscribeTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</InscribeTreatWarningsAsErrors>
 
422
    <InscribeTreatSpecificWarningsAsErrors Condition=" '$(InscribeTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</InscribeTreatSpecificWarningsAsErrors>
 
423
    <InscribeVerboseOutput Condition=" '$(InscribeVerboseOutput)' == '' ">$(VerboseOutput)</InscribeVerboseOutput>
 
424
  </PropertyGroup>
 
425
  <!--
 
426
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
427
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
428
  Initial Targets
 
429
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
430
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
431
  -->
 
432
 
 
433
  <!--
 
434
  ============================================================
 
435
                                      _CheckForInvalidConfigurationAndPlatform
 
436
 
 
437
  This target checks for errors in statically defined properties.  It always
 
438
  gets executed before any other target.
 
439
  ============================================================
 
440
  -->
 
441
  <Target
 
442
      Name="_CheckForInvalidConfigurationAndPlatform">
 
443
 
 
444
      <Error Condition=" '$(_InvalidConfigurationError)' == 'true' " Text="The OutputPath property is not set for this project.  Please check to make sure that you have specified a valid Configuration/Platform combination.  Configuration='$(_OriginalConfiguration)'  Platform='$(_OriginalPlatform)'"/>
 
445
      <Warning Condition=" '$(_InvalidConfigurationWarning)' == 'true' " Text="The OutputPath property is not set for this project.  Please check to make sure that you have specified a valid Configuration/Platform combination.  Configuration='$(_OriginalConfiguration)'  Platform='$(_OriginalPlatform)'"/>
 
446
 
 
447
      <Message Text="Configuration=$(Configuration)" Importance="Low" />
 
448
      <Message Text="Platform=$(Platform)" Importance="Low" />
 
449
 
 
450
      <!-- Although we try to ensure a trailing slash, it's possible to circumvent this if the property is set on the command line -->
 
451
      <Error Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')" Text="The OutDir property must end with a trailing slash." />
 
452
      <Error Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')" Text="The BaseIntermediateOutputPath must end with a trailing slash." />
 
453
      <Error Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')" Text="The IntermediateOutputPath must end with a trailing slash." />
 
454
  </Target>
 
455
 
 
456
 
 
457
  <!--
 
458
  ==================================================================================================
 
459
  _CheckRequiredProperties
 
460
 
 
461
    Checks properties that must be set in the main project file or on the command line before
 
462
    using this .TARGETS file.
 
463
 
 
464
    [IN]
 
465
    $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension)
 
466
    $(OutputType) - Possible values are 'package', 'PatchCreation', 'module', 'library', 'bundle'
 
467
  ==================================================================================================
 
468
  -->
 
469
  <PropertyGroup>
 
470
    <_PleaseSetThisInProjectFile>Please set this in the project file before the &lt;Import&gt; of the wix.targets file.</_PleaseSetThisInProjectFile>
 
471
    <_OutputTypeDescription>The OutputType defines whether a Windows Installer package (.msi), PatchCreation (.pcp), merge module (.msm), wix library (.wixlib), or self-extracting executable (.exe) is being built. $(_PleaseSetThisInProjectFile) Possible values are 'Package', 'Module', 'Library', and 'Bundle'.</_OutputTypeDescription>
 
472
  </PropertyGroup>
 
473
  <Target Name="_CheckRequiredProperties">
 
474
 
 
475
    <Error
 
476
      Code="WIXTARGETS100"
 
477
      Condition=" '$(OutputName)' == '' "
 
478
      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)" />
 
479
 
 
480
    <Warning
 
481
      Code="WIXTARGETS101"
 
482
      Condition=" '$(_OriginalOutputType)' == '' "
 
483
      Text="The OutputType property is not set in project &quot;$(MSBuildProjectFile)&quot;. Defaulting to 'Package'. $(_OutputTypeDescription)" />
 
484
 
 
485
    <Error
 
486
      Code="WIXTARGETS102"
 
487
      Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'PatchCreation' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' and '$(OutputType)' != 'Bundle' "
 
488
      Text="The OutputType property '$(OutputType)' is not valid in project &quot;$(MSBuildProjectFile)&quot;. $(_OutputTypeDescription)" />
 
489
 
 
490
    <!-- Although we try to ensure a trailing slash, it's possible to circumvent this if the property is set on the command line -->
 
491
    <Error
 
492
      Code="WIXTARGETS103"
 
493
      Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')"
 
494
      Text="The OutDir property must end with a trailing slash." />
 
495
 
 
496
  </Target>
 
497
 
 
498
  <!--
 
499
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
500
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
501
  Build Targets
 
502
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
503
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
504
  -->
 
505
 
 
506
  <!--
 
507
  ==================================================================================================
 
508
  Build
 
509
 
 
510
    The main build entry point.
 
511
  ==================================================================================================
 
512
  -->
 
513
  <PropertyGroup>
 
514
    <BuildDependsOn>
 
515
      BeforeBuild;
 
516
      CoreBuild;
 
517
      AfterBuild
 
518
    </BuildDependsOn>
 
519
  </PropertyGroup>
 
520
  <Target
 
521
    Name="Build"
 
522
    DependsOnTargets="$(BuildDependsOn)"
 
523
    Outputs="$(TargetPath)">
 
524
  </Target>
 
525
 
 
526
  <!--
 
527
  ==================================================================================================
 
528
  BeforeBuild
 
529
 
 
530
    Redefine this target in your project in order to run tasks just before Build.
 
531
  ==================================================================================================
 
532
  -->
 
533
  <Target Name="BeforeBuild" />
 
534
 
 
535
  <!--
 
536
  ==================================================================================================
 
537
  AfterBuild
 
538
 
 
539
    Redefine this target in your project in order to run tasks just after Build.
 
540
  ==================================================================================================
 
541
  -->
 
542
  <Target Name="AfterBuild" />
 
543
 
 
544
  <!--
 
545
  ==================================================================================================
 
546
  CoreBuild
 
547
 
 
548
    The core build step calls each of the build targets.
 
549
  ==================================================================================================
 
550
  -->
 
551
  <PropertyGroup>
 
552
    <CoreBuildDependsOn>
 
553
      BuildOnlySettings;
 
554
      PrepareForBuild;
 
555
      PreBuildEvent;
 
556
      ResolveReferences;
 
557
      AddCompilerDefineConstants;
 
558
      CompileAndLink;
 
559
      Signing;
 
560
      GetTargetPath;
 
561
      IncrementalClean;
 
562
      PostBuildEvent
 
563
    </CoreBuildDependsOn>
 
564
  </PropertyGroup>
 
565
  <Target
 
566
    Name="CoreBuild"
 
567
    DependsOnTargets="$(CoreBuildDependsOn)">
 
568
 
 
569
    <OnError
 
570
      ExecuteTargets="_TimeStampAfterCompileAndLink;PostBuildEvent"
 
571
      Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated' " />
 
572
 
 
573
    <OnError ExecuteTargets="_CleanRecordFileWrites" />
 
574
 
 
575
  </Target>
 
576
 
 
577
  <!--
 
578
  ==================================================================================================
 
579
  Rebuild
 
580
 
 
581
    Delete all intermediate and final build outputs, and then build the project from scratch.
 
582
  ==================================================================================================
 
583
  -->
 
584
  <PropertyGroup>
 
585
    <RebuildDependsOn>
 
586
      BeforeRebuild;
 
587
      Clean;
 
588
      $(MSBuildProjectDefaultTargets);
 
589
      AfterRebuild;
 
590
    </RebuildDependsOn>
 
591
 
 
592
    <RebuildDependsOn Condition=" '$(MSBuildProjectDefaultTargets)' == 'Rebuild' ">
 
593
      BeforeRebuild;
 
594
      Clean;
 
595
      Build;
 
596
      AfterRebuild;
 
597
    </RebuildDependsOn>
 
598
  </PropertyGroup>
 
599
 
 
600
  <Target
 
601
    Name="Rebuild"
 
602
    DependsOnTargets="$(RebuildDependsOn)"
 
603
    Outputs="$(TargetPath)" />
 
604
 
 
605
  <!--
 
606
  ==================================================================================================
 
607
  BeforeRebuild
 
608
 
 
609
    Redefine this target in your project in order to run tasks just before Rebuild.
 
610
  ==================================================================================================
 
611
  -->
 
612
  <Target Name="BeforeRebuild" />
 
613
 
 
614
  <!--
 
615
  ==================================================================================================
 
616
  AfterRebuild
 
617
 
 
618
    Redefine this target in your project in order to run tasks just after Rebuild.
 
619
  ==================================================================================================
 
620
  -->
 
621
  <Target Name="AfterRebuild" />
 
622
 
 
623
  <!--
 
624
  ==================================================================================================
 
625
  BuildOnlySettings
 
626
 
 
627
    This target is called only when doing a real build. It is not called during project load.
 
628
  ==================================================================================================
 
629
    -->
 
630
  <PropertyGroup>
 
631
    <BuildingProject>false</BuildingProject>
 
632
  </PropertyGroup>
 
633
  <Target Name="BuildOnlySettings">
 
634
 
 
635
    <CreateProperty Value="true">
 
636
      <Output TaskParameter="Value" PropertyName="BuildingProject" />
 
637
    </CreateProperty>
 
638
 
 
639
  </Target>
 
640
 
 
641
  <!--
 
642
  ==================================================================================================
 
643
  PrepareForBuild
 
644
 
 
645
    Prepare the prerequisites for building.
 
646
  ==================================================================================================
 
647
  -->
 
648
  <PropertyGroup>
 
649
    <PrepareForBuildDependsOn></PrepareForBuildDependsOn>
 
650
  </PropertyGroup>
 
651
  <Target
 
652
    Name="PrepareForBuild" DependsOnTargets="$(PrepareForBuildDependsOn)">
 
653
 
 
654
    <!--
 
655
    These CreateProperty calls are required because TargetDir and TargetPath are defined
 
656
    to contain an item list. We want that item list to be expanded so that it can be used
 
657
    as a regular property value and not as an item-list-with-transform.
 
658
    -->
 
659
    <CreateProperty Value="$(TargetDir)">
 
660
      <Output TaskParameter="Value" PropertyName="TargetDir" />
 
661
    </CreateProperty>
 
662
 
 
663
    <CreateProperty Value="$(TargetPath)">
 
664
      <Output TaskParameter="Value" PropertyName="TargetPath" />
 
665
    </CreateProperty>
 
666
 
 
667
    <CreateProperty Value="$(TargetPdbPath)">
 
668
      <Output TaskParameter="Value" PropertyName="TargetPdbPath" />
 
669
    </CreateProperty>
 
670
 
 
671
    <!-- Create the directories for intermediate and final build products. -->
 
672
    <MakeDir Directories="$(IntermediateOutputPath);$(OutDir)" />
 
673
  </Target>
 
674
 
 
675
  <!--
 
676
  ==================================================================================================
 
677
  ResolveWixExtensionReferences
 
678
 
 
679
    Resolves WiX extension references to full paths. Any properties you use
 
680
    to resolve paths to extensions must be defined before importing this
 
681
    file or the extensions will be automatically resolved to $(WixExtDir).
 
682
 
 
683
    [IN]
 
684
    @(WixExtension) - WixExtension item group
 
685
 
 
686
    [OUT]
 
687
    @(_ResolvedWixExtensionPaths) - Item group with full paths to extensions
 
688
  ==================================================================================================
 
689
  -->
 
690
  <PropertyGroup>
 
691
    <ResolveWixExtensionReferencesDependsOn>
 
692
      PrepareForBuild
 
693
    </ResolveWixExtensionReferencesDependsOn>
 
694
  </PropertyGroup>
 
695
  <Target
 
696
    Name="ResolveWixExtensionReferences"
 
697
    DependsOnTargets="$(ResolveWixExtensionReferencesDependsOn)"
 
698
    Condition=" '@(WixExtension)' != ''">
 
699
 
 
700
    <!--
 
701
    The WixExtensionSearchPaths property is set to find assemblies in the following order:
 
702
 
 
703
        (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file.
 
704
        (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
 
705
        (3) Treat the reference's Include as if it were a real file name.
 
706
        (4) Path specified by the WixExtDir property.
 
707
    -->
 
708
    <CreateProperty Condition=" '$(WixExtensionSearchPaths)' == '' " Value="
 
709
      $(ReferencePaths);
 
710
      {HintPathFromItem};
 
711
      {RawFileName};
 
712
      $(WixExtDir)
 
713
      ">
 
714
      <Output TaskParameter="Value" PropertyName="WixExtensionSearchPaths" />
 
715
    </CreateProperty>
 
716
 
 
717
    <ResolveWixReferences
 
718
      WixReferences="@(WixExtension)"
 
719
      SearchPaths="$(WixExtensionSearchPaths)"
 
720
      SearchFilenameExtensions=".dll">
 
721
      <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixExtensionPaths" />
 
722
    </ResolveWixReferences>
 
723
 
 
724
    <!-- Remove duplicate extension items that would cause build errors -->
 
725
    <RemoveDuplicates Inputs="@(_AllResolvedWixExtensionPaths)">
 
726
      <Output TaskParameter="Filtered" ItemName="_ResolvedWixExtensionPaths" />
 
727
    </RemoveDuplicates>
 
728
  </Target>
 
729
 
 
730
  <!--
 
731
  ==================================================================================================
 
732
  PreBuildEvent
 
733
 
 
734
    Run the pre-build event if there is one.
 
735
  ==================================================================================================
 
736
  -->
 
737
  <PropertyGroup>
 
738
    <PreBuildEventDependsOn>GetTargetPath</PreBuildEventDependsOn>
 
739
  </PropertyGroup>
 
740
  <Target
 
741
    Name="PreBuildEvent"
 
742
    DependsOnTargets="$(PreBuildEventDependsOn)"
 
743
    Condition=" '$(PreBuildEvent)' != '' ">
 
744
 
 
745
    <ReplaceString
 
746
      Text="$(PreBuildEvent)"
 
747
      OldValue="!(TargetPath)"
 
748
      NewValue="$(TargetPath)">
 
749
      
 
750
      <Output TaskParameter="Text" PropertyName="ExpandedPreBuildEvent" />
 
751
    </ReplaceString>
 
752
    
 
753
    <ReplaceString
 
754
      Text="$(ExpandedPreBuildEvent)"
 
755
      OldValue="!(TargetPdbPath)"
 
756
      NewValue="$(TargetPdbPath)">
 
757
      
 
758
      <Output TaskParameter="Text" PropertyName="ExpandedPreBuildEvent" />
 
759
    </ReplaceString>
 
760
 
 
761
    <Exec WorkingDirectory="$(OutDir)" Command="$(ExpandedPreBuildEvent)" />
 
762
  </Target>
 
763
 
 
764
  <!--
 
765
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
766
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
767
  Resolve References Targets
 
768
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
769
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
770
  -->
 
771
 
 
772
  <!--
 
773
  ==================================================================================================
 
774
  ResolveReferences
 
775
  ==================================================================================================
 
776
  -->
 
777
  <PropertyGroup>
 
778
    <ResolveReferencesDependsOn>
 
779
      BeforeResolveReferences;
 
780
      AssignProjectConfiguration;
 
781
      ResolveProjectReferences;
 
782
      ResolveWixLibraryReferences;
 
783
      ResolveWixExtensionReferences;
 
784
      AfterResolveReferences
 
785
    </ResolveReferencesDependsOn>
 
786
  </PropertyGroup>
 
787
  <Target
 
788
    Name="ResolveReferences"
 
789
    DependsOnTargets="$(ResolveReferencesDependsOn)" />
 
790
 
 
791
  <!--
 
792
  ==================================================================================================
 
793
  BeforeResolveReferences
 
794
 
 
795
    Redefine this target in your project in order to run tasks just before ResolveReferences.
 
796
  ==================================================================================================
 
797
  -->
 
798
  <Target Name="BeforeResolveReferences" />
 
799
 
 
800
  <!--
 
801
  ==================================================================================================
 
802
  AfterResolveReferences
 
803
 
 
804
    Redefine this target in your project in order to run tasks just after ResolveReferences.
 
805
  ==================================================================================================
 
806
  -->
 
807
  <Target Name="AfterResolveReferences" />
 
808
 
 
809
  <!--
 
810
  ==================================================================================================
 
811
  AssignProjectConfiguration
 
812
 
 
813
    Assign the appropriate configuration to each project in the list of project references passed in.
 
814
 
 
815
    [IN]
 
816
    @(ProjectReference) - the list of all project references
 
817
 
 
818
    [OUT]
 
819
    @(_ProjectReferenceWithConfiguration) - the list of project references (MSBuild and potentially VSIP projects)
 
820
  ==================================================================================================
 
821
  -->
 
822
  <Target
 
823
    Name="AssignProjectConfiguration"
 
824
    Condition=" '@(ProjectReference)' != '' ">
 
825
 
 
826
    <!-- Assign a project configuration to each project reference if we're building a solution file. -->
 
827
    <AssignProjectConfiguration
 
828
      ProjectReferences="@(ProjectReference)"
 
829
      CurrentProjectConfiguration="$(Configuration)"
 
830
      CurrentProjectPlatform="$(Platform)"
 
831
      SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)">
 
832
 
 
833
      <Output TaskParameter="AssignedProjects" ItemName="_ProjectReferenceWithConfiguration" />
 
834
      <Output TaskParameter="UnassignedProjects" ItemName="_ProjectReferenceWithConfiguration"/>
 
835
    </AssignProjectConfiguration>
 
836
 
 
837
    <!-- Add in the source project path so that we can have access to it after resolving the output. -->
 
838
    <ItemGroup>
 
839
      <_ProjectReferenceWithConfiguration>
 
840
        <MSBuildSourceProjectFileFullPath>%(FullPath)</MSBuildSourceProjectFileFullPath>
 
841
      </_ProjectReferenceWithConfiguration>
 
842
    </ItemGroup>
 
843
  </Target>
 
844
 
 
845
 
 
846
  <!--
 
847
  ==================================================================================================
 
848
  _SplitProjectReferencesByFileExistence
 
849
 
 
850
    Split referenced projects into two lists: those that exist on  disk and those that don't.
 
851
 
 
852
    [IN]
 
853
    @(NonVCProjectReference) - the list of non-VC project references (MSBuild and potentially VSIP projects)
 
854
 
 
855
    [OUT]
 
856
    @(_MSBuildProjectReferenceExistent) - the list of non-VC project references that exist on disk
 
857
    @(_MSBuildProjectReferenceNonexistent) - the list of non-VC project references that don't exist on disk
 
858
  ==================================================================================================
 
859
  -->
 
860
  <Target
 
861
    Name="_SplitProjectReferencesByFileExistence">
 
862
 
 
863
    <!--
 
864
    Use this task for matching projects with pre-resolved project outputs set by the IDE if building
 
865
    inside the IDE. The IDE only includes non-MSBuild projects in the output list. We'll use MSBuild
 
866
    to resolve MSBuild projects. This task will resolve VSIP (3rd party) project references and
 
867
    create a new item list with only project references to projects in the MSBuild format.
 
868
    -->
 
869
    <ResolveNonMSBuildProjectOutput
 
870
      ProjectReferences="@(_ProjectReferenceWithConfiguration)"
 
871
      PreresolvedProjectOutputs="$(VSIDEResolvedNonMSBuildProjectOutputs)"
 
872
      Condition=" '$(BuildingInsideVisualStudio)' == 'true' and '@(_ProjectReferenceWithConfiguration)'!=''">
 
873
 
 
874
      <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedProjectReferencePaths" />
 
875
      <Output TaskParameter="UnresolvedProjectReferences" ItemName="_MSBuildProjectReference" />
 
876
 
 
877
    </ResolveNonMSBuildProjectOutput>
 
878
 
 
879
    <!--
 
880
    If building from the command line, simply copy the _ProjectReferenceWithConfiguration item list to
 
881
    _MSBuildProjectReference, since we have to assume all non-VC projects are in the MSBuild format.
 
882
    We have no way of building VSIP (3rd party) projects from the command line.
 
883
    -->
 
884
    <ItemGroup>
 
885
      <_MSBuildProjectReference Include="@(_ProjectReferenceWithConfiguration)" Condition="'$(BuildingInsideVisualStudio)'!='true' and '@(_ProjectReferenceWithConfiguration)'!=''"/>
 
886
    </ItemGroup>
 
887
 
 
888
    <!-- Break the project list into two lists: those that exist on disk and those that don't. -->
 
889
    <ItemGroup>
 
890
      <_MSBuildProjectReferenceExistent Include="@(_MSBuildProjectReference)" Condition="Exists('%(Identity)')"/>
 
891
      <_MSBuildProjectReferenceNonexistent Include="@(_MSBuildProjectReference)" Condition="!Exists('%(Identity)')"/>
 
892
    </ItemGroup>
 
893
 
 
894
  </Target>
 
895
 
 
896
  <!--
 
897
  ================================================================================================
 
898
  ResolveProjectReferences
 
899
 
 
900
    Builds all of the referenced projects to get their outputs.
 
901
 
 
902
    [IN]
 
903
    @(NonVCProjectReference) - The list of non-VC project references.
 
904
 
 
905
    [OUT]
 
906
    @(_ProjectReferenceWithConfiguration) - The list of non-VC project references.
 
907
  ================================================================================================
 
908
  -->
 
909
  <Target
 
910
    Name="ResolveProjectReferences"
 
911
    DependsOnTargets="AssignProjectConfiguration;_SplitProjectReferencesByFileExistence"
 
912
    Condition=" '@(_ProjectReferenceWithConfiguration)' != '' ">
 
913
 
 
914
    <!--
 
915
    When building this project from the IDE or when building a .sln from the command line, just
 
916
    gather the referenced build outputs. The code that builds the .sln will already have built
 
917
    the project, so there's no need to do it again here.
 
918
    
 
919
    The ContinueOnError setting is here so that, during project load, as much information as
 
920
    possible will be passed to the compilers.
 
921
    -->
 
922
    <MSBuild
 
923
      Projects="@(_MSBuildProjectReferenceExistent)"
 
924
      Targets="GetTargetPath"
 
925
      Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)"
 
926
      Condition="'@(_ProjectReferenceWithConfiguration)'!='' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '@(_MSBuildProjectReferenceExistent)' != ''"
 
927
      ContinueOnError="!$(BuildingProject)">
 
928
 
 
929
      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" />
 
930
      <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" />
 
931
    </MSBuild>
 
932
 
 
933
    <!--
 
934
    Build referenced projects when building from the command line.
 
935
    
 
936
    The $(ProjectReferenceBuildTargets) will normally be blank so that the project's default target
 
937
    is used during a P2P reference. However if a custom build process requires that the referenced
 
938
    project has a different target to build it can be specified.
 
939
    -->
 
940
    <MSBuild
 
941
      Projects="@(_MSBuildProjectReferenceExistent)"
 
942
      Targets="$(ProjectReferenceBuildTargets)"
 
943
      Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)"
 
944
      Condition="'@(_ProjectReferenceWithConfiguration)'!='' and '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''">
 
945
 
 
946
      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" />
 
947
      <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" />
 
948
    </MSBuild>
 
949
 
 
950
    <!-- 
 
951
    VC project references must build GetNativeTargetPath because neither GetTargetPath nor the return of the default build
 
952
    target return the output for a native C++ project. 
 
953
    This will not produce duplicate paths because GetNativeTargetPath is mutually exclusive with GetTargetPath & Build TargetOutputs. 
 
954
    -->
 
955
    <MSBuild
 
956
      Projects="@(_MSBuildProjectReferenceExistent)"
 
957
      Targets="GetNativeTargetPath"
 
958
      Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)"
 
959
      Condition="'@(_ProjectReferenceWithConfiguration)'!='' and '%(_MSBuildProjectReferenceExistent.Extension)' == '.vcxproj'">
 
960
 
 
961
      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" />
 
962
      <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" />
 
963
    </MSBuild>
 
964
    
 
965
    <!-- Issue a warning for each non-existent project. -->
 
966
    <Warning
 
967
      Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist."
 
968
      Condition=" '@(_ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)'!=''"/>
 
969
 
 
970
    <!-- Create list of all .wixlib project references-->
 
971
    <CreateItem
 
972
      Include="@(_ResolvedProjectReferencePaths)"
 
973
      Condition=" '%(Extension)' == '.wixlib' ">
 
974
 
 
975
      <Output TaskParameter="Include" ItemName="WixLibProjects" />
 
976
    </CreateItem>
 
977
 
 
978
  </Target>
 
979
 
 
980
  <!--
 
981
  ================================================================================================
 
982
  GetTargetPath
 
983
 
 
984
    This stand-alone target returns the name of the build product (i.e. MSI, MSM) that would be
 
985
    produced if we built this project.
 
986
  ================================================================================================
 
987
  -->
 
988
  <PropertyGroup>
 
989
    <GetTargetPathDependsOn>
 
990
      PrepareForBuild;
 
991
      AssignCultures
 
992
    </GetTargetPathDependsOn>
 
993
  </PropertyGroup>
 
994
  <Target
 
995
    Name="GetTargetPath"
 
996
    DependsOnTargets="$(GetTargetPathDependsOn)"
 
997
    Outputs="$(TargetPath)" />
 
998
 
 
999
  <!--
 
1000
  ============================================================
 
1001
  GetResolvedReferencePaths
 
1002
  This allows the Referenced Projects to return more information than the build output.
 
1003
  ============================================================
 
1004
  -->
 
1005
  <Target
 
1006
    Name="GetResolvedReferencePaths"
 
1007
    Outputs="$(ResolvedTargetPath)" />
 
1008
 
 
1009
  <!--
 
1010
  ================================================================================================
 
1011
  ResolveWixLibraryReferences
 
1012
 
 
1013
    Resolve the library references to full paths.
 
1014
 
 
1015
    [IN]
 
1016
    @(WixLibrary) - The list of .wixlib files.
 
1017
    
 
1018
    [OUT]
 
1019
    @(_ResolvedWixLibraryPaths) - Item group with full paths to libraries
 
1020
  ================================================================================================
 
1021
  -->
 
1022
  <PropertyGroup>
 
1023
    <ResolveWixLibraryReferencesDependsOn>
 
1024
      PrepareForBuild;
 
1025
    </ResolveWixLibraryReferencesDependsOn>
 
1026
  </PropertyGroup>
 
1027
  <Target
 
1028
    Name="ResolveWixLibraryReferences"
 
1029
    DependsOnTargets="$(ResolveWixLibraryReferencesDependsOn)"
 
1030
    Condition=" '@(WixLibrary)' != ''">
 
1031
 
 
1032
    <!--
 
1033
    The WixLibrarySearchPaths property is set to find assemblies in the following order:
 
1034
 
 
1035
        (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file.
 
1036
        (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
 
1037
        (3) Treat the reference's Include as if it were a real file name.
 
1038
        (4) Path specified by the WixExtDir property.
 
1039
    -->
 
1040
    <CreateProperty Condition=" '$(WixLibrarySearchPaths)' == '' " Value="
 
1041
      $(ReferencePaths);
 
1042
      {HintPathFromItem};
 
1043
      {RawFileName};
 
1044
      $(WixExtDir)
 
1045
      ">
 
1046
      <Output TaskParameter="Value" PropertyName="WixLibrarySearchPaths" />
 
1047
    </CreateProperty>
 
1048
 
 
1049
    <ResolveWixReferences
 
1050
      WixReferences="@(WixLibrary)"
 
1051
      SearchPaths="$(WixLibrarySearchPaths)"
 
1052
      SearchFilenameExtensions=".wixlib">
 
1053
      <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixLibraryPaths" />
 
1054
    </ResolveWixReferences>
 
1055
    
 
1056
    <!-- Remove duplicate library items that would cause build errors -->
 
1057
    <RemoveDuplicates Inputs="@(_AllResolvedWixLibraryPaths)">
 
1058
      <Output TaskParameter="Filtered" ItemName="_ResolvedWixLibraryPaths" />
 
1059
    </RemoveDuplicates>
 
1060
 
 
1061
  </Target>
 
1062
 
 
1063
  <!--
 
1064
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1065
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1066
  Compiler Define Targets
 
1067
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1068
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1069
  -->
 
1070
 
 
1071
  <!--
 
1072
  ==================================================================================================
 
1073
  AddCompilerDefineConstants
 
1074
 
 
1075
    Adds solution and project references to the constants passed into the compiler.
 
1076
  ==================================================================================================
 
1077
  -->
 
1078
  <PropertyGroup>
 
1079
    <AddCompilerDefineConstantsDependsOn>
 
1080
      ResolveReferences;
 
1081
      AddSolutionDefineConstants;
 
1082
      AddProjectReferenceDefineConstants;
 
1083
    </AddCompilerDefineConstantsDependsOn>
 
1084
  </PropertyGroup>
 
1085
  <Target
 
1086
    Name="AddCompilerDefineConstants"
 
1087
    DependsOnTargets="$(AddCompilerDefineConstantsDependsOn)">
 
1088
 
 
1089
    <CreateProperty Value="
 
1090
      Configuration=$(ConfigurationName);
 
1091
      OutDir=$(OutDir);
 
1092
      Platform=$(PlatformName);
 
1093
      ProjectDir=$(ProjectDir);
 
1094
      ProjectExt=$(ProjectExt);
 
1095
      ProjectFileName=$(ProjectFileName);
 
1096
      ProjectName=$(ProjectName);
 
1097
      ProjectPath=$(ProjectPath);
 
1098
      TargetDir=$(TargetDir);
 
1099
      TargetExt=$(TargetExt);
 
1100
      TargetFileName=$(TargetFileName);
 
1101
      TargetName=$(TargetName);
 
1102
      TargetPath=$(TargetPath);
 
1103
      ">
 
1104
      <Output TaskParameter="Value" PropertyName="ProjectDefineConstants" />
 
1105
    </CreateProperty>
 
1106
    
 
1107
  </Target>
 
1108
 
 
1109
  <!--
 
1110
  ==================================================================================================
 
1111
  AddSolutionDefineConstants
 
1112
 
 
1113
    Adds solution references to the constants passed into the compiler, but only when building
 
1114
    from the Visual Studio IDE or when building a solution file via the command line.
 
1115
 
 
1116
    [OUT]
 
1117
    $(SolutionDefineConstants) - the list of solution variables to be passed into the compiler
 
1118
  ==================================================================================================
 
1119
  -->
 
1120
  <PropertyGroup>
 
1121
    <DefineSolutionProperties Condition=" '$(DefineSolutionProperties)' == '' ">true</DefineSolutionProperties>
 
1122
  </PropertyGroup>
 
1123
  <Target
 
1124
    Name="AddSolutionDefineConstants"
 
1125
    Condition=" '$(DefineSolutionProperties)' == 'true' ">
 
1126
 
 
1127
    <Warning
 
1128
      Text="Solution properties are only available during IDE builds or when building the solution file from the command line. To turn off this warning set &lt;DefineSolutionProperties&gt;false&lt;/DefineSolutionProperties&gt; in your .wixproj file."
 
1129
      Condition=" '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildingSolutionFile)' != 'true' " />
 
1130
 
 
1131
    <CreateProperty Value="$(SolutionDefineConstants);DevEnvDir=$(DevEnvDir)" Condition=" '$(DevEnvDir)' != '' ">
 
1132
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1133
    </CreateProperty>
 
1134
    <CreateProperty Value="$(SolutionDefineConstants);SolutionDir=$(SolutionDir)" Condition=" '$(SolutionDir)' != '' ">
 
1135
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1136
    </CreateProperty>
 
1137
    <CreateProperty Value="$(SolutionDefineConstants);SolutionExt=$(SolutionExt)" Condition=" '$(SolutionExt)' != '' ">
 
1138
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1139
    </CreateProperty>
 
1140
    <CreateProperty Value="$(SolutionDefineConstants);SolutionFileName=$(SolutionFileName)" Condition=" '$(SolutionFileName)' != '' ">
 
1141
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1142
    </CreateProperty>
 
1143
    <CreateProperty Value="$(SolutionDefineConstants);SolutionName=$(SolutionName)" Condition=" '$(SolutionName)' != '' ">
 
1144
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1145
    </CreateProperty>
 
1146
    <CreateProperty Value="$(SolutionDefineConstants);SolutionPath=$(SolutionPath)" Condition=" '$(SolutionPath)' != '' ">
 
1147
      <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" />
 
1148
    </CreateProperty>
 
1149
 
 
1150
  </Target>
 
1151
 
 
1152
  <!--
 
1153
  ==================================================================================================
 
1154
  AddProjectReferenceDefineConstants
 
1155
 
 
1156
    Adds project references to the constants passed into the compiler.
 
1157
 
 
1158
    [IN]
 
1159
    @(_ResolvedProjectReferencePaths) - paths to projects' outputs
 
1160
    $(VSProjectConfigurations) - map of project names to configurations, provided by VS when building in the IDE
 
1161
 
 
1162
    [OUT]
 
1163
    $(ProjectReferenceDefineConstants) - the list of referenced project variables to be passed into the compiler
 
1164
  ==================================================================================================
 
1165
  -->
 
1166
  <Target
 
1167
    Name="AddProjectReferenceDefineConstants"
 
1168
    Condition=" '@(_ResolvedProjectReferencePaths)' != '' ">
 
1169
 
 
1170
    <CreateProjectReferenceDefineConstants
 
1171
      ProjectReferencePaths="@(_ResolvedProjectReferencePaths)"
 
1172
      ProjectConfigurations="$(VSProjectConfigurations)">
 
1173
 
 
1174
      <Output TaskParameter="DefineConstants" PropertyName="ProjectReferenceDefineConstants" />
 
1175
    </CreateProjectReferenceDefineConstants>
 
1176
  </Target>
 
1177
 
 
1178
  <!--
 
1179
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1180
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1181
  CompileAndLink Targets
 
1182
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1183
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
1184
  -->
 
1185
 
 
1186
  <!--
 
1187
  ==================================================================================================
 
1188
  CompileAndLink
 
1189
  ==================================================================================================
 
1190
  -->
 
1191
  <PropertyGroup>
 
1192
    <CompileAndLinkDependsOn>
 
1193
      ResolveReferences;
 
1194
      BeforeCompileAndLink;
 
1195
      _TimeStampBeforeCompileAndLink;
 
1196
      ConvertReferences;
 
1197
      ConvertBundleReferences;
 
1198
      Harvest;
 
1199
      GenerateCode;
 
1200
      Compile;
 
1201
      Lib;
 
1202
      Link;
 
1203
      _TimeStampAfterCompileAndLink;
 
1204
      AfterCompileAndLink
 
1205
    </CompileAndLinkDependsOn>
 
1206
  </PropertyGroup>
 
1207
  <Target
 
1208
    Name="CompileAndLink"
 
1209
    DependsOnTargets="$(CompileAndLinkDependsOn)" />
 
1210
 
 
1211
  <!--
 
1212
  ==================================================================================================
 
1213
  BeforeCompileAndLink
 
1214
 
 
1215
    Redefine this target in your project in order to run tasks just before CompileAndLink.
 
1216
  ==================================================================================================
 
1217
  -->
 
1218
  <Target Name="BeforeCompileAndLink" />
 
1219
 
 
1220
  <!--
 
1221
  ==================================================================================================
 
1222
  AfterCompileAndLink
 
1223
 
 
1224
    Redefine this target in your project in order to run tasks just after CompileAndLink.
 
1225
  ==================================================================================================
 
1226
  -->
 
1227
  <Target Name="AfterCompileAndLink" />
 
1228
 
 
1229
  <!--
 
1230
  ==================================================================================================
 
1231
  _TimeStampBeforeCompileAndLink
 
1232
 
 
1233
    Record a timestamp so that we can compare it to a new timestamp during PostBuildEvent if
 
1234
    necessary.
 
1235
  ==================================================================================================
 
1236
  -->
 
1237
  <Target
 
1238
    Name="_TimeStampBeforeCompileAndLink" >
 
1239
 
 
1240
    <CreateItem Include="$(TargetPath)">
 
1241
      <Output TaskParameter="Include" ItemName="TargetOutput" />
 
1242
    </CreateItem>
 
1243
    
 
1244
    <CreateItem Include="%(TargetOutput.ModifiedTime)">
 
1245
      <Output TaskParameter="Include" PropertyName="_TargetOutputTimestampBeforeCompileAndLink" />
 
1246
    </CreateItem>
 
1247
 
 
1248
  </Target>
 
1249
 
 
1250
  <!--
 
1251
  ==================================================================================================
 
1252
  _TimeStampAfterCompileAndLink
 
1253
 
 
1254
    Take before and after timestamps so that we can compare them (used by post-build events that
 
1255
    are set to fire "OnOutputUpdated").
 
1256
  ==================================================================================================
 
1257
  -->
 
1258
  <Target
 
1259
    Name="_TimeStampAfterCompileAndLink">
 
1260
 
 
1261
    <CreateItem Include="%(TargetOutput.ModifiedTime)">
 
1262
      <Output TaskParameter="Include" PropertyName="_TargetOutputTimestampAfterCompileAndLink" />
 
1263
    </CreateItem>
 
1264
 
 
1265
    <!-- if our target path was updated by compile & link, and it's an "inscribe-able" output type,
 
1266
         then add it to the list of things to be inscribed -->
 
1267
    <CreateItem Include="$(TargetPath)"
 
1268
      Condition="'$(_TargetOutputTimestampBeforeCompileAndLink)' != '$(_TargetOutputTimestampAfterCompileAndLink)'
 
1269
      and ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module')
 
1270
      and '$(InscribeMainOutput)' == 'true'" >
 
1271
 
 
1272
        <Output TaskParameter="Include" ItemName="Inscribe"/>
 
1273
    </CreateItem>
 
1274
 
 
1275
  </Target>
 
1276
 
 
1277
  <!--
 
1278
  ==================================================================================================
 
1279
  Harvest
 
1280
  ==================================================================================================
 
1281
  -->
 
1282
  <PropertyGroup>
 
1283
    <HarvestDependsOn>
 
1284
      HarvestProjects;
 
1285
      HarvestDirectory;
 
1286
      HarvestFile;
 
1287
    </HarvestDependsOn>
 
1288
  </PropertyGroup>
 
1289
  <Target
 
1290
    Name="Harvest"
 
1291
    DependsOnTargets="$(HarvestDependsOn)" />
 
1292
 
 
1293
  <!--
 
1294
  ==================================================================================================
 
1295
  GenerateCode
 
1296
  ==================================================================================================
 
1297
  -->
 
1298
  <PropertyGroup>
 
1299
    <GenerateCodeDependsOn>
 
1300
      RefreshGeneratedFile;
 
1301
      RefreshBundleGeneratedFile
 
1302
    </GenerateCodeDependsOn>
 
1303
  </PropertyGroup>
 
1304
  <Target Name="GenerateCode"
 
1305
    DependsOnTargets="$(GenerateCodeDependsOn)" />
 
1306
 
 
1307
  <!--
 
1308
  ==================================================================================================
 
1309
  Signing
 
1310
  ==================================================================================================
 
1311
  -->
 
1312
  <PropertyGroup>
 
1313
    <SigningDependsOn>
 
1314
      CompileAndLink;
 
1315
      BeforeSigning;
 
1316
      SignCabs;
 
1317
      Inscribe;
 
1318
      SignMsi;
 
1319
      AfterSigning
 
1320
    </SigningDependsOn>
 
1321
  </PropertyGroup>
 
1322
  <Target
 
1323
    Name="Signing"
 
1324
    DependsOnTargets="$(SigningDependsOn)" />
 
1325
 
 
1326
  <!--
 
1327
  ==================================================================================================
 
1328
  BeforeSigning
 
1329
 
 
1330
    Redefine this target in your project in order to run tasks just before all signing tasks.
 
1331
  ==================================================================================================
 
1332
  -->
 
1333
  <Target Name="BeforeSigning" />
 
1334
 
 
1335
  <!--
 
1336
  ==================================================================================================
 
1337
  SignCabs
 
1338
 
 
1339
    Redefine this target in your project in order to sign the cabs of your database.
 
1340
  ==================================================================================================
 
1341
  -->
 
1342
  <Target Name="SignCabs" />
 
1343
 
 
1344
  <!--
 
1345
  ==================================================================================================
 
1346
  SignMsi
 
1347
 
 
1348
    Redefine this target in your project in order to sign your database, after it has been inscribed
 
1349
    with the signatures of your signed cabs
 
1350
  ==================================================================================================
 
1351
  -->
 
1352
  <Target Name="SignMsi" />
 
1353
 
 
1354
  <!--
 
1355
  ==================================================================================================
 
1356
  AfterSigning
 
1357
 
 
1358
    Redefine this target in your project in order to run tasks just after all signing tasks.
 
1359
  ==================================================================================================
 
1360
  -->
 
1361
  <Target Name="AfterSigning" />
 
1362
 
 
1363
  <!--
 
1364
  ================================================================================================
 
1365
  ConvertReferences
 
1366
 
 
1367
    Converts project references to HeatProject items to auto generate authoring.
 
1368
  ================================================================================================
 
1369
  -->
 
1370
  <Target
 
1371
    Name="ConvertReferences"
 
1372
    Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' ) ">
 
1373
 
 
1374
    <ItemGroup>
 
1375
      <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
 
1376
        <DirectoryIds>%(_MSBuildProjectReferenceExistent.RefTargetDir)</DirectoryIds>
 
1377
        <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
 
1378
        <ProjectName>%(_MSBuildProjectReferenceExistent.Name)</ProjectName>
 
1379
        <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
 
1380
      </_HeatProjectReference>
 
1381
      <HeatProject Include="@(_HeatProjectReference)" />
 
1382
    </ItemGroup>
 
1383
 
 
1384
    <Error
 
1385
      Text="The following files are deprecated and should be removed from your project(s): @(Compile->'%(Identity)', ', ')"
 
1386
      Condition=" '%(Compile.GenerateComponentGroups)' != '' " />
 
1387
 
 
1388
    <ItemGroup>
 
1389
      <!-- Unconditionally generate Compile items so they are always linked in. -->
 
1390
      <Compile Include="$(HarvestProjectsGeneratedFile)" />
 
1391
      <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
 
1392
    </ItemGroup>
 
1393
 
 
1394
  </Target>
 
1395
 
 
1396
    <!--
 
1397
  ================================================================================================
 
1398
  ConvertBundleReferences
 
1399
 
 
1400
    Converts project references in Bundle projects to HeatProject items to auto generate authoring.
 
1401
  ================================================================================================
 
1402
  -->
 
1403
  <Target
 
1404
    Name="ConvertBundleReferences"
 
1405
    Condition=" ('$(OutputType)' == 'Bundle')">
 
1406
 
 
1407
    <ItemGroup>
 
1408
      <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
 
1409
        <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
 
1410
        <GenerateType>payloadgroup</GenerateType>
 
1411
        <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
 
1412
      </_HeatProjectReference>
 
1413
      <HeatProject Include="@(_HeatProjectReference)" />
 
1414
    </ItemGroup>
 
1415
 
 
1416
    <Error
 
1417
      Text="The following files are deprecated and should be removed from your project(s): @(Compile->'%(Identity)', ', ')"
 
1418
      Condition=" '%(Compile.GenerateComponentGroups)' != '' " />
 
1419
 
 
1420
    <ItemGroup>
 
1421
      <!-- Unconditionally generate Compile items so they are always linked in. -->
 
1422
      <Compile Include="$(HarvestProjectsGeneratedFile)" />
 
1423
      <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
 
1424
    </ItemGroup>
 
1425
 
 
1426
  </Target>
 
1427
 
 
1428
  <!--
 
1429
  ================================================================================================
 
1430
  CombineHarvestProjects
 
1431
 
 
1432
    Combines HeatProject and HarvestProject items together and ensures each has HeatOutput metadata.
 
1433
  ================================================================================================
 
1434
  -->
 
1435
  <Target Name="CombineHarvestProjects"
 
1436
    Condition=" '@(HeatProject)' != '' or '@(HarvestProject)' != '' ">
 
1437
 
 
1438
    <!-- Add default HeatOutputs for those without one specified -->
 
1439
    <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' == '' "
 
1440
    AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HeatProject.Filename).wxs">
 
1441
      <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
 
1442
    </CreateItem>
 
1443
    <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' == '' "
 
1444
    AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HarvestProject.Filename).wxs">
 
1445
      <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
 
1446
    </CreateItem>
 
1447
 
 
1448
 
 
1449
    <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' != '' ">
 
1450
      <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
 
1451
    </CreateItem>
 
1452
    <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' != '' ">
 
1453
      <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
 
1454
    </CreateItem>
 
1455
 
 
1456
  </Target>
 
1457
 
 
1458
  <!--
 
1459
  ================================================================================================
 
1460
  HarvestProjects
 
1461
 
 
1462
    Harvests outputs of other MSBuild projects files using the VS project extension to heat.exe.
 
1463
 
 
1464
    [IN]
 
1465
    @(HarvestProject)
 
1466
    @(HeatProject)
 
1467
        - The list of projects to harvest. HeatProject is provided for backward compatibility.
 
1468
          You should use HarvestProject instead.
 
1469
 
 
1470
    %(HarvestProject.Transforms)
 
1471
    %(HeatProject.Transforms)
 
1472
        - XSL transforms to apply to the harvested WiX.
 
1473
 
 
1474
    %(HarvestProject.ProjectOutputGroups)
 
1475
    %(HeatProjects.ProjectOutputGroups)
 
1476
        - The project output groups to harvest 
 
1477
 
 
1478
    [OUT]
 
1479
    %(HeatOutput)
 
1480
        - The generated .wxs files which are added to the @(Compile) item list.
 
1481
  ================================================================================================
 
1482
  -->
 
1483
  <ItemDefinitionGroup>
 
1484
    <HeatProject>
 
1485
      <Transforms>$(HarvestProjectsTransforms)</Transforms>
 
1486
      <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
 
1487
      <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
 
1488
    </HeatProject>
 
1489
    <HarvestProject>
 
1490
      <Transforms>$(HarvestProjectsTransforms)</Transforms>
 
1491
      <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
 
1492
      <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
 
1493
    </HarvestProject>
 
1494
  </ItemDefinitionGroup>
 
1495
 
 
1496
  <PropertyGroup>
 
1497
    <HarvestProjectsDependsOn>CombineHarvestProjects</HarvestProjectsDependsOn>
 
1498
  </PropertyGroup>
 
1499
  <Target Name="HarvestProjects"
 
1500
    DependsOnTargets="$(HarvestProjectsDependsOn)"
 
1501
    Inputs="@(_AllHeatProjects);%(_AllHeatProjects.Transforms);$(MSBuildAllProjects);$(ProjectPath)"
 
1502
    Outputs="@(_AllHeatProjects -> '%(HeatOutput)')"
 
1503
    Condition=" '@(HeatProject)' != '' or '@(HarvestProject)' != '' ">
 
1504
 
 
1505
    <HeatProject
 
1506
      NoLogo="$(HarvestProjectsNoLogo)"
 
1507
      SuppressAllWarnings="$(HarvestProjectsSuppressAllWarnings)"
 
1508
      SuppressSpecificWarnings="$(HarvestProjectsSuppressSpecificWarnings)"
 
1509
      ToolPath="$(WixToolPath)"
 
1510
      TreatWarningsAsErrors="$(HarvestProjectsTreatWarningsAsErrors)"
 
1511
      TreatSpecificWarningsAsErrors="$(HarvestProjectsTreatSpecificWarningsAsErrors)"
 
1512
      VerboseOutput="$(HarvestProjectsVerboseOutput)"
 
1513
      AutogenerateGuids="$(HarvestProjectsAutogenerateGuids)"
 
1514
      GenerateGuidsNow="$(HarvestProjectsGenerateGuidsNow)"
 
1515
      OutputFile="%(_AllHeatProjects.HeatOutput)"
 
1516
      SuppressFragments="$(HarvestProjectsSuppressFragments)"
 
1517
      SuppressUniqueIds="$(HarvestProjectsSuppressUniqueIds)"
 
1518
      Transforms="%(_AllHeatProjects.Transforms)"
 
1519
      Project="%(_AllHeatProjects.FullPath)"
 
1520
      ProjectOutputGroups="%(_AllHeatProjects.ProjectOutputGroups)"
 
1521
      GenerateType="%(_AllHeatProjects.GenerateType)"
 
1522
      DirectoryIds="%(_AllHeatProjects.DirectoryIds)"
 
1523
      ProjectName="%(_AllHeatProjects.ProjectName)"
 
1524
      Configuration="%(_AllHeatProjects.Configuration)"
 
1525
      Platform="%(_AllHeatProjects.Platform)"
 
1526
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
 
1527
      GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)"
 
1528
      AdditionalOptions="$(HarvestProjectsAdditionalOptions)">
 
1529
 
 
1530
      <Output TaskParameter="OutputFile" ItemName="Compile" />
 
1531
      <Output TaskParameter="OutputFile" ItemName="FileWrites" />
 
1532
 
 
1533
    </HeatProject>
 
1534
 
 
1535
  </Target>
 
1536
 
 
1537
  <!--
 
1538
  ================================================================================================
 
1539
  HarvestDirectory
 
1540
 
 
1541
    Harvests directories using heat.exe.
 
1542
 
 
1543
    [IN]
 
1544
    @(HarvestDirectory) - The list of directories to harvest.
 
1545
    %(HarvestDirectory.Transforms) - XSL transforms to apply to the harvested WiX.
 
1546
    %(HarvestDirectory.ComponentGroupName) -  The name of the ComponentGroup to create.
 
1547
    %(HarvestDirectory.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
 
1548
    %(HarvestDirectory.KeepEmptyDirectories) - Whether to create Directory entries for empty directories.
 
1549
    %(HarvestDirectory.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
 
1550
    %(HarvestDirectory.SuppressCom) - Suppress COM elements.
 
1551
    %(HarvestDirectory.SuppressRootDirectory) - Suppress a Directory element for the root directory.
 
1552
    $(HarvestDirectory.SuppressRegistry) - Suppress registry harvesting.
 
1553
 
 
1554
    [OUT]
 
1555
    $(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs
 
1556
        - The generated .wxs files which are added to the @(Compile) item list.
 
1557
  ================================================================================================
 
1558
  -->
 
1559
 
 
1560
  <ItemDefinitionGroup>
 
1561
    <HarvestDirectory>
 
1562
      <Transforms>$(HarvestDirectoryTransforms)</Transforms>
 
1563
      <ComponentGroupName>$(HarvestDirectoryComponentGroupName)</ComponentGroupName>
 
1564
      <DirectoryRefId>$(HarvestDirectoryDirectoryRefId)</DirectoryRefId>
 
1565
      <KeepEmptyDirectories>$(HarvestDirectoryKeepEmptyDirectories)</KeepEmptyDirectories>
 
1566
      <PreprocessorVariable>$(HarvestDirectoryPreprocessorVariable)</PreprocessorVariable>
 
1567
      <SuppressCom>$(HarvestDirectorySuppressCom)</SuppressCom>
 
1568
      <SuppressRootDirectory>$(HarvestDirectorySuppressRootDirectory)</SuppressRootDirectory>
 
1569
      <SuppressRegistry>$(HarvestDirectorySuppressRegistry)</SuppressRegistry>
 
1570
    </HarvestDirectory>
 
1571
  </ItemDefinitionGroup>
 
1572
 
 
1573
  <PropertyGroup>
 
1574
    <HarvestDirectoryDependsOn>
 
1575
      GetHarvestDirectoryContent
 
1576
    </HarvestDirectoryDependsOn>
 
1577
  </PropertyGroup>
 
1578
 
 
1579
  <!-- Creates items to include content since wildcards will not work in Target/@Inputs. -->
 
1580
  <Target Name="GetHarvestDirectoryContent">
 
1581
    <CreateItem Include="@(HarvestDirectory->'%(FullPath)\**\*')">
 
1582
      <Output TaskParameter="Include" ItemName="_HarvestDirectoryContent" />
 
1583
    </CreateItem>
 
1584
  </Target>
 
1585
 
 
1586
  <Target Name="HarvestDirectory"
 
1587
    DependsOnTargets="$(HarvestDirectoryDependsOn)"
 
1588
    Inputs="@(_HarvestDirectoryContent);%(HarvestDirectory.Transforms)"
 
1589
    Outputs="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
 
1590
    Condition=" '@(HarvestDirectory)' != '' ">
 
1591
 
 
1592
    <HeatDirectory
 
1593
      NoLogo="$(HarvestDirectoryNoLogo)"
 
1594
      SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)"
 
1595
      SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings)"
 
1596
      ToolPath="$(WixToolPath)"
 
1597
      TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)"
 
1598
      TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)"
 
1599
      VerboseOutput="$(HarvestDirectoryVerboseOutput)"
 
1600
      AutogenerateGuids="$(HarvestDirectoryAutogenerateGuids)"
 
1601
      GenerateGuidsNow="$(HarvestDirectoryGenerateGuidsNow)"
 
1602
      OutputFile="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
 
1603
      SuppressFragments="$(HarvestDirectorySuppressFragments)"
 
1604
      SuppressUniqueIds="$(HarvestDirectorySuppressUniqueIds)"
 
1605
      Transforms="%(HarvestDirectory.Transforms)"
 
1606
      Directory="@(HarvestDirectory)"
 
1607
      ComponentGroupName="%(HarvestDirectory.ComponentGroupName)"
 
1608
      DirectoryRefId="%(HarvestDirectory.DirectoryRefId)"
 
1609
      KeepEmptyDirectories="%(HarvestDirectory.KeepEmptyDirectories)"
 
1610
      PreprocessorVariable="%(HarvestDirectory.PreprocessorVariable)"
 
1611
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)" 
 
1612
      SuppressCom="%(HarvestDirectory.SuppressCom)"
 
1613
      SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)"
 
1614
      SuppressRegistry="%(HarvestDirectory.SuppressRegistry)"
 
1615
      AdditionalOptions="$(HarvestDirectoryAdditionalOptions)">
 
1616
 
 
1617
      <Output TaskParameter="OutputFile" ItemName="Compile" />
 
1618
      <Output TaskParameter="OutputFile" ItemName="FileWrites" />
 
1619
 
 
1620
    </HeatDirectory>
 
1621
 
 
1622
  </Target>
 
1623
 
 
1624
  <!--
 
1625
  ================================================================================================
 
1626
  HarvestFile
 
1627
 
 
1628
    Harvests files of different types using heat.exe. This can harvest registry from
 
1629
    self-registering files, files with typelibs, and more.
 
1630
 
 
1631
    [IN]
 
1632
    @(HarvestFile) - The list of files to harvest.
 
1633
    %(HarvestFile.Transforms) - XSL transforms to apply to the harvested WiX.
 
1634
    %(HarvestFile.ComponentGroupName) - The name of the ComponentGroup to create.
 
1635
    %(HarvestFile.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
 
1636
    %(HarvestFile.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
 
1637
    %(HarvestFile.SuppressCom) - Suppress COM elements.
 
1638
    %(HarvestFile.SuppressRootDirectory) - Suppress a Directory element for the root directory.
 
1639
    $(HarvestFile.SuppressRegistry) - Suppress registry harvesting.
 
1640
 
 
1641
    [OUT]
 
1642
    $(IntermediateOutputPath)_%(HarvestFile.Filename)_file.wxs
 
1643
        - The generated .wxs files which are added to the @(Compile) item list.
 
1644
  ================================================================================================
 
1645
  -->
 
1646
 
 
1647
  <ItemDefinitionGroup>
 
1648
    <HarvestFile>
 
1649
      <Transforms>$(HarvestFileTransforms)</Transforms>
 
1650
      <ComponentGroupName>$(HarvestFileComponentGroupName)</ComponentGroupName>
 
1651
      <DirectoryRefId>$(HarvestFileDirectoryRefId)</DirectoryRefId>
 
1652
      <PreprocessorVariable>$(HarvestFilePreprocessorVariable)</PreprocessorVariable>
 
1653
      <SuppressCom>$(HarvestFileSuppressCom)</SuppressCom>
 
1654
      <SuppressRegistry>$(HarvestFileSuppressRegistry)</SuppressRegistry>
 
1655
      <SuppressRootDirectory>$(HarvestFileSuppressRootDirectory)</SuppressRootDirectory>
 
1656
    </HarvestFile>
 
1657
  </ItemDefinitionGroup>
 
1658
 
 
1659
  <PropertyGroup>
 
1660
    <HarvestFileDependsOn></HarvestFileDependsOn>
 
1661
  </PropertyGroup>
 
1662
  <Target Name="HarvestFile"
 
1663
    DependsOnTargets="$(HarvestFileDependsOn)"
 
1664
    Inputs="@(HarvestFile);%(HarvestFile.Transforms)"
 
1665
    Outputs="$(IntermediateOutputPath)_%(HarvestFile.Filename)_file.wxs"
 
1666
    Condition=" '@(HarvestFile)' != '' ">
 
1667
 
 
1668
    <HeatFile
 
1669
      NoLogo="$(HarvestFileNoLogo)"
 
1670
      SuppressAllWarnings="$(HarvestFileSuppressAllWarnings)"
 
1671
      SuppressSpecificWarnings="$(HarvestFileSuppressSpecificWarnings)"
 
1672
      ToolPath="$(WixToolPath)"
 
1673
      TreatWarningsAsErrors="$(HarvestFileTreatWarningsAsErrors)"
 
1674
      TreatSpecificWarningsAsErrors="$(HarvestFileTreatSpecificWarningsAsErrors)"
 
1675
      VerboseOutput="$(HarvestFileVerboseOutput)"
 
1676
      AutogenerateGuids="$(HarvestFileAutogenerateGuids)"
 
1677
      GenerateGuidsNow="$(HarvestFileGenerateGuidsNow)"
 
1678
      OutputFile="$(IntermediateOutputPath)_%(HarvestFile.Filename)_file.wxs"
 
1679
      SuppressFragments="$(HarvestFileSuppressFragments)"
 
1680
      SuppressUniqueIds="$(HarvestFileSuppressUniqueIds)"
 
1681
      Transforms="%(HarvestFile.Transforms)"
 
1682
      File="@(HarvestFile)"
 
1683
      ComponentGroupName="%(HarvestFile.ComponentGroupName)"
 
1684
      DirectoryRefId="%(HarvestFile.DirectoryRefId)"
 
1685
      PreprocessorVariable="%(HarvestFile.PreprocessorVariable)"
 
1686
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)" 
 
1687
      SuppressCom="%(HarvestFile.SuppressCom)"
 
1688
      SuppressRegistry="%(HarvestFile.SuppressRegistry)"
 
1689
      SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)"
 
1690
      AdditionalOptions="$(HarvestFileAdditionalOptions)">
 
1691
 
 
1692
      <Output TaskParameter="OutputFile" ItemName="Compile" />
 
1693
      <Output TaskParameter="OutputFile" ItemName="FileWrites" />
 
1694
 
 
1695
    </HeatFile>
 
1696
 
 
1697
  </Target>
 
1698
 
 
1699
  <!--
 
1700
  ================================================================================================
 
1701
  RefreshGeneratedFile
 
1702
 
 
1703
    Generates code based on metadata defined in project references.
 
1704
 
 
1705
    [IN]
 
1706
    @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
 
1707
 
 
1708
    [OUT]
 
1709
    @(_GeneratedFiles) - The generated source file.
 
1710
  ================================================================================================
 
1711
  -->
 
1712
  <PropertyGroup>
 
1713
    <RefreshGeneratedFileDependsOn></RefreshGeneratedFileDependsOn>
 
1714
  </PropertyGroup>
 
1715
  <Target Name="RefreshGeneratedFile"
 
1716
    DependsOnTargets="$(RefreshGeneratedFileDependsOn)"
 
1717
    Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
 
1718
    Outputs="@(_GeneratedFiles)"
 
1719
    Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module') and '@(_GeneratedFiles)' != '' ">
 
1720
 
 
1721
    <RefreshGeneratedFile
 
1722
      GeneratedFiles="@(_GeneratedFiles)"
 
1723
      ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
 
1724
 
 
1725
  </Target>
 
1726
 
 
1727
  <!--
 
1728
  ================================================================================================
 
1729
  RefreshBundleGeneratedFile
 
1730
 
 
1731
    Generates code for bundle projects based on metadata defined in project references.
 
1732
 
 
1733
    [IN]
 
1734
    @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
 
1735
 
 
1736
    [OUT]
 
1737
    @(_GeneratedFiles) - The generated source file.
 
1738
  ================================================================================================
 
1739
  -->
 
1740
  <PropertyGroup>
 
1741
    <RefreshBundleGeneratedFileDependsOn></RefreshBundleGeneratedFileDependsOn>
 
1742
  </PropertyGroup>
 
1743
  <Target Name="RefreshBundleGeneratedFile"
 
1744
    DependsOnTargets="$(RefreshBundleGeneratedFileDependsOn)"
 
1745
    Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
 
1746
    Outputs="@(_GeneratedFiles)"
 
1747
    Condition=" '$(OutputType)' == 'Bundle' and '@(_GeneratedFiles)' != '' ">
 
1748
 
 
1749
    <RefreshBundleGeneratedFile
 
1750
      GeneratedFiles="@(_GeneratedFiles)"
 
1751
      ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
 
1752
 
 
1753
  </Target>
 
1754
 
 
1755
  <!--
 
1756
  ================================================================================================
 
1757
  GenerateCompileWithObjectPath
 
1758
 
 
1759
    Generates metadata on the for compile output objects.
 
1760
 
 
1761
  ================================================================================================
 
1762
  -->
 
1763
  <PropertyGroup>
 
1764
    <GenerateCompileWithObjectPathDependsOn></GenerateCompileWithObjectPathDependsOn>
 
1765
  </PropertyGroup>
 
1766
  <Target Name="GenerateCompileWithObjectPath"
 
1767
    Condition=" '@(Compile)' != '' ">
 
1768
 
 
1769
    <ItemGroup>
 
1770
      <_CompileWithObjectPath Include="@(Compile)">
 
1771
        <!-- If RelativeDir is not rooted and not in IntermediateOutputPath, and ObjectPath is undefined use IntermediateOutputPath\RelativeDir -->
 
1772
        <ObjectPath Condition=" '%(RelativeDir)%(FileName)%(Extension)' != '%(FullPath)' AND '%(RelativeDir)%(FileName)%(Extension)' != '$(IntermediateOutputPath)%(FileName)%(Extension)' AND '%(Compile.ObjectPath)' == '' " >$(IntermediateOutputPath)%(RelativeDir)</ObjectPath>
 
1773
        <!-- If RelativeDir is rooted or in IntermediateOutputPath, and ObjectPath is undefined use IntermediateOutputPath -->
 
1774
        <ObjectPath Condition=" ('%(RelativeDir)%(FileName)%(Extension)' == '%(FullPath)' OR '%(RelativeDir)%(FileName)%(Extension)' == '$(IntermediateOutputPath)%(FileName)%(Extension)') AND '%(Compile.ObjectPath)' == '' " >$(IntermediateOutputPath)</ObjectPath>
 
1775
      </_CompileWithObjectPath>
 
1776
    </ItemGroup>
 
1777
 
 
1778
  </Target>
 
1779
 
 
1780
  <!--
 
1781
  ================================================================================================
 
1782
  Compile
 
1783
 
 
1784
    Compiles the wxs files into wixobj files using candle.exe.
 
1785
 
 
1786
    [IN]
 
1787
    @(Compile) - The list of wxs files to compile.
 
1788
    @(Content) - Files that the project uses in the installer.
 
1789
    @(WixExtension) - The list of wixlib or wix dll extensions.
 
1790
 
 
1791
    [OUT]
 
1792
    @(CompileObjOutput) - The compiled .wixobj files.
 
1793
  ================================================================================================
 
1794
  -->
 
1795
  <PropertyGroup>
 
1796
    <CompileDependsOn>
 
1797
      PrepareForBuild;
 
1798
      ResolveWixExtensionReferences;
 
1799
      GenerateCompileWithObjectPath
 
1800
    </CompileDependsOn>
 
1801
  </PropertyGroup>
 
1802
  <Target
 
1803
    Name="Compile"
 
1804
    Inputs="@(Compile);
 
1805
            @(Content);
 
1806
            @(_ResolvedWixExtensionPaths);
 
1807
            @(_ResolvedProjectReferencePaths);
 
1808
            $(MSBuildAllProjects)"
 
1809
    Outputs="@(_CompileWithObjectPath  -> '%(ObjectPath)%(Filename)$(IntermediateExt)')"
 
1810
    DependsOnTargets="$(CompileDependsOn)"
 
1811
    Condition=" '@(Compile)' != '' ">
 
1812
 
 
1813
    <Candle
 
1814
      SourceFiles="@(_CompileWithObjectPath)"
 
1815
      AdditionalOptions="$(CompilerAdditionalOptions)" 
 
1816
      DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)"
 
1817
      ExtensionDirectory="$(WixExtDir)"
 
1818
      Extensions="@(_ResolvedWixExtensionPaths)"
 
1819
      FipsCompliant="$(FipsCompliant)"
 
1820
      SuppressFilesVitalByDefault="$(SuppressFilesVitalByDefault)"
 
1821
      PreprocessToStdOut="$(PreprocessToStdOut)"
 
1822
      PreprocessToFile="$(PreprocessToFile)"
 
1823
      IncludeSearchPaths="$(IncludeSearchPaths)"
 
1824
      InstallerPlatform="$(InstallerPlatform)"
 
1825
      NoLogo="$(CompilerNoLogo)"
 
1826
      OnlyValidateDocuments="$(OnlyValidateDocuments)" 
 
1827
      OutputFile="%(_CompileWithObjectPath.ObjectPath)"
 
1828
      Pedantic="$(Pedantic)"
 
1829
      ReferencePaths="$(ReferencePaths)"
 
1830
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
 
1831
      ShowSourceTrace="$(ShowSourceTrace)"
 
1832
      SuppressAllWarnings="$(CompilerSuppressAllWarnings)"
 
1833
      SuppressSchemaValidation="$(CompilerSuppressSchemaValidation)"
 
1834
      SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings)"
 
1835
      ToolPath="$(WixToolPath)"
 
1836
      TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors)"
 
1837
      TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)" 
 
1838
      VerboseOutput="$(CompilerVerboseOutput)">
 
1839
    </Candle>
 
1840
 
 
1841
    <ItemGroup>
 
1842
        <CompileObjOutput Include="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename)$(IntermediateExt)')" />
 
1843
    </ItemGroup>
 
1844
  </Target>
 
1845
 
 
1846
  <!--
 
1847
  ================================================================================================
 
1848
  Inscribe
 
1849
 
 
1850
    To be called after signing an MSI's cabs - inscribes an MSI with the digital signature of its
 
1851
      external cabs.
 
1852
 
 
1853
    [IN/OUT]
 
1854
    @(Inscribe) - The list of database files to inscribe - database files will be modified in-place.
 
1855
 
 
1856
  ================================================================================================
 
1857
  -->
 
1858
  <PropertyGroup>
 
1859
    <InscribeDependsOn>
 
1860
      PrepareForBuild;
 
1861
      ResolveWixExtensionReferences;
 
1862
      CompileAndLink;
 
1863
      SignCabs
 
1864
    </InscribeDependsOn>
 
1865
  </PropertyGroup>
 
1866
  <Target
 
1867
    Name="Inscribe"
 
1868
    DependsOnTargets="$(InscribeDependsOn)"
 
1869
    Condition=" '@(Inscribe)' != '' and '$(OutputCabList)' != ''">
 
1870
 
 
1871
    <Insignia
 
1872
      DatabaseFiles="@(Inscribe)"
 
1873
      ToolPath="$(WixToolPath)"
 
1874
      NoLogo="$(InscribeNoLogo)"
 
1875
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
 
1876
      SuppressAllWarnings="$(InscribeSuppressAllWarnings)"
 
1877
      SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)"
 
1878
      TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)"
 
1879
      TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)"
 
1880
      VerboseOutput="$(InscribeVerboseOutput)"
 
1881
      AdditionalOptions="$(InscribeAdditionalOptions)">
 
1882
    </Insignia>
 
1883
  </Target>
 
1884
 
 
1885
  <!--
 
1886
  ================================================================================================
 
1887
  Lib
 
1888
 
 
1889
    Links the .wixobj, .wxl, .wixlib, wix extensions into a .wixlib file using lit.exe.
 
1890
 
 
1891
    [IN]
 
1892
    @(CompileObjOutput) - The compiled .wixobj file.
 
1893
    @(EmbeddedResource) - The list of wxl files to use for localization.
 
1894
    @(WixObject) - The list of .wixobj files.
 
1895
    @(WixLibrary) - The list of .wixlib files.
 
1896
    @(WixExtension) - The list of wix dll extension files.
 
1897
 
 
1898
    [OUT]
 
1899
    $(TargetPath) - The compiled .wixlib file.
 
1900
  ================================================================================================
 
1901
  -->
 
1902
  <PropertyGroup>
 
1903
    <LibDependsOn>
 
1904
      PrepareForBuild;
 
1905
      ResolveWixExtensionReferences
 
1906
    </LibDependsOn>
 
1907
  </PropertyGroup>
 
1908
  <Target
 
1909
    Name="Lib"
 
1910
    Inputs="@(CompileObjOutput);
 
1911
            @(EmbeddedResource);
 
1912
            @(WixObject);
 
1913
            @(WixLibrary);
 
1914
            @(_ResolvedWixExtensionPaths);
 
1915
            $(MSBuildAllProjects)"
 
1916
    Outputs="$(TargetPath)"
 
1917
    DependsOnTargets="$(LibDependsOn)"
 
1918
    Condition=" '$(OutputType)' == 'Library' ">
 
1919
 
 
1920
    <Lit
 
1921
      ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)"
 
1922
      AdditionalOptions="$(LibAdditionalOptions)" 
 
1923
      BaseInputPaths="$(LinkerBaseInputPaths)"
 
1924
      BindFiles="$(LibBindFiles)"
 
1925
      ExtensionDirectory="$(WixExtDir)"
 
1926
      Extensions="@(_ResolvedWixExtensionPaths)"
 
1927
      LocalizationFiles="@(EmbeddedResource)"
 
1928
      NoLogo="$(LibNoLogo)"
 
1929
      OutputFile="$(TargetPath)"
 
1930
      Pedantic="$(LibPedantic)"
 
1931
      ReferencePaths="$(ReferencePaths)"
 
1932
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
 
1933
      SuppressAllWarnings="$(LibSuppressAllWarnings)"
 
1934
      SuppressIntermediateFileVersionMatching="$(LibSuppressIntermediateFileVersionMatching)"
 
1935
      SuppressSchemaValidation="$(LibSuppressSchemaValidation)"
 
1936
      SuppressSpecificWarnings="$(LibSuppressSpecificWarnings)"
 
1937
      ToolPath="$(WixToolPath)"
 
1938
      TreatWarningsAsErrors="$(LibTreatWarningsAsErrors)"
 
1939
      VerboseOutput="$(LibVerboseOutput)" />
 
1940
  </Target>
 
1941
 
 
1942
  <!--
 
1943
  ================================================================================================
 
1944
  AssignCultures
 
1945
 
 
1946
    Determines the final list of culture groups to build based on either the Cultures property or
 
1947
    those specified in .wxl files. 
 
1948
    
 
1949
      Culture groups specified in the Cultures property must be specified as a semi-colon 
 
1950
      delimited  list of groups, with comma-delimited cultures within a group.  
 
1951
      For example:
 
1952
        <Cultures>en-US,en;en-GB,en</Cultures>
 
1953
      This will build 2 targets, outputing to en-US and en-GB sub-folders.  Light will first look
 
1954
      for strings in the first culture (en-US or en-GB) then the second (en).
 
1955
    
 
1956
      Cultures of .wxl files will be used when the Culture property is not set.  The culture of a 
 
1957
      .wxl file is determined by the Culture attribute in the WixLocalization element in the file
 
1958
 
 
1959
    Sets the OutputFolder metadata on each culture group.  In most cases this is the same as the 
 
1960
    first culture in the culture group.  When the Culture's property is unspecified and no .wxl 
 
1961
    files are provided this is the same as the output directory.  When the Culture's property 
 
1962
    specifies a single culture group and no .wxl files are provided this is the same as the output
 
1963
    directory.
 
1964
 
 
1965
    Updates the TargetPath and TargetPdbPath properties to be used in subsequent targets.
 
1966
    
 
1967
    [IN]
 
1968
    @(EmbeddedResource) - The list of wxl files to use for localization.
 
1969
    $(Cultures) - The list of culture groups to build.
 
1970
 
 
1971
    [OUT]
 
1972
    @(CultureGroup) - The list of culture group strings with OutputFolder metadata
 
1973
    $(TargetPath) - Property list of target link output MSIs/MSMs
 
1974
    $(TargetPdbPath) - Property list of target output pdbs
 
1975
    
 
1976
  ================================================================================================
 
1977
  -->
 
1978
  <Target 
 
1979
    Name="AssignCultures"
 
1980
    Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module')">
 
1981
    
 
1982
    <WixAssignCulture
 
1983
      Cultures="$(Cultures)"
 
1984
      Files="@(EmbeddedResource)"
 
1985
      >
 
1986
 
 
1987
      <Output TaskParameter="CultureGroups" ItemName="CultureGroup" />
 
1988
    </WixAssignCulture>
 
1989
 
 
1990
    <!-- Build an itemgroup of outputs -->
 
1991
    <CreateItem
 
1992
      Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)">
 
1993
      <Output TaskParameter="Include"
 
1994
              ItemName="_TargetPathItems"/>
 
1995
    </CreateItem>
 
1996
    
 
1997
    <!-- Convert the itemgroup to a semicolon-delimited property -->
 
1998
    <CreateProperty
 
1999
      Value="@(_TargetPathItems)">
 
2000
      <Output TaskParameter="Value"
 
2001
              PropertyName="TargetPath"/>
 
2002
    </CreateProperty>
 
2003
 
 
2004
    <!-- Build an itemgroup of PDB outputs -->
 
2005
    <CreateItem
 
2006
      Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetPdbExt)">
 
2007
      <Output TaskParameter="Include"
 
2008
              ItemName="_TargetPdbPathItems"/>
 
2009
    </CreateItem>
 
2010
 
 
2011
    <!-- Convert the itemgroup to a semicolon-delimited property -->
 
2012
    <CreateProperty
 
2013
      Value="@(_TargetPdbPathItems)">
 
2014
      <Output TaskParameter="Value"
 
2015
              PropertyName="TargetPdbPath"/>
 
2016
    </CreateProperty>
 
2017
  </Target>
 
2018
 
 
2019
  <!--
 
2020
  ================================================================================================
 
2021
  Link
 
2022
 
 
2023
    Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe,
 
2024
    once per culture group. All WXL files are passed into light and the culture switch determines
 
2025
    which are used
 
2026
 
 
2027
    [IN]
 
2028
    @(CompileObjOutput) - The compiled .wixobj file.
 
2029
    @(CultureGroup) - The cultures to build
 
2030
    @(EmbeddedResource) - The list of wxl files to use for localization.
 
2031
    @(WixObject) - The list of .wixobj files.
 
2032
    @(WixLibrary) - The list of .wixlib files.
 
2033
    @(WixExtension) - The list of wix dll extension files.
 
2034
 
 
2035
    [OUT]
 
2036
    $(TargetDir)\%(Culture)\$(TargetName)$(TargetExt) - The compiled .msi, .msm, or .exe files.
 
2037
  ================================================================================================
 
2038
  -->
 
2039
  <PropertyGroup>
 
2040
    <LinkDependsOn>
 
2041
      PrepareForBuild;
 
2042
      ResolveReferences;
 
2043
      AssignCultures;
 
2044
    </LinkDependsOn>
 
2045
  </PropertyGroup>
 
2046
  
 
2047
  <Target
 
2048
    Name="Link"
 
2049
    Inputs="@(CompileObjOutput);
 
2050
            @(EmbeddedResource);
 
2051
            @(WixObject);
 
2052
            @(_ResolvedProjectReferencePaths);
 
2053
            @(_ResolvedWixLibraryPaths);
 
2054
            @(_ResolvedWixExtensionPaths);
 
2055
            $(MSBuildAllProjects)"
 
2056
    Outputs="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
 
2057
    DependsOnTargets="$(LinkDependsOn)"
 
2058
    Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' or '$(OutputType)' == 'Bundle')">
 
2059
 
 
2060
    <CreateProperty Condition=" '$(OutputType)' != 'Bundle' " Value="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetPdbExt)">
 
2061
      <Output TaskParameter="Value" PropertyName="PdbOutputFile" />
 
2062
    </CreateProperty>
 
2063
 
 
2064
    <!-- Call light using the culture subdirectory for output -->
 
2065
    <Light
 
2066
      ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(_ResolvedWixLibraryPaths)"
 
2067
      AdditionalOptions="$(LinkerAdditionalOptions)" 
 
2068
      AllowIdenticalRows="$(AllowIdenticalRows)"
 
2069
      AllowUnresolvedReferences="$(AllowUnresolvedReferences)"
 
2070
      AdditionalCub="$(AdditionalCub)" 
 
2071
      BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)" 
 
2072
      BaseInputPaths="$(LinkerBaseInputPaths)"
 
2073
      BindFiles="$(LinkerBindFiles)"
 
2074
      CabinetCachePath="$(CabinetCachePath)"
 
2075
      CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
 
2076
      Cultures="%(CultureGroup.Identity)"
 
2077
      CustomBinder="$(CustomBinder)"
 
2078
      DefaultCompressionLevel="$(DefaultCompressionLevel)"
 
2079
      DropUnrealTables="$(DropUnrealTables)"
 
2080
      ExactAssemblyVersions="$(ExactAssemblyVersions)"
 
2081
      ExtensionDirectory="$(WixExtDir)"
 
2082
      Extensions="@(_ResolvedWixExtensionPaths)"
 
2083
      Ices="$(Ices)"
 
2084
      LeaveTemporaryFiles="$(LeaveTemporaryFiles)"
 
2085
      LocalizationFiles="@(EmbeddedResource)"
 
2086
      NoLogo="$(LinkerNoLogo)"
 
2087
      OutputAsXml="$(OutputAsXml)"
 
2088
      OutputFile="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
 
2089
      PdbOutputFile="$(PdbOutputFile)"
 
2090
      Pedantic="$(LinkerPedantic)"
 
2091
      ReferencePaths="$(ReferencePaths)"
 
2092
      ReuseCabinetCache="$(ReuseCabinetCache)"
 
2093
      RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
 
2094
      SetMsiAssemblyNameFileVersion="$(SetMsiAssemblyNameFileVersion)"
 
2095
      SuppressAclReset="$(SuppressAclReset)"
 
2096
      SuppressAllWarnings="$(LinkerSuppressAllWarnings)"
 
2097
      SuppressAssemblies="$(SuppressAssemblies)"
 
2098
      SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)"
 
2099
      SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)"
 
2100
      SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)"
 
2101
      SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)"
 
2102
      SuppressFiles="$(SuppressFiles)"
 
2103
      SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)"
 
2104
      SuppressIces="$(SuppressIces)"
 
2105
      SuppressLayout="$(SuppressLayout)"
 
2106
      SuppressLocalization="$(SuppressLocalization)"
 
2107
      SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)"
 
2108
      SuppressPdbOutput="$(SuppressPdbOutput)"
 
2109
      SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)"
 
2110
      SuppressValidation="$(SuppressValidation)"
 
2111
      SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)"
 
2112
      SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)"
 
2113
      ToolPath="$(WixToolPath)"
 
2114
      TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)"
 
2115
      UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
 
2116
      VerboseOutput="$(LinkerVerboseOutput)"
 
2117
      WixVariables="$(WixVariables)" />
 
2118
 
 
2119
    <GetCabList Database="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
 
2120
        Condition="('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module') and '$(OutputAsXml)' != 'true' " >
 
2121
      <Output TaskParameter="CabList" PropertyName="OutputCabs" />
 
2122
      <Output TaskParameter="CabList" ItemName="FileWrites" />
 
2123
    </GetCabList>
 
2124
 
 
2125
    <GetLooseFileList Database="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
 
2126
        Condition="('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module') and '$(OutputAsXml)' != 'true' " >
 
2127
      <Output TaskParameter="LooseFileList" ItemName="FileWrites" />
 
2128
    </GetLooseFileList>
 
2129
 
 
2130
    <CreateItem Include="$(OutputCabs)" >
 
2131
      <Output TaskParameter="Include" ItemName="OutputCabList" />
 
2132
    </CreateItem>
 
2133
    
 
2134
  </Target>
 
2135
 
 
2136
  <!--
 
2137
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2138
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2139
  IncrementalClean Targets
 
2140
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2141
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2142
  -->
 
2143
 
 
2144
  <!--
 
2145
  ==================================================================================================
 
2146
  IncrementalClean
 
2147
 
 
2148
    Remove files that were produced in a prior build but weren't produced in the current build.
 
2149
    The reason is that if, for example, the name of the .msi/.msm has changed we want to delete the
 
2150
    old copy.
 
2151
 
 
2152
    Leave the Clean cache file containing only the files produced in the current build.
 
2153
  ==================================================================================================
 
2154
  -->
 
2155
  <Target
 
2156
    Name="IncrementalClean"
 
2157
    DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
 
2158
 
 
2159
    <!-- Subtract list of files produced in prior builds from list of files produced in this build. -->
 
2160
    <CreateItem Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)">
 
2161
      <Output TaskParameter="Include" ItemName="_CleanOrphanFileWrites" />
 
2162
    </CreateItem>
 
2163
 
 
2164
    <!-- Find all files in the final output directory. -->
 
2165
    <FindUnderPath Path="$(OutDir)" Files="@(_CleanOrphanFileWrites)">
 
2166
      <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInOutput" />
 
2167
    </FindUnderPath>
 
2168
 
 
2169
    <!-- Find all files in the intermediate output directory. -->
 
2170
    <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanOrphanFileWrites)">
 
2171
      <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInIntermediate" />
 
2172
    </FindUnderPath>
 
2173
 
 
2174
    <!-- Delete the orphaned files. -->
 
2175
    <Delete
 
2176
      Files="@(_CleanOrphanFileWritesInIntermediate);@(_CleanOrphanFileWritesInOutput)"
 
2177
      TreatErrorsAsWarnings="true">
 
2178
 
 
2179
      <Output TaskParameter="DeletedFiles" ItemName="_CleanOrphanFilesDeleted" />
 
2180
    </Delete>
 
2181
 
 
2182
    <!-- Create a list of everything that wasn't deleted. -->
 
2183
    <CreateItem Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)">
 
2184
      <Output TaskParameter="Include" ItemName="_CleanRemainingFileWritesAfterIncrementalClean" />
 
2185
    </CreateItem>
 
2186
 
 
2187
    <!-- Remove duplicates. -->
 
2188
    <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterIncrementalClean)">
 
2189
      <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWritesAfterIncrementalClean" />
 
2190
    </RemoveDuplicates>
 
2191
 
 
2192
    <!-- Make sure the directory exists. -->
 
2193
    <MakeDir Directories="$(IntermediateOutputPath)" />
 
2194
 
 
2195
    <!-- Write new list of current files back to disk, replacing the existing list.-->
 
2196
    <WriteLinesToFile
 
2197
      File="$(IntermediateOutputPath)$(CleanFile)"
 
2198
      Lines="@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)"
 
2199
      Overwrite="true" />
 
2200
 
 
2201
  </Target>
 
2202
 
 
2203
  <!--
 
2204
  ==================================================================================================
 
2205
  _CleanGetCurrentAndPriorFileWrites
 
2206
 
 
2207
    Get the list of files built in the current build and in prior builds.
 
2208
  ==================================================================================================
 
2209
  -->
 
2210
  <Target
 
2211
    Name="_CleanGetCurrentAndPriorFileWrites"
 
2212
    DependsOnTargets="_CheckForCompileAndLinkOutputs">
 
2213
 
 
2214
    <!-- Read the list of files produced by a prior builds from disk. -->
 
2215
    <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
 
2216
      <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites" />
 
2217
    </ReadLinesFromFile>
 
2218
 
 
2219
    <!-- Find all files in the final output directory. -->
 
2220
    <FindUnderPath Path="$(OutDir)" Files="@(FileWrites)">
 
2221
      <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInOutput" />
 
2222
    </FindUnderPath>
 
2223
 
 
2224
    <!-- Find all files in the intermediate output directory. -->
 
2225
    <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(FileWrites)">
 
2226
      <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInIntermediate" />
 
2227
    </FindUnderPath>
 
2228
 
 
2229
    <!-- Remove duplicates from files produced in this build. -->
 
2230
    <RemoveDuplicates Inputs="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)">
 
2231
      <Output TaskParameter="Filtered" ItemName="_CleanCurrentFileWrites" />
 
2232
    </RemoveDuplicates>
 
2233
 
 
2234
  </Target>
 
2235
 
 
2236
  <!--
 
2237
  ==================================================================================================
 
2238
  _CheckForCompileAndLinkOutputs
 
2239
 
 
2240
    Checks each file output from the main CompileAndLink target to make sure they really exist.
 
2241
    If they do, then record them in the clean cache.
 
2242
  ==================================================================================================
 
2243
  -->
 
2244
  <Target Name="_CheckForCompileAndLinkOutputs">
 
2245
 
 
2246
    <!--Record the main compile outputs -->
 
2247
    <CreateItem Include="@(CompileObjOutput)" Condition="Exists('%(FullPath)')">
 
2248
      <Output TaskParameter="Include" ItemName="FileWrites" />
 
2249
    </CreateItem>
 
2250
 
 
2251
    <!-- Record the link ouput(s) -->
 
2252
    <!-- Stuff into an itemgroup -->
 
2253
    <CreateItem Include="$(TargetPath);$(TargetPdbPath)">
 
2254
      <Output TaskParameter="Include" ItemName="_TempTargetOutputs" />
 
2255
    </CreateItem>
 
2256
 
 
2257
    <CreateItem Include="@(_TempTargetOutputs)" Condition="Exists('%(FullPath)')">
 
2258
      <Output TaskParameter="Include" ItemName="FileWrites" />
 
2259
    </CreateItem>
 
2260
  </Target>
 
2261
 
 
2262
  <!--
 
2263
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2264
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2265
  Clean Targets
 
2266
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2267
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2268
  -->
 
2269
 
 
2270
  <!--
 
2271
  ==================================================================================================
 
2272
  Clean
 
2273
 
 
2274
    Delete all intermediate and final build outputs.
 
2275
  ==================================================================================================
 
2276
  -->
 
2277
  <PropertyGroup>
 
2278
    <CleanDependsOn>
 
2279
      BeforeClean;
 
2280
      CleanReferencedProjects;
 
2281
      CoreClean;
 
2282
      AfterClean
 
2283
    </CleanDependsOn>
 
2284
  </PropertyGroup>
 
2285
  <Target
 
2286
    Name="Clean"
 
2287
    DependsOnTargets="$(CleanDependsOn)" />
 
2288
 
 
2289
  <!--
 
2290
  ==================================================================================================
 
2291
  BeforeClean
 
2292
 
 
2293
    Redefine this target in your project in order to run tasks just before Clean.
 
2294
  ==================================================================================================
 
2295
  -->
 
2296
  <Target Name="BeforeClean" />
 
2297
 
 
2298
  <!--
 
2299
  ==================================================================================================
 
2300
  AfterClean
 
2301
 
 
2302
    Redefine this target in your project in order to run tasks just after Clean.
 
2303
  ==================================================================================================
 
2304
  -->
 
2305
  <Target Name="AfterClean" />
 
2306
 
 
2307
  <!--
 
2308
  ==================================================================================================
 
2309
  CleanReferencedProjects
 
2310
 
 
2311
    Call Clean target on all Referenced Projects.
 
2312
  ==================================================================================================
 
2313
  -->
 
2314
  <Target
 
2315
    Name="CleanReferencedProjects">
 
2316
 
 
2317
    <!-- TODO -->
 
2318
    <!--
 
2319
    When building the project directly from the command-line, clean those referenced projects that
 
2320
    exist on disk. For IDE builds and command-line .SLN builds, the solution build manager takes
 
2321
    care of this.
 
2322
    -->
 
2323
    <!--MSBuild
 
2324
      Projects="@(_MSBuildProjectReferenceExistent)"
 
2325
      Targets="Clean"
 
2326
      Condition=" '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildingSolutionFile)' != 'true' and '@(_MSBuildProjectReferenceExistent)' != '' " /-->
 
2327
 
 
2328
  </Target>
 
2329
 
 
2330
  <!--
 
2331
  ==================================================================================================
 
2332
  CoreClean
 
2333
 
 
2334
    Cleans all of the compile and link outputs as well as any intermediate files generated along
 
2335
    the way.
 
2336
  ==================================================================================================
 
2337
  -->
 
2338
  <PropertyGroup>
 
2339
    <CoreCleanDependsOn></CoreCleanDependsOn>
 
2340
  </PropertyGroup>
 
2341
  <Target
 
2342
    Name="CoreClean"
 
2343
    DependsOnTargets="$(CoreCleanDependsOn)">
 
2344
 
 
2345
    <!-- Read in list of files that were written to disk in past builds. -->
 
2346
    <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
 
2347
      <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites" />
 
2348
    </ReadLinesFromFile>
 
2349
 
 
2350
    <!-- Find all files in the final output directory. -->
 
2351
    <FindUnderPath Path="$(OutDir)" Files="@(_CleanPriorFileWrites)">
 
2352
      <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInOutput" />
 
2353
    </FindUnderPath>
 
2354
 
 
2355
    <!-- Find all files in the intermediate output directory. -->
 
2356
    <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanPriorFileWrites)">
 
2357
      <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInIntermediate" />
 
2358
    </FindUnderPath>
 
2359
 
 
2360
    <!-- Delete those files. -->
 
2361
    <Delete Files="@(_CleanPriorFileWritesInOutput);@(_CleanPriorFileWritesInIntermediate)" TreatErrorsAsWarnings="true">
 
2362
      <Output TaskParameter="DeletedFiles" ItemName="_CleanPriorFileWritesDeleted" />
 
2363
    </Delete>
 
2364
 
 
2365
    <!-- Create a list of everything that wasn't deleted. -->
 
2366
    <CreateItem Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)">
 
2367
      <Output TaskParameter="Include" ItemName="_CleanRemainingFileWritesAfterClean" />
 
2368
    </CreateItem>
 
2369
 
 
2370
    <!-- Remove duplicates. -->
 
2371
    <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterClean)">
 
2372
      <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWrites" />
 
2373
    </RemoveDuplicates>
 
2374
 
 
2375
    <!-- Make sure the directory exists. -->
 
2376
    <MakeDir Directories="$(IntermediateOutputPath)" />
 
2377
 
 
2378
    <!-- Write new list of current files back to disk. -->
 
2379
    <WriteLinesToFile File="$(IntermediateOutputPath)$(CleanFile)" Lines="@(_CleanUniqueRemainingFileWrites)" Overwrite="true" />
 
2380
 
 
2381
  </Target>
 
2382
 
 
2383
  <!--
 
2384
  ==================================================================================================
 
2385
  _CleanRecordFileWrites
 
2386
 
 
2387
    Save the list of all files written to disk so that it can be used for "Clean" later.
 
2388
    Files written in prior builds are not removed from Clean cache.
 
2389
  ==================================================================================================
 
2390
  -->
 
2391
  <Target
 
2392
    Name="_CleanRecordFileWrites"
 
2393
    DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
 
2394
 
 
2395
    <!-- Merge list of files from prior builds with the current build and then remove duplicates. -->
 
2396
    <RemoveDuplicates Inputs="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)">
 
2397
      <Output TaskParameter="Filtered" ItemName="_CleanUniqueFileWrites" />
 
2398
    </RemoveDuplicates>
 
2399
 
 
2400
    <!-- Make sure the directory exists. -->
 
2401
    <MakeDir Directories="$(IntermediateOutputPath)" />
 
2402
 
 
2403
    <!-- Write merged file list back to disk, replacing existing contents. -->
 
2404
    <WriteLinesToFile
 
2405
        File="$(IntermediateOutputPath)$(CleanFile)"
 
2406
        Lines="@(_CleanUniqueFileWrites)"
 
2407
        Overwrite="true" />
 
2408
 
 
2409
  </Target>
 
2410
 
 
2411
  <!--
 
2412
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2413
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2414
  PostBuildEvent Targets
 
2415
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2416
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2417
  -->
 
2418
 
 
2419
  <!--
 
2420
  ==================================================================================================
 
2421
  PostBuildEvent
 
2422
 
 
2423
    Run the post-build event. This step is driven by two parameters:
 
2424
 
 
2425
    1) $(RunPostBuildEvent) is set by the user through the IDE and can be one of four values:
 
2426
       1) OnBuildSuccess: In this case, every step of the build must succeed for the post-build
 
2427
          step to run.
 
2428
       2) <Blank>: This is the same as OnBuildSuccess.
 
2429
       3) OnOutputUpdated: In this case, the post-build step will run only if the main output was
 
2430
          actually updated.
 
2431
       4) Always: The post-build step is always run.
 
2432
 
 
2433
    2) $(_TargetOutputTimestampBeforeCompileAndLink) and $(_TargetOutputTimestampAfterCompileAndLink)
 
2434
       are set by the _TimeStampBeforeCompileAndLink and _TimeStampAfterCompileAndLink targets. If
 
2435
       the output was actually rebuilt during this build, then the two values will be different.
 
2436
  ==================================================================================================
 
2437
  -->
 
2438
  <PropertyGroup>
 
2439
    <PostBuildEventDependsOn>GetTargetPath</PostBuildEventDependsOn>
 
2440
  </PropertyGroup>
 
2441
  <Target
 
2442
    Name="PostBuildEvent"
 
2443
    Condition=" '$(PostBuildEvent)' != '' and
 
2444
      ( '$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_TargetOutputTimestampBeforeCompileAndLink)' != '$(_TargetOutputTimestampAfterCompileAndLink)' )"
 
2445
    DependsOnTargets="$(PostBuildEventDependsOn)">
 
2446
 
 
2447
    <ReplaceString
 
2448
      Text="$(PostBuildEvent)"
 
2449
      OldValue="!(TargetPath)"
 
2450
      NewValue="$(TargetPath)">
 
2451
      
 
2452
      <Output TaskParameter="Text" PropertyName="ExpandedPostBuildEvent" />
 
2453
    </ReplaceString>
 
2454
 
 
2455
    <ReplaceString
 
2456
      Text="$(ExpandedPostBuildEvent)"
 
2457
      OldValue="!(TargetPdbPath)"
 
2458
      NewValue="$(TargetPdbPath)">
 
2459
      
 
2460
      <Output TaskParameter="Text" PropertyName="ExpandedPostBuildEvent" />
 
2461
    </ReplaceString>
 
2462
 
 
2463
    <Exec WorkingDirectory="$(OutDir)" Command="$(ExpandedPostBuildEvent)" />
 
2464
  </Target>
 
2465
 
 
2466
  <!--
 
2467
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2468
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2469
  AllProjectOutputGroups Section
 
2470
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2471
  //////////////////////////////////////////////////////////////////////////////////////////////////
 
2472
  -->
 
2473
 
 
2474
  <!--
 
2475
  ==================================================================================================
 
2476
  AllProjectOutputGroups
 
2477
 
 
2478
    The targets below drive output groups, which provide generic information about a
 
2479
    project's inputs (e.g., content files, compilation sources, etc.) and built outputs
 
2480
    (e.g., built EXE/DLL, PDB, XML documentation files, etc.)
 
2481
 
 
2482
    Each target may produce two kinds of items:  outputs and dependencies. Outputs are
 
2483
    items from the current project; dependencies are items that are brought into the
 
2484
    current project as a result of referencing other projects or components.
 
2485
 
 
2486
    For both outputs and dependencies, the Include attribute
 
2487
    specifies the location of the output/dependency; it must be a full path. Any number
 
2488
    of additional attributes may be placed on an output/dependency item.
 
2489
  ==================================================================================================
 
2490
  -->
 
2491
  <Target
 
2492
    Name="AllProjectOutputGroups"
 
2493
    DependsOnTargets="
 
2494
      BuiltProjectOutputGroup;
 
2495
      DebugSymbolsProjectOutputGroup;
 
2496
      DocumentationProjectOutputGroup;
 
2497
      SatelliteDllsProjectOutputGroup;
 
2498
      SourceFilesProjectOutputGroup;
 
2499
      ContentFilesProjectOutputGroup;
 
2500
      SGenFilesOutputGroup" />
 
2501
 
 
2502
  <!-- 
 
2503
  This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE.
 
2504
  Reading an item is faster than invoking a target.
 
2505
  -->
 
2506
  <ItemGroup>
 
2507
    <BuiltProjectOutputGroupKeyOutput Include="$(TargetPath)">
 
2508
      <IsKeyOutput>true</IsKeyOutput>
 
2509
      <FinalOutputPath>$(TargetPath)</FinalOutputPath>
 
2510
      <TargetPath>$(TargetFileName)</TargetPath>
 
2511
    </BuiltProjectOutputGroupKeyOutput>
 
2512
  </ItemGroup>
 
2513
 
 
2514
  <!--
 
2515
  ==================================================================================================
 
2516
  BuiltProjectOutputGroup
 
2517
  ==================================================================================================
 
2518
  -->
 
2519
  <PropertyGroup>
 
2520
    <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignCultures</BuiltProjectOutputGroupDependsOn>
 
2521
    <AddAppConfigToBuildOutputs Condition="('$(AddAppConfigToBuildOutputs)' == '') and ('$(OutputType)' != 'library')">true</AddAppConfigToBuildOutputs>
 
2522
  </PropertyGroup>
 
2523
  <Target
 
2524
    Name="BuiltProjectOutputGroup"
 
2525
    Outputs="@(BuiltProjectOutputGroupOutput)"
 
2526
    DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)">
 
2527
 
 
2528
    <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below -->
 
2529
 
 
2530
    <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2531
    <ItemGroup>
 
2532
        <BuiltProjectOutputGroupOutput Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2533
            <!-- For compatibility with 2.0 -->
 
2534
            <OriginalItemSpec Condition="'%(_BuiltProjectOutputGroupOutputIntermediate.OriginalItemSpec)' == ''">%(_BuiltProjectOutputGroupOutputIntermediate.FullPath)</OriginalItemSpec>
 
2535
        </BuiltProjectOutputGroupOutput>
 
2536
    </ItemGroup>
 
2537
 
 
2538
    <!-- Include build output(s).  Different than predefined itemgroup since AssignCultures target may change it -->
 
2539
    <CreateItem
 
2540
      Include="$(TargetPath)">
 
2541
      <Output TaskParameter="Include" ItemName="BuiltProjectOutputGroupOutput" />
 
2542
    </CreateItem>
 
2543
 
 
2544
    <GetCabList Database="@(BuiltProjectOutputGroupKeyOutput)" Condition="('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module')">
 
2545
      <Output TaskParameter="CabList" ItemName="BuiltProjectOutputGroupOutput" />
 
2546
    </GetCabList>
 
2547
 
 
2548
    <GetLooseFileList Database="@(BuiltProjectOutputGroupKeyOutput)" Condition="('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module')" >
 
2549
      <Output TaskParameter="LooseFileList" ItemName="BuiltProjectOutputGroupOutput" />
 
2550
    </GetLooseFileList>
 
2551
 
 
2552
  </Target>
 
2553
 
 
2554
  <!--
 
2555
  ==================================================================================================
 
2556
  DebugSymbolsProjectOutputGroup
 
2557
 
 
2558
    Populates the Debug Symbols project output group.
 
2559
  ==================================================================================================
 
2560
  -->
 
2561
  <PropertyGroup>
 
2562
    <DebugSymbolsProjectOutputGroupDependsOn>AssignCultures</DebugSymbolsProjectOutputGroupDependsOn>
 
2563
  </PropertyGroup>
 
2564
  <Target
 
2565
    Name="DebugSymbolsProjectOutputGroup"
 
2566
    Outputs="@(DebugSymbolsProjectOutputGroupOutput)"
 
2567
    DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)">
 
2568
 
 
2569
    <!-- Include build output pdb(s).  Different than predefined itemgroup since AssignCultures target may change -->
 
2570
    <CreateItem
 
2571
      Include="$(TargetPdbPath)"
 
2572
      Condition=" '$(SuppressPdbOutput)' != 'true' ">
 
2573
      <Output TaskParameter="Include" ItemName="DebugSymbolsProjectOutputGroupOutput" />
 
2574
    </CreateItem>
 
2575
  </Target>
 
2576
 
 
2577
  <!--
 
2578
  ==================================================================================================
 
2579
  DocumentationProjectOutputGroup
 
2580
 
 
2581
    Populates the Documentation project output group.
 
2582
  ==================================================================================================
 
2583
  -->
 
2584
  <PropertyGroup>
 
2585
    <DocumentationProjectOutputGroupDependsOn></DocumentationProjectOutputGroupDependsOn>
 
2586
  </PropertyGroup>
 
2587
  <Target
 
2588
    Name="DocumentationProjectOutputGroup"
 
2589
    Outputs="@(DocumentationProjectOutputGroupOutput)"
 
2590
    DependsOnTargets="$(DocumentationProjectOutputGroupDependsOn)" />
 
2591
 
 
2592
  <!--
 
2593
  ==================================================================================================
 
2594
  SatelliteDllsProjectOutputGroup
 
2595
 
 
2596
    Populates the Satellite Files project output group.
 
2597
  ==================================================================================================
 
2598
  -->
 
2599
  <PropertyGroup>
 
2600
    <SatelliteDllsProjectOutputGroupDependsOn>PrepareForBuild</SatelliteDllsProjectOutputGroupDependsOn>
 
2601
  </PropertyGroup>
 
2602
  <Target
 
2603
    Name="SatelliteDllsProjectOutputGroup"
 
2604
    Outputs="@(SatelliteDllsProjectOutputGroupOutput)"
 
2605
    DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependsOn)" />
 
2606
 
 
2607
  <!--
 
2608
  ==================================================================================================
 
2609
  SourceFilesProjectOutputGroup
 
2610
 
 
2611
    Populates the Source Files project output group.
 
2612
    Source files are items in the project whose type is "Compile" and "EmbeddedResource".
 
2613
  ==================================================================================================
 
2614
  -->
 
2615
  <PropertyGroup>
 
2616
    <SourceFilesProjectOutputGroupDependsOn>PrepareForBuild</SourceFilesProjectOutputGroupDependsOn>
 
2617
  </PropertyGroup>
 
2618
  <Target
 
2619
    Name="SourceFilesProjectOutputGroup"
 
2620
    Outputs="@(SourceFilesProjectOutputGroupOutput)"
 
2621
    DependsOnTargets="$(SourceFilesProjectOutputGroupDependsOn)">
 
2622
 
 
2623
    <AssignTargetPath Files="@(Compile)" RootFolder="$(MSBuildProjectDirectory)">
 
2624
      <Output TaskParameter="AssignedFiles" ItemName="_CompileWithTargetPath"  />
 
2625
    </AssignTargetPath>
 
2626
 
 
2627
    <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
 
2628
      <Output TaskParameter="AssignedFiles" ItemName="_EmbeddedResourceWithTargetPath" />
 
2629
    </AssignTargetPath>
 
2630
 
 
2631
    <!-- First we deal with Compile and EmbeddedResource -->
 
2632
    <CreateItem Include="@(_CompileWithTargetPath->'%(FullPath)');@(_EmbeddedResourceWithTargetPath->'%(FullPath)')">
 
2633
      <Output TaskParameter="Include" ItemName="SourceFilesProjectOutputGroupOutput" />
 
2634
    </CreateItem>
 
2635
 
 
2636
    <!-- Include the project file -->
 
2637
    <CreateItem Include="$(MSBuildProjectFullPath)" AdditionalMetadata="TargetPath=$(ProjectFileName)">
 
2638
      <Output TaskParameter="Include" ItemName="SourceFilesProjectOutputGroupOutput" />
 
2639
    </CreateItem>
 
2640
 
 
2641
  </Target>
 
2642
 
 
2643
  <!--
 
2644
  ==================================================================================================
 
2645
  ContentFilesProjectOutputGroup
 
2646
 
 
2647
    Populates the Content Files project output group.
 
2648
    Content files are items in the project whose type is "Content".
 
2649
  ==================================================================================================
 
2650
  -->
 
2651
  <PropertyGroup>
 
2652
    <ContentFilesProjectOutputGroupDependsOn>PrepareForBuild</ContentFilesProjectOutputGroupDependsOn>
 
2653
  </PropertyGroup>
 
2654
  <Target
 
2655
    Name="ContentFilesProjectOutputGroup"
 
2656
    Outputs="@(ContentFilesProjectOutputGroupOutput)"
 
2657
    DependsOnTargets="$(ContentFilesProjectOutputGroupDependsOn)">
 
2658
 
 
2659
    <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
 
2660
      <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" />
 
2661
    </AssignTargetPath>
 
2662
 
 
2663
    <!-- Convert items into final items; this way we can get the full path for each item. -->
 
2664
    <CreateItem Include="@(ContentWithTargetPath->'%(FullPath)')">
 
2665
      <Output TaskParameter="Include" ItemName="ContentFilesProjectOutputGroupOutput" />
 
2666
    </CreateItem>
 
2667
 
 
2668
  </Target>
 
2669
 
 
2670
  <!--
 
2671
  ==================================================================================================
 
2672
  SGenFilesOutputGroup
 
2673
 
 
2674
    Populates the GenerateSerializationAssemblies Files project output group.
 
2675
    GenerateSerializationAssemblies files are those generated by the GenerateSerializationAssemblies
 
2676
    target and task.
 
2677
  ==================================================================================================
 
2678
  -->
 
2679
  <PropertyGroup>
 
2680
    <SGenFilesOutputGroupDependsOn></SGenFilesOutputGroupDependsOn>
 
2681
  </PropertyGroup>
 
2682
  <Target
 
2683
    Name="SGenFilesOutputGroup"
 
2684
    Outputs="@(SGenFilesOutputGroupOutput)"
 
2685
    DependsOnTargets="$(SGenFilesOutputGroupDependsOn)" />
 
2686
 
 
2687
  <!-- Extension point: Define CustomAfterWixTargets to a .targets file that you want to include after this file. -->
 
2688
  <Import Project="$(CustomAfterWixTargets)" Condition=" '$(CustomAfterWixTargets)' != '' and Exists('$(CustomAfterWixTargets)')" />
 
2689
 
 
2690
  <!-- MSBuildToolsVersion is set for MSBuild 3.5 and later, which is a requirement for lux.targets. -->
 
2691
  <Import Project="$(LuxTargetsPath)" Condition=" '$(MSBuildToolsVersion)' != '' and '$(LuxTargetsPath)' != '' and Exists('$(LuxTargetsPath)')" />
 
2692
</Project>