aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.BuildTasks/wix.targets
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.BuildTasks/wix.targets')
-rw-r--r--src/WixToolset.BuildTasks/wix.targets126
1 files changed, 48 insertions, 78 deletions
diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets
index ebd3fa90..da90226d 100644
--- a/src/WixToolset.BuildTasks/wix.targets
+++ b/src/WixToolset.BuildTasks/wix.targets
@@ -48,14 +48,13 @@
48 <PropertyGroup> 48 <PropertyGroup>
49 <DefaultLanguageSourceExtension>.wxs</DefaultLanguageSourceExtension> 49 <DefaultLanguageSourceExtension>.wxs</DefaultLanguageSourceExtension>
50 <Language>wix</Language> 50 <Language>wix</Language>
51 <TargetRuntime>Managed</TargetRuntime> 51 <TargetRuntime>wix</TargetRuntime>
52 52
53 <!-- Use OutputName to set the AssemblyName for Microsoft.Common.targets --> 53 <!-- Use OutputName to set the AssemblyName for Microsoft.Common.targets -->
54 <OutputName Condition=" '$(OutputName)'=='' ">$(MSBuildProjectName)</OutputName> 54 <OutputName Condition=" '$(OutputName)'=='' ">$(MSBuildProjectName)</OutputName>
55 <AssemblyName>$(OutputName)</AssemblyName> 55 <AssemblyName>$(OutputName)</AssemblyName>
56 56
57 <!-- Default the OutputType to a known WiX toolset TYPE. --> 57 <!-- Default the OutputType to a known WiX Toolset type. -->
58 <_OriginalOutputType>$(OutputType)</_OriginalOutputType>
59 <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType> 58 <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType>
60 </PropertyGroup> 59 </PropertyGroup>
61 60
@@ -70,28 +69,24 @@
70 <TargetExt Condition=" '$(OutputType)' == 'PatchCreation' ">.pcp</TargetExt> 69 <TargetExt Condition=" '$(OutputType)' == 'PatchCreation' ">.pcp</TargetExt>
71 <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt> 70 <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt>
72 <TargetExt Condition=" '$(OutputType)' == 'Bundle' ">.exe</TargetExt> 71 <TargetExt Condition=" '$(OutputType)' == 'Bundle' ">.exe</TargetExt>
72 <TargetExt Condition=" '$(OutputType)' == 'IntermediatePostLink' ">.wixipl</TargetExt>
73 </PropertyGroup> 73 </PropertyGroup>
74 74
75 <!-- Provide the correct output name for the .wixpdb -->
76 <ItemGroup Condition="'$(_DebugSymbolsProduced)' == 'true'">
77 <_DebugSymbolsIntermediatePath Include="$(PdbOutputDir)$(TargetPdbName)" Condition=" '@(_DebugSymbolsIntermediatePath)' == '' " />
78 </ItemGroup>
79
80 <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" /> 75 <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
81 76
82 <PropertyGroup> 77 <PropertyGroup>
83 <!-- Default pdb output path to the intermediate output directory --> 78 <!-- Default pdb output path to the intermediate output directory -->
84 <PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(IntermediateOutputPath)</PdbOutputDir> 79 <PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(TargetDir)</PdbOutputDir>
85 <PdbOutputDir Condition=" '$(PdbOutputDir)' != '' and !HasTrailingSlash('$(PdbOutputDir)') ">$(PdbOutputDir)\</PdbOutputDir> 80 <PdbOutputDir Condition=" !HasTrailingSlash('$(PdbOutputDir)') ">$(PdbOutputDir)\</PdbOutputDir>
86 81
87 <!-- Example, C:\MyProjects\MyProject\bin\debug\ --> 82 <!-- Example, C:\MyProjects\MyProject\bin\debug\ -->
88 <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`))</TargetPdbDir> 83 <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`))</TargetPdbDir>
89 84
90 <!-- Example, MySetup.wixpdb" --> 85 <!-- Example, MySetup.wixpdb" -->
91 <TargetPdbName Condition=" '$(TargetPdbName)' == '' ">$(TargetName).wixpdb</TargetPdbName> 86 <TargetPdbFileName Condition=" '$(TargetPdbFileName)' == '' ">$(TargetName).wixpdb</TargetPdbFileName>
92 87
93 <!-- Example, C:\MyProjects\MyProject\bin\debug\MyPackage.wixpdb --> 88 <!-- Example, C:\MyProjects\MyProject\bin\debug\MyPackage.wixpdb -->
94 <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbName)</TargetPdbPath> 89 <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbFileName)</TargetPdbPath>
95 </PropertyGroup> 90 </PropertyGroup>
96 91
97 <!-- 92 <!--
@@ -111,8 +106,6 @@
111 <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" /> 106 <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" />
112 <UsingTask TaskName="ResolveWixReferences" AssemblyFile="$(WixTasksPath)"/> 107 <UsingTask TaskName="ResolveWixReferences" AssemblyFile="$(WixTasksPath)"/>
113 <UsingTask TaskName="ReplaceString" AssemblyFile="$(WixTasksPath)"/> 108 <UsingTask TaskName="ReplaceString" AssemblyFile="$(WixTasksPath)"/>
114 <UsingTask TaskName="GetCabList" AssemblyFile="$(WixTasksPath)" />
115 <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" />
116 <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/> 109 <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/>
117 110
118 <PropertyGroup> 111 <PropertyGroup>
@@ -131,14 +124,6 @@
131 </PropertyGroup> 124 </PropertyGroup>
132 125
133 <!-- 126 <!--
134 Set the SignTargetPath item directly when output is a Bundle. The AssignCultures target
135 sets SignTargetPath item for other output types based on the cultures provided.
136 -->
137 <ItemGroup>
138 <SignTargetPath Include="$(TargetPath)" Condition=" '$(OutputType)' == 'Bundle' AND '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' " />
139 </ItemGroup>
140
141 <!--
142 ////////////////////////////////////////////////////////////////////////////////////////////////// 127 //////////////////////////////////////////////////////////////////////////////////////////////////
143 ////////////////////////////////////////////////////////////////////////////////////////////////// 128 //////////////////////////////////////////////////////////////////////////////////////////////////
144 Default Compiler, Linker, and Librarian Property Declarations 129 Default Compiler, Linker, and Librarian Property Declarations
@@ -219,32 +204,27 @@
219 204
220 [IN] 205 [IN]
221 $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension) 206 $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension)
222 $(OutputType) - Possible values are 'package', 'PatchCreation', 'module', 'library', 'bundle' 207 $(OutputType) - Possible values are 'Package', 'PatchCreation', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'
223 ================================================================================================== 208 ==================================================================================================
224 --> 209 -->
225 <PropertyGroup> 210 <PropertyGroup>
226 <_PleaseSetThisInProjectFile>Please set this in the project file before the &lt;Import&gt; of the wix.targets file.</_PleaseSetThisInProjectFile> 211 <_PleaseSetThisInProjectFile>Please set this in the project file before the &lt;Import&gt; of the wix.targets file.</_PleaseSetThisInProjectFile>
227 <_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> 212 <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile)</_OutputTypeDescription>
228 </PropertyGroup> 213 </PropertyGroup>
229 <Target Name="_CheckRequiredProperties"> 214 <Target Name="_CheckRequiredProperties">
230 215
231 <Error 216 <Error
232 Code="WIXTARGETS100" 217 Code="WIX100"
233 Condition=" '$(OutputName)' == '' " 218 Condition=" '$(OutputName)' == '' "
234 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)" /> 219 Text="The OutputName property is not set in project &quot;$(MSBuildProjectFile)&quot;. The OutputName defines the name of the output without a file extension. $(_PleaseSetThisInProjectFile)" />
235 220
236 <Warning
237 Code="WIXTARGETS101"
238 Condition=" '$(_OriginalOutputType)' == '' "
239 Text="The OutputType property is not set in project &quot;$(MSBuildProjectFile)&quot;. Defaulting to '$(OutputType)'. $(_OutputTypeDescription)" />
240
241 <Error 221 <Error
242 Code="WIXTARGETS102" 222 Code="WIX101"
243 Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'PatchCreation' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' and '$(OutputType)' != 'Bundle' " 223 Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'PatchCreation' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' and '$(OutputType)' != 'Bundle' and '$(OutputType)' != 'IntermediatePostLink' "
244 Text="The OutputType property '$(OutputType)' is not valid in project &quot;$(MSBuildProjectFile)&quot;. $(_OutputTypeDescription)" /> 224 Text="The OutputType property '$(OutputType)' is not valid in project &quot;$(MSBuildProjectFile)&quot;. $(_OutputTypeDescription)" />
245 225
246 <Error 226 <Error
247 Code="WIXTARGETS103" 227 Code="WIX102"
248 Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' &lt; '4.0' " 228 Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' &lt; '4.0' "
249 Text="MSBuild v$(MSBuildToolsVersion) is not supported by the project &quot;$(MSBuildProjectFile)&quot;. You must use MSBuild v4.0 or later." /> 229 Text="MSBuild v$(MSBuildToolsVersion) is not supported by the project &quot;$(MSBuildProjectFile)&quot;. You must use MSBuild v4.0 or later." />
250 230
@@ -272,7 +252,6 @@
272 BuildOnlySettings; 252 BuildOnlySettings;
273 PrepareForBuild; 253 PrepareForBuild;
274 PreBuildEvent; 254 PreBuildEvent;
275 ResolveReferences;
276 255
277 WixBuild; 256 WixBuild;
278 Signing; 257 Signing;
@@ -580,7 +559,7 @@
580 ================================================================================================ 559 ================================================================================================
581 --> 560 -->
582 <PropertyGroup> 561 <PropertyGroup>
583 <GetTargetPathDependsOn>AssignCultures</GetTargetPathDependsOn> 562 <GetTargetPathDependsOn>AssignTargetPaths</GetTargetPathDependsOn>
584 </PropertyGroup> 563 </PropertyGroup>
585 564
586 565
@@ -600,22 +579,22 @@
600 <PropertyGroup> 579 <PropertyGroup>
601 <WixBuildDependsOn> 580 <WixBuildDependsOn>
602 ResolveReferences; 581 ResolveReferences;
603 BeforeWixBuild; 582 BeforeCompile;
604 _TimeStampBeforeWixBuild; 583 _TimeStampBeforeCompile;
605 584
606 CalculateDefineConstants; 585 CalculateDefineConstants;
607 Harvest; 586 Harvest;
608 587
609 GenerateCompileWithObjectPath; 588 GenerateCompileWithObjectPath;
610 589
611 AssignCultures; 590 AssignTargetPaths;
612 ReadPreviousBindInputsAndBuiltOutputs; 591 ReadPreviousBindInputsAndBuiltOutputs;
613 592
614 CoreWixBuild; 593 CoreWixBuild;
615 594
616 UpdateLinkFileWrites; 595 UpdateLinkFileWrites;
617 _TimeStampAfterWixBuild; 596 _TimeStampAfterCompile;
618 AfterWixBuild 597 AfterCompile
619 </WixBuildDependsOn> 598 </WixBuildDependsOn>
620 </PropertyGroup> 599 </PropertyGroup>
621 <Target 600 <Target
@@ -623,23 +602,24 @@
623 DependsOnTargets="$(WixBuildDependsOn)" /> 602 DependsOnTargets="$(WixBuildDependsOn)" />
624 603
625 <Target 604 <Target
626 Name="CoreWixBuild" 605 Name="CoreWixBuild"
627 606 Inputs="@(Compile);
628 Inputs="@(Compile); 607 @(Content);
629 @(Content); 608 @(EmbeddedResource);
630 @(EmbeddedResource); 609 @(WixObject);
631 @(WixObject); 610 @(_ResolvedProjectReferencePaths);
632 @(_ResolvedProjectReferencePaths); 611 @(_ResolvedWixLibraryPaths);
633 @(_ResolvedWixLibraryPaths); 612 @(_ResolvedWixExtensionPaths);
634 @(_ResolvedWixExtensionPaths); 613 @(_BindInputs);
635 @(_BindInputs); 614 $(MSBuildAllProjects)"
636 $(MSBuildAllProjects)" 615 Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)"
637 Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)" 616 Condition=" '@(Compile)' != '' ">
638 Condition=" '@(Compile)' != '' ">
639 617
640 <PropertyGroup> 618 <PropertyGroup>
641 <OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)))</OutputFile> 619 <!--<OutputFile>$([System.IO.Path]::GetFullPath($(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)))</OutputFile>-->
642 <PdbOutputFile>$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)</PdbOutputFile> 620 <OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)))</OutputFile>
621 <!--<OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)))</OutputFile>-->
622 <PdbOutputFile>$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)</PdbOutputFile>
643 </PropertyGroup> 623 </PropertyGroup>
644 624
645 <DoIt 625 <DoIt
@@ -780,7 +760,7 @@
780 760
781 <!-- 761 <!--
782 ================================================================================================ 762 ================================================================================================
783 AssignCultures 763 AssignTargetPaths - OVERRIDE Target
784 764
785 Determines the final list of culture groups to build based on either the Cultures property or 765 Determines the final list of culture groups to build based on either the Cultures property or
786 those specified in .wxl files. 766 those specified in .wxl files.
@@ -811,37 +791,27 @@
811 @(CultureGroup) - The list of culture group strings with OutputFolder metadata 791 @(CultureGroup) - The list of culture group strings with OutputFolder metadata
812 $(TargetPath) - Property list of target link output MSIs/MSMs 792 $(TargetPath) - Property list of target link output MSIs/MSMs
813 $(TargetPdbPath) - Property list of target output pdbs 793 $(TargetPdbPath) - Property list of target output pdbs
814 @(SignTargetPath) - The list of target to be signed
815 794
816 ================================================================================================ 795 ================================================================================================
817 --> 796 -->
818 <Target 797 <Target
819 Name="AssignCultures" 798 Name="AssignTargetPaths"
820 Condition=" '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' "> 799 Condition=" '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' ">
821 800
822 <WixAssignCulture 801 <WixAssignCulture Cultures="$(Cultures)" Files="@(EmbeddedResource)">
823 Cultures="$(Cultures)"
824 Files="@(EmbeddedResource)">
825
826 <Output TaskParameter="CultureGroups" ItemName="CultureGroup" /> 802 <Output TaskParameter="CultureGroups" ItemName="CultureGroup" />
827 </WixAssignCulture> 803 </WixAssignCulture>
828 804
829 <!-- Build an itemgroup of outputs --> 805 <!-- Expand the culture groups then put them back into the appropriate property -->
830 <ItemGroup> 806 <ItemGroup>
831 <_TargetPathItems Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)" /> 807 <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" />
832 <_TargetPdbPathItems Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)" /> 808 <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" />
833 </ItemGroup> 809 </ItemGroup>
834 810
835 <!-- Convert the itemgroup to a semicolon-delimited property -->
836 <PropertyGroup> 811 <PropertyGroup>
837 <TargetPath>@(_TargetPathItems)</TargetPath> 812 <TargetPath>@(_CulturedTargetPath)</TargetPath>
838 <TargetPdbPath>@(_TargetPdbPathItems)</TargetPdbPath> 813 <TargetPdbPath>@(_CulturedTargetPdbPath)</TargetPdbPath>
839 </PropertyGroup> 814 </PropertyGroup>
840
841 <!-- Set the sign target items, if we're signing output. -->
842 <ItemGroup Condition=" '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' ">
843 <SignTargetPath Include="@(_TargetPathItems)" />
844 </ItemGroup>
845 </Target> 815 </Target>
846 816
847 <!-- 817 <!--
@@ -957,7 +927,7 @@
957 ================================================================================================== 927 ==================================================================================================
958 --> 928 -->
959 <PropertyGroup> 929 <PropertyGroup>
960 <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignCultures</BuiltProjectOutputGroupDependsOn> 930 <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</BuiltProjectOutputGroupDependsOn>
961 </PropertyGroup> 931 </PropertyGroup>
962 <Target 932 <Target
963 Name="BuiltProjectOutputGroup" 933 Name="BuiltProjectOutputGroup"
@@ -967,7 +937,7 @@
967 <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below --> 937 <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below -->
968 938
969 <!-- Try to read the outputs from the bind outputs text file since that's the output list straight from linker. --> 939 <!-- Try to read the outputs from the bind outputs text file since that's the output list straight from linker. -->
970 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"> 940 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
971 <Output TaskParameter="Lines" ItemName="_BuiltProjectOutputGroupOutputIntermediate"/> 941 <Output TaskParameter="Lines" ItemName="_BuiltProjectOutputGroupOutputIntermediate"/>
972 </ReadLinesFromFile> 942 </ReadLinesFromFile>
973 943
@@ -993,14 +963,14 @@
993 ================================================================================================== 963 ==================================================================================================
994 --> 964 -->
995 <PropertyGroup> 965 <PropertyGroup>
996 <DebugSymbolsProjectOutputGroupDependsOn>AssignCultures</DebugSymbolsProjectOutputGroupDependsOn> 966 <DebugSymbolsProjectOutputGroupDependsOn>AssignTargetPaths</DebugSymbolsProjectOutputGroupDependsOn>
997 </PropertyGroup> 967 </PropertyGroup>
998 <Target 968 <Target
999 Name="DebugSymbolsProjectOutputGroup" 969 Name="DebugSymbolsProjectOutputGroup"
1000 Outputs="@(DebugSymbolsProjectOutputGroupOutput)" 970 Outputs="@(DebugSymbolsProjectOutputGroupOutput)"
1001 DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"> 971 DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)">
1002 972
1003 <!-- Include build output pdb(s). Different than predefined itemgroup since AssignCultures target may change --> 973 <!-- Include build output pdb(s). Different than predefined itemgroup since AssignTargetPaths target may change -->
1004 <ItemGroup> 974 <ItemGroup>
1005 <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(SuppressPdbOutput)' != 'true' "/> 975 <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(SuppressPdbOutput)' != 'true' "/>
1006 </ItemGroup> 976 </ItemGroup>
@@ -1029,7 +999,7 @@
1029 </PropertyGroup> 999 </PropertyGroup>
1030 1000
1031 <!-- Copy the bound files. --> 1001 <!-- Copy the bound files. -->
1032 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"> 1002 <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
1033 <Output TaskParameter="Lines" ItemName="_FullPathToCopy"/> 1003 <Output TaskParameter="Lines" ItemName="_FullPathToCopy"/>
1034 </ReadLinesFromFile> 1004 </ReadLinesFromFile>
1035 1005