main
cs 41 lines 1.56 KB
Raw
1 // 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
3 namespace WixToolset.Core.Burn.Bundles
4 {
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Data;
8 using WixToolset.Data.Symbols;
9 using WixToolset.Extensibility.Services;
10
11 /// <summary>
12 /// Processes the Msu packages to add properties and payloads from the Msu packages.
13 /// </summary>
14 internal class ProcessMsuPackageCommand
15 {
16 public ProcessMsuPackageCommand(IMessaging messaging, PackageFacade facade, Dictionary<string, WixBundlePayloadSymbol> payloadSymbols)
17 {
18 this.Messaging = messaging;
19 this.Facade = facade;
20 this.AuthoredPayloads = payloadSymbols;
21 }
22
23 public IMessaging Messaging { get; }
24
25 public Dictionary<string, WixBundlePayloadSymbol> AuthoredPayloads { private get; set; }
26
27 public PackageFacade Facade { private get; set; }
28
29 public void Execute()
30 {
31 var packagePayload = this.AuthoredPayloads[this.Facade.PackageSymbol.PayloadRef];
32
33 if (String.IsNullOrEmpty(this.Facade.PackageSymbol.CacheId))
34 {
35 this.Facade.PackageSymbol.CacheId = CacheIdGenerator.GenerateLocalCacheId(this.Messaging, null, packagePayload, this.Facade.PackageSymbol.SourceLineNumbers, "MsuPackage");
36 }
37
38 this.Facade.PackageSymbol.PerMachine = true; // MSUs are always per-machine.
39 }
40 }
41 }