aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-07-27 11:41:55 -0700
committerRob Mensching <rob@firegiant.com>2018-07-27 11:41:55 -0700
commit63ebed98f610c9f6ae722d6a12678593c262ba3e (patch)
tree90cc2dc7803107e7bb9988d85273ae25dd1121dc
parent54225eca5faab731a209303f56c0149492852167 (diff)
downloadwix-63ebed98f610c9f6ae722d6a12678593c262ba3e.tar.gz
wix-63ebed98f610c9f6ae722d6a12678593c262ba3e.tar.bz2
wix-63ebed98f610c9f6ae722d6a12678593c262ba3e.zip
WIP: wix.targets cleanup
-rw-r--r--src/WixToolset.BuildTasks/wix.targets248
1 files changed, 19 insertions, 229 deletions
diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets
index c9704094..2edd44c4 100644
--- a/src/WixToolset.BuildTasks/wix.targets
+++ b/src/WixToolset.BuildTasks/wix.targets
@@ -1,7 +1,6 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 3
4
5<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="_CheckRequiredProperties" DefaultTargets="Build"> 4<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="_CheckRequiredProperties" DefaultTargets="Build">
6 <PropertyGroup> 5 <PropertyGroup>
7 <WixTargetsImported>true</WixTargetsImported> 6 <WixTargetsImported>true</WixTargetsImported>
@@ -120,11 +119,6 @@
120 <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" /> 119 <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" />
121 <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/> 120 <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/>
122 121
123 <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is not 32bit. -->
124 <PropertyGroup>
125 <RunWixToolsOutOfProc Condition=" '$(PROCESSOR_ARCHITECTURE)'!='x86' ">true</RunWixToolsOutOfProc>
126 </PropertyGroup>
127
128 <PropertyGroup> 122 <PropertyGroup>
129 <BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile> 123 <BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile>
130 <BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile> 124 <BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile>
@@ -284,8 +278,7 @@
284 PreBuildEvent; 278 PreBuildEvent;
285 ResolveReferences; 279 ResolveReferences;
286 280
287 <!--CompileAndLink;--> 281 WixBuild;
288 DoIt;
289 Signing; 282 Signing;
290 283
291 GetTargetPath; 284 GetTargetPath;
@@ -598,43 +591,43 @@
598 <!-- 591 <!--
599 ////////////////////////////////////////////////////////////////////////////////////////////////// 592 //////////////////////////////////////////////////////////////////////////////////////////////////
600 ////////////////////////////////////////////////////////////////////////////////////////////////// 593 //////////////////////////////////////////////////////////////////////////////////////////////////
601 DoIt Targets 594 WixBuild Targets
602 ////////////////////////////////////////////////////////////////////////////////////////////////// 595 //////////////////////////////////////////////////////////////////////////////////////////////////
603 ////////////////////////////////////////////////////////////////////////////////////////////////// 596 //////////////////////////////////////////////////////////////////////////////////////////////////
604 --> 597 -->
605 598
606 <!-- 599 <!--
607 ================================================================================================== 600 ==================================================================================================
608 DoIt 601 WixBuild
609 ================================================================================================== 602 ==================================================================================================
610 --> 603 -->
611 <PropertyGroup> 604 <PropertyGroup>
612 <DoItDependsOn> 605 <WixBuildDependsOn>
613 PrepareForBuild;
614 ResolveReferences; 606 ResolveReferences;
615 BeforeCompile; 607 BeforeWixBuild;
616 _TimeStampBeforeCompile; 608 _TimeStampBeforeWixBuild;
617 Harvest;
618 609
619 CalculateDefineConstants; 610 CalculateDefineConstants;
611 Harvest;
612
620 GenerateCompileWithObjectPath; 613 GenerateCompileWithObjectPath;
621 614
622 AssignCultures; 615 AssignCultures;
623 ReadPreviousBindInputsAndBuiltOutputs; 616 ReadPreviousBindInputsAndBuiltOutputs;
624 617
625 ActuallyDoIt; 618 CoreWixBuild;
626 619
627 UpdateLinkFileWrites; 620 UpdateLinkFileWrites;
628 _TimeStampAfterCompile; 621 _TimeStampAfterWixBuild;
629 AfterCompile 622 AfterWixBuild
630 </DoItDependsOn> 623 </WixBuildDependsOn>
631 </PropertyGroup> 624 </PropertyGroup>
632 <Target 625 <Target
633 Name="DoIt" 626 Name="WixBuild"
634 DependsOnTargets="$(DoItDependsOn)" /> 627 DependsOnTargets="$(WixBuildDependsOn)" />
635 628
636 <Target 629 <Target
637 Name="ActuallyDoIt" 630 Name="CoreWixBuild"
638 631
639 Inputs="@(Compile); 632 Inputs="@(Compile);
640 @(Content); 633 @(Content);
@@ -703,40 +696,8 @@
703 TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors);$(LinkerTreatWarningsAsErrors)" 696 TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors);$(LinkerTreatWarningsAsErrors)"
704 VerboseOutput="$(CompilerVerboseOutput);$(LinkerVerboseOutput)" 697 VerboseOutput="$(CompilerVerboseOutput);$(LinkerVerboseOutput)"
705 --> 698 -->
699 </Target>
706 700
707</Target>
708
709
710 <!--
711 //////////////////////////////////////////////////////////////////////////////////////////////////
712 //////////////////////////////////////////////////////////////////////////////////////////////////
713 CompileAndLink Targets
714 //////////////////////////////////////////////////////////////////////////////////////////////////
715 //////////////////////////////////////////////////////////////////////////////////////////////////
716 -->
717
718 <!--
719 ==================================================================================================
720 CompileAndLink
721 ==================================================================================================
722 -->
723 <PropertyGroup>
724 <CompileAndLinkDependsOn>
725 ResolveReferences;
726 BeforeCompile;
727 _TimeStampBeforeCompile;
728 Harvest;
729 Compile;
730 Lib;
731 Link;
732 UpdateLinkFileWrites;
733 _TimeStampAfterCompile;
734 AfterCompile
735 </CompileAndLinkDependsOn>
736 </PropertyGroup>
737 <Target
738 Name="CompileAndLink"
739 DependsOnTargets="$(CompileAndLinkDependsOn)" />
740 701
741 <!-- 702 <!--
742 ================================================================================================== 703 ==================================================================================================
@@ -819,72 +780,6 @@
819 IntermediateOutputPath="$(IntermediateOutputPath)"> 780 IntermediateOutputPath="$(IntermediateOutputPath)">
820 <Output TaskParameter="CompileWithObjectPath" ItemName="_CompileWithObjectPath" /> 781 <Output TaskParameter="CompileWithObjectPath" ItemName="_CompileWithObjectPath" />
821 </GenerateCompileWithObjectPath> 782 </GenerateCompileWithObjectPath>
822
823 </Target>
824
825 <!--
826 ================================================================================================
827 Compile
828
829 Compiles the wxs files into wixobj files using candle.exe.
830
831 [IN]
832 @(Compile) - The list of wxs files to compile.
833 @(Content) - Files that the project uses in the installer.
834 @(WixExtension) - The list of wixlib or wix dll extensions.
835
836 [OUT]
837 @(CompileObjOutput) - The compiled .wixobj files.
838 ================================================================================================
839 -->
840 <PropertyGroup>
841 <CompileDependsOn>
842 PrepareForBuild;
843 ResolveReferences;
844 CalculateDefineConstants;
845 GenerateCompileWithObjectPath
846 </CompileDependsOn>
847 </PropertyGroup>
848 <Target
849 Name="Compile"
850 Inputs="@(Compile);
851 @(Content);
852 @(_ResolvedWixExtensionPaths);
853 @(_ResolvedProjectReferencePaths);
854 $(MSBuildAllProjects)"
855 Outputs="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')"
856 DependsOnTargets="$(CompileDependsOn)"
857 Condition=" '@(Compile)' != '' ">
858
859 <Candle
860 SourceFiles="@(_CompileWithObjectPath)"
861 AdditionalOptions="$(CompilerAdditionalOptions)"
862 DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)"
863 ExtensionDirectory="$(WixExtDir)"
864 Extensions="@(_ResolvedWixExtensionPaths)"
865 PreprocessToStdOut="$(PreprocessToStdOut)"
866 PreprocessToFile="$(PreprocessToFile)"
867 IncludeSearchPaths="$(IncludeSearchPaths)"
868 InstallerPlatform="$(InstallerPlatform)"
869 IntermediateDirectory="$(IntermediateOutputPath)"
870 NoLogo="$(CompilerNoLogo)"
871 OutputFile="%(_CompileWithObjectPath.ObjectPath)"
872 Pedantic="$(Pedantic)"
873 ReferencePaths="$(ReferencePaths)"
874 RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
875 SuppressAllWarnings="$(CompilerSuppressAllWarnings)"
876 SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings)"
877 ToolPath="$(WixToolDir)"
878 TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors)"
879 TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)"
880 VerboseOutput="$(CompilerVerboseOutput)">
881 </Candle>
882
883 <!-- These will be still be set even if the Compile target is up to date. -->
884 <ItemGroup>
885 <CompileObjOutput Include="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')" />
886 <FileWrites Include="@(CompileObjOutput)" />
887 </ItemGroup>
888 </Target> 783 </Target>
889 784
890 <!-- 785 <!--
@@ -1050,120 +945,15 @@
1050 945
1051 <!-- 946 <!--
1052 ================================================================================================ 947 ================================================================================================
1053 Link
1054
1055 Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe,
1056 once per culture group. All WXL files are passed into light and the culture switch determines
1057 which are used
1058
1059 [IN]
1060 @(CompileObjOutput) - The compiled .wixobj file.
1061 @(CultureGroup) - The cultures to build
1062 @(EmbeddedResource) - The list of wxl files to use for localization.
1063 @(WixObject) - The list of .wixobj files.
1064 @(WixLibrary) - The list of .wixlib files.
1065 @(WixExtension) - The list of wix dll extension files.
1066
1067 [OUT]
1068 $(TargetDir)\%(Culture)\$(TargetName)$(TargetExt) - The compiled .msi, .msm, or .exe files.
1069 ================================================================================================
1070 -->
1071 <PropertyGroup>
1072 <LinkDependsOn>
1073 PrepareForBuild;
1074 ResolveReferences;
1075 AssignCultures;
1076 ReadPreviousBindInputsAndBuiltOutputs;
1077 </LinkDependsOn>
1078 </PropertyGroup>
1079 <Target
1080 Name="Link"
1081 Inputs="@(CompileObjOutput);
1082 @(EmbeddedResource);
1083 @(WixObject);
1084 @(_ResolvedProjectReferencePaths);
1085 @(_ResolvedWixLibraryPaths);
1086 @(_ResolvedWixExtensionPaths);
1087 $(MSBuildAllProjects);
1088 @(_BindInputs)"
1089 Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)"
1090 DependsOnTargets="$(LinkDependsOn)"
1091 Condition=" '$(OutputType)' == 'Bundle' or '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' ">
1092
1093 <PropertyGroup>
1094 <PdbOutputFile>$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)</PdbOutputFile>
1095 </PropertyGroup>
1096
1097 <!-- Call light using the culture subdirectory for output -->
1098 <Light
1099 ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(_ResolvedWixLibraryPaths)"
1100 AdditionalOptions="$(LinkerAdditionalOptions)"
1101 AllowIdenticalRows="$(AllowIdenticalRows)"
1102 AllowUnresolvedReferences="$(AllowUnresolvedReferences)"
1103 AdditionalCub="$(AdditionalCub)"
1104 BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)"
1105 BindInputPaths="@(LinkerBindInputPaths)"
1106 BindFiles="$(LinkerBindFiles)"
1107 BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)"
1108 BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"
1109 BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)"
1110 CabinetCachePath="$(CabinetCachePath)"
1111 CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
1112 Cultures="%(CultureGroup.Identity)"
1113 CustomBinder="$(CustomBinder)"
1114 DefaultCompressionLevel="$(DefaultCompressionLevel)"
1115 DropUnrealTables="$(DropUnrealTables)"
1116 ExactAssemblyVersions="$(ExactAssemblyVersions)"
1117 ExtensionDirectory="$(WixExtDir)"
1118 Extensions="@(_ResolvedWixExtensionPaths)"
1119 Ices="$(Ices)"
1120 LeaveTemporaryFiles="$(LeaveTemporaryFiles)"
1121 LocalizationFiles="@(EmbeddedResource)"
1122 NoLogo="$(LinkerNoLogo)"
1123 OutputAsXml="$(OutputAsXml)"
1124 OutputFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
1125 PdbOutputFile="$(PdbOutputFile)"
1126 Pedantic="$(LinkerPedantic)"
1127 ReferencePaths="$(ReferencePaths)"
1128 ReuseCabinetCache="$(ReuseCabinetCache)"
1129 RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
1130 SuppressAclReset="$(SuppressAclReset)"
1131 SuppressAllWarnings="$(LinkerSuppressAllWarnings)"
1132 SuppressAssemblies="$(SuppressAssemblies)"
1133 SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)"
1134 SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)"
1135 SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)"
1136 SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)"
1137 SuppressFiles="$(SuppressFiles)"
1138 SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)"
1139 SuppressIces="$(SuppressIces)"
1140 SuppressLayout="$(SuppressLayout)"
1141 SuppressLocalization="$(SuppressLocalization)"
1142 SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)"
1143 SuppressPdbOutput="$(SuppressPdbOutput)"
1144 SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)"
1145 SuppressValidation="$(SuppressValidation)"
1146 SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)"
1147 SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)"
1148 ToolPath="$(WixToolDir)"
1149 TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)"
1150 UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
1151 VerboseOutput="$(LinkerVerboseOutput)"
1152 WixProjectFile="$(ProjectPath)"
1153 WixVariables="$(WixVariables)" />
1154 </Target>
1155
1156 <!--
1157 ================================================================================================
1158 UpdateLinkFileWrites 948 UpdateLinkFileWrites
1159 949
1160 Reads the bind outputs file(s) output generated during Link to correctly set the @(FileWrites) 950 Reads the bind outputs file(s) output generated during WixBuild to correctly set the @(FileWrites)
1161 item. Most targets have it easy because they can do a static mapping from inputs to the outputs. 951 item. Most targets have it easy because they can do a static mapping from inputs to the outputs.
1162 However, the Link target outputs are determined after a rather complex calculation we call 952 However, the WixBuild target outputs are determined after a rather complex calculation we call
1163 linking and binding! 953 linking and binding!
1164 954
1165 This target runs independently after Link to ensure that @(FileWrites) is updated even if the 955 This target runs independently after Link to ensure that @(FileWrites) is updated even if the
1166 "Light" task fails. 956 "WixBuild" task fails.
1167 957
1168 [IN] 958 [IN]
1169 Path to bind outputs file(s). 959 Path to bind outputs file(s).