1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 <copyright file="wix.signing.targets" company="Outercurve Foundation"> 4 Copyright (c) 2004, Outercurve Foundation. 5 This software is released under Microsoft Reciprocal License (MS-RL). 6 The license and further copyright text can be found in the file 7 LICENSE.TXT at the root directory of the distribution. 8 </copyright> 9--> 10<!-- 11 <remarks> 12 WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have 13 created a backup copy. Incorrect changes to this file will make it 14 impossible to load or build your projects from the command-line or the IDE. 15 16 This file defines the steps in the standard build process for WiX projects (.wixproj). 17 18 Conventions: 19 * Targets and properties that start with an underscore (_) are considered private and should not 20 be used outside of this file. 21 22 Coding Conventions: 23 * Two-space indentation of nested elements 24 25 * Self-closing elements should have a space before the /> ("<MyProperty />") 26 27 * Conditions should have a space before and after the "" and between any operators. For example: 28 <MyProperty Condition=" '$(MyProperty)' == '' ">Value</MyProperty> 29 30 * Targets should have each attribute on a single line and indented by two spaces. Also, there 31 should be a blank line between the Target and the beginning of the contents (a blank line is 32 optional before the closing </Target> tag). 33 For example: 34 <Target 35 Name="MyTarget" 36 DependsOnTargets="$(MyTargetDependsOn)"> 37 38 <Message Importance="low" Text="MyTarget is doing something." /> 39 </Target> 40 </remarks> 41--> 42<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 43 44 <!-- These properties can be overridden to support non-default installations. --> 45 <PropertyGroup> 46 <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildThisFileFullPath)</WixTargetsPath> 47 <WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(WixTargetsPath)WixTasks.dll</WixTasksPath> 48 49 <SignedFile Condition=" '$(SignedFile)' == '' ">$(MSBuildProjectFile).Signed.txt</SignedFile> 50 </PropertyGroup> 51 52 <UsingTask TaskName="Insignia" AssemblyFile="$(WixTasksPath)" /> 53 54 <!-- Default Inscribe properties. --> 55 <PropertyGroup> 56 <InscribeNoLogo Condition=" '$(InscribeNoLogo)' == '' ">$(NoLogo)</InscribeNoLogo> 57 <InscribeSuppressAllWarnings Condition=" '$(InscribeSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</InscribeSuppressAllWarnings> 58 <InscribeSuppressSpecificWarnings Condition=" '$(InscribeSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</InscribeSuppressSpecificWarnings> 59 <InscribeTreatWarningsAsErrors Condition=" '$(InscribeTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</InscribeTreatWarningsAsErrors> 60 <InscribeTreatSpecificWarningsAsErrors Condition=" '$(InscribeTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</InscribeTreatSpecificWarningsAsErrors> 61 <InscribeVerboseOutput Condition=" '$(InscribeVerboseOutput)' == '' ">$(VerboseOutput)</InscribeVerboseOutput> 62 </PropertyGroup> 63 64 <!-- 65 ================================================================================================== 66 Signing 67 ================================================================================================== 68 --> 69 <PropertyGroup> 70 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Module' "> 71 GetMsmsToSign; 72 InternalSignMsm; 73 </InternalSignDependsOn> 74 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Package' "> 75 GetCabsToSign; 76 GetMsiToSign; 77 InternalSignCabs; 78 InscribeMsi; 79 InternalSignMsi; 80 </InternalSignDependsOn> 81 <InternalSignDependsOn Condition=" '$(OutputType)' == 'Bundle' "> 82 GetContainersToSign; 83 InternalSignContainers; 84 InscribeBundleEngine; 85 InternalSignBundleEngine; 86 InscribeBundle; 87 InternalSignBundle; 88 </InternalSignDependsOn> 89 90 <SigningDependsOn> 91 CompileAndLink; 92 BeforeSigning; 93 $(InternalSignDependsOn); 94 AfterSigning 95 </SigningDependsOn> 96 </PropertyGroup> 97 <Target 98 Name="Signing" 99 DependsOnTargets="$(SigningDependsOn)" 100 Inputs="@(SignTargetPath)" 101 Outputs="$(IntermediateOutputPath)$(SignedFile)" 102 Condition=" '@(SignTargetPath)' != '' "> 103 104 <CreateItem Include="$(IntermediateOutputPath)$(SignedFile)"> 105 <Output TaskParameter="Include" ItemName="FileWrites" /> 106 </CreateItem> 107 108 <WriteLinesToFile 109 File="$(IntermediateOutputPath)$(SignedFile)" 110 Lines="^$(MSBuildProjectFullPath);@(SignMsm);@(SignCabs);@(SignMsi);@(SignContainers);@(SignBundleEngine);@(SignBundle)" 111 Overwrite="true" /> 112 </Target> 113 114 <!-- Internal targets so correct signing targets are called. --> 115 <Target 116 Name="GetMsmsToSign" 117 Inputs="@(SignTargetPath)" 118 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 119 <CreateItem Include="@(SignTargetPath)"> 120 <Output TaskParameter="Include" ItemName="SignMsm" /> 121 <Output TaskParameter="Include" ItemName="FileWrites" /> 122 </CreateItem> 123 </Target> 124 125 <Target 126 Name="InternalSignMsm" 127 DependsOnTargets="SignMsm" 128 Condition=" '@(SignMsm)' != '' " /> 129 130 <Target 131 Name="GetCabsToSign" 132 Inputs="@(SignTargetPath)" 133 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 134 <GetCabList Database="%(SignTargetPath.FullPath)"> 135 <Output TaskParameter="CabList" ItemName="SignCabs" /> 136 <Output TaskParameter="CabList" ItemName="FileWrites" /> 137 </GetCabList> 138 </Target> 139 140 <Target 141 Name="InternalSignCabs" 142 DependsOnTargets="SignCabs" 143 Condition=" '@(SignCabs)' != '' " /> 144 145 <Target 146 Name="GetMsiToSign" 147 Inputs="@(SignTargetPath)" 148 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 149 <CreateItemAvoidingInference InputProperties="@(SignTargetPath)"> 150 <Output TaskParameter="OuputItems" ItemName="SignMsi" /> 151 <Output TaskParameter="OuputItems" ItemName="FileWrites" /> 152 </CreateItemAvoidingInference> 153 </Target> 154 155 <Target 156 Name="InternalSignMsi" 157 DependsOnTargets="SignMsi" 158 Inputs="@(SignTargetPath)" 159 Outputs="$(IntermediateOutputPath)$(SignedFile)" 160 Condition=" '@(SignMsi)' != '' " /> 161 162 <Target 163 Name="GetContainersToSign" 164 Inputs="@(SignTargetPath)" 165 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 166 <!-- TODO: implement signing detached containers --> 167 </Target> 168 169 <Target 170 Name="InternalSignContainers" 171 DependsOnTargets="SignContainers" 172 Condition=" '@(SignContainers)' != '' " /> 173 174 <Target 175 Name="InternalSignBundleEngine" 176 DependsOnTargets="SignBundleEngine" 177 Condition=" '@(SignBundleEngine)' != '' " /> 178 179 <Target 180 Name="InternalSignBundle" 181 DependsOnTargets="SignBundle" 182 Condition=" '@(SignBundle)' != '' " /> 183 184 <!-- 185 ================================================================================================ 186 InscribeMsi 187 188 To be called after signing an MSI's cabs - inscribes an MSI with the digital signature of its 189 external cabs. 190 191 [IN/OUT] 192 @(SignTargetPath) - The database file to inscribe - database file will be modified in-place. 193 194 [OUT] 195 @(SignMsi) - The database file to sign. 196 ================================================================================================ 197 --> 198 <PropertyGroup> 199 <InscribeMsiDependsOn> 200 PrepareForBuild; 201 ResolveWixExtensionReferences; 202 CompileAndLink; 203 InternalSignCabs 204 </InscribeMsiDependsOn> 205 </PropertyGroup> 206 <Target 207 Name="InscribeMsi" 208 DependsOnTargets="$(InscribeMsiDependsOn)" 209 Inputs="@(SignTargetPath)" 210 Outputs="$(IntermediateOutputPath)$(SignedFile)" 211 Condition=" '@(SignCabs)' != '' "> 212 213 <Insignia 214 DatabaseFile="%(SignTargetPath.FullPath)" 215 OutputFile="%(SignTargetPath.FullPath)" 216 ToolPath="$(WixToolPath)" 217 NoLogo="$(InscribeNoLogo)" 218 RunAsSeparateProcess="$(RunWixToolsOutOfProc)" 219 SuppressAllWarnings="$(InscribeSuppressAllWarnings)" 220 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)" 221 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)" 222 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)" 223 VerboseOutput="$(InscribeVerboseOutput)" 224 AdditionalOptions="$(InscribeAdditionalOptions)" /> 225 </Target> 226 227 <!-- 228 ================================================================================================ 229 InscribeBundleEngine 230 231 To be called after signing a bundle's detached containers. Also removes attached container 232 so engine can be signed without attached container. 233 234 [IN] 235 @(SignTargetPath) - The bundle to inscribe. 236 237 [OUT] 238 @(SignBundleEngine) - The bundle engine file to be signed. 239 ================================================================================================ 240 --> 241 <PropertyGroup> 242 <InscribeBundleEngineDependsOn> 243 PrepareForBuild; 244 ResolveWixExtensionReferences; 245 CompileAndLink; 246 InternalSignContainers 247 </InscribeBundleEngineDependsOn> 248 </PropertyGroup> 249 <Target 250 Name="InscribeBundleEngine" 251 DependsOnTargets="$(InscribeBundleEngineDependsOn)" 252 Inputs="@(SignTargetPath)" 253 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 254 255 <Insignia 256 BundleFile="@(SignTargetPath)" 257 OutputFile="$(IntermediateOutputPath)%(SignTargetPath.Filename)%(SignTargetPath.Extension)" 258 ToolPath="$(WixToolPath)" 259 NoLogo="$(InscribeNoLogo)" 260 RunAsSeparateProcess="$(RunWixToolsOutOfProc)" 261 SuppressAllWarnings="$(InscribeSuppressAllWarnings)" 262 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)" 263 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)" 264 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)" 265 VerboseOutput="$(InscribeVerboseOutput)" 266 AdditionalOptions="$(InscribeAdditionalOptions)"> 267 <Output TaskParameter="Output" ItemName="SignBundleEngine" /> 268 </Insignia> 269 270 <!-- Explicitly add output to FileWrites to ensure even when the target is up to date. --> 271 <CreateItem Include="$(IntermediateOutputPath)%(SignTargetPath.Filename)%(SignTargetPath.Extension)"> 272 <Output TaskParameter="Include" ItemName="FileWrites" /> 273 </CreateItem> 274 275 </Target> 276 277 <!-- 278 ================================================================================================ 279 InscribeBundle 280 281 To be called after signing the bundle engine to reattach the attached container. 282 283 [IN] 284 @(Inscribe) - The bundle to inscribe. 285 286 [OUT] 287 @(SignBundle) - The bundle engine file to be signed. 288 ================================================================================================ 289 --> 290 <PropertyGroup> 291 <InscribeBundleDependsOn> 292 PrepareForBuild; 293 ResolveWixExtensionReferences; 294 CompileAndLink; 295 InternalSignBundleEngine 296 </InscribeBundleDependsOn> 297 </PropertyGroup> 298 <Target 299 Name="InscribeBundle" 300 DependsOnTargets="$(InscribeBundleDependsOn)" 301 Inputs="@(SignTargetPath)" 302 Outputs="$(IntermediateOutputPath)$(SignedFile)"> 303 304 <Insignia 305 BundleFile="@(SignBundleEngine)" 306 OriginalBundleFile="@(SignTargetPath)" 307 OutputFile="@(SignTargetPath)" 308 ToolPath="$(WixToolPath)" 309 NoLogo="$(InscribeNoLogo)" 310 RunAsSeparateProcess="$(RunWixToolsOutOfProc)" 311 SuppressAllWarnings="$(InscribeSuppressAllWarnings)" 312 SuppressSpecificWarnings="$(InscribeSuppressSpecificWarnings)" 313 TreatWarningsAsErrors="$(InscribeTreatWarningsAsErrors)" 314 TreatSpecificWarningsAsErrors="$(InscribeTreatSpecificWarningsAsErrors)" 315 VerboseOutput="$(InscribeVerboseOutput)" 316 AdditionalOptions="$(InscribeAdditionalOptions)"> 317 <Output TaskParameter="Output" ItemName="SignBundle" /> 318 <Output TaskParameter="Output" ItemName="FileWrites" /> 319 </Insignia> 320 </Target> 321 322 <!-- 323 ================================================================================================== 324 BeforeSigning 325 326 Redefine this target in your project in order to run tasks just before all signing tasks. 327 ================================================================================================== 328 --> 329 <Target Name="BeforeSigning" /> 330 331 <!-- 332 ================================================================================================== 333 SignMsm 334 335 Redefine this target in your project in order to sign merge modules. 336 337 [IN] 338 @(SignMsm) - merge module files to sign. 339 ================================================================================================== 340 --> 341 <Target Name="SignMsm" /> 342 343 <!-- 344 ================================================================================================== 345 SignCabs 346 347 Redefine this target in your project in order to sign the cabs of your database. 348 349 [IN] 350 @(SignCabs) - cabinet files to sign. 351 ================================================================================================== 352 --> 353 <Target Name="SignCabs" /> 354 355 <!-- 356 ================================================================================================== 357 SignMsi 358 359 Redefine this target in your project in order to sign your database, after it has been inscribed 360 with the signatures of your signed cabs. 361 362 [IN] 363 @(SignMsi) - database files to sign. 364 ================================================================================================== 365 --> 366 <Target Name="SignMsi" /> 367 368 <!-- 369 ================================================================================================== 370 SignContainers 371 372 Redefine this target in your project in order to sign your bundle's detached containers. 373 374 [IN] 375 @(SignContainers) - detached container files to sign. 376 ================================================================================================== 377 --> 378 <Target Name="SignContainers" /> 379 380 <!-- 381 ================================================================================================== 382 SignBundleEngine 383 384 Redefine this target in your project in order to sign your bundle, after it has been inscribed 385 with the signatures of your signed containers. 386 387 [IN] 388 @(SignBundleEngine) - bundle engine file to sign. 389 ================================================================================================== 390 --> 391 <Target Name="SignBundleEngine" /> 392 393 <!-- 394 ================================================================================================== 395 SignBundle 396 397 Redefine this target in your project in order to sign your bundle, after the attached container 398 is reattached. 399 400 [IN] 401 @(SignBundle) - bundle file to sign. 402 ================================================================================================== 403 --> 404 <Target Name="SignBundle" /> 405 406 <!-- 407 ================================================================================================== 408 AfterSigning 409 410 Redefine this target in your project in order to run tasks just after all signing tasks. 411 ================================================================================================== 412 --> 413 <Target Name="AfterSigning" /> 414 415</Project> 416