main
cs 72 lines 4.11 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
4 {
5 using WixToolset.Data;
6
7 internal static class BurnBackendWarnings
8 {
9 public static Message AttachedContainerPayloadCollision(SourceLineNumber sourceLineNumbers, string payloadId, string payloadName)
10 {
11 return Message(sourceLineNumbers, Ids.AttachedContainerPayloadCollision, "The Payload '{0}' has a duplicate Name '{1}' in the attached container. When extracting the bundle with `wix burn extract`, the file will get overwritten.", payloadId, payloadName);
12 }
13
14 public static Message AttachedContainerPayloadCollision2(SourceLineNumber sourceLineNumbers)
15 {
16 return Message(sourceLineNumbers, Ids.AttachedContainerPayloadCollision2, "The location of the payload related to the previous error.");
17 }
18
19 public static Message CannotParseBundleVersionAsFourPartVersion(SourceLineNumber originalLineNumber, string version)
20 {
21 return Message(originalLineNumber, Ids.CannotParseBundleVersionAsFourPartVersion, "The Bundle/@Version was not be able to be used as a four-part version. A valid four-part version has a max value of \"65535.65535.65535.65535\" and must be all numeric.", version);
22 }
23
24 public static Message EmptyContainer(SourceLineNumber sourceLineNumbers, string containerId)
25 {
26 return Message(sourceLineNumbers, Ids.EmptyContainer, "The Container '{0}' is being ignored because it doesn't have any payloads.", containerId);
27 }
28
29 public static Message FailedToExtractAttachedContainers(SourceLineNumber sourceLineNumbers, string message)
30 {
31 return Message(sourceLineNumbers, Ids.FailedToExtractAttachedContainers, "Failed to extract attached container. This most often happens when extracting a stripped bundle from the package cache, which is not supported. Detail: {0}", message);
32 }
33
34 public static Message HiddenBundleNotSupported(SourceLineNumber sourceLineNumbers, string packageId)
35 {
36 return Message(sourceLineNumbers, Ids.HiddenBundleNotSupported, "The BundlePackage '{0}' does not support hiding its ARP registration.", packageId);
37 }
38
39 public static Message UnknownBundleRelationAction(SourceLineNumber sourceLineNumbers, string bundleExecutable, string action)
40 {
41 return Message(sourceLineNumbers, Ids.UnknownBundleRelationAction, "The manifest for the bundle '{0}' contains an unknown related bundle action '{1}'. It will be ignored.", bundleExecutable, action);
42 }
43
44 public static Message UnknownCoffMachineType(SourceLineNumber sourceLineNumbers, string bundleExecutable, ushort machineType)
45 {
46 return Message(sourceLineNumbers, Ids.UnknownCoffMachineType, "The bundle '{0}' has an unknown COFF machine type: {1}. It is assumed to be 32-bit.", bundleExecutable, machineType);
47 }
48
49 public static Message UnknownMsiPackagePlatform(SourceLineNumber sourceLineNumbers, string msiPath, string platform)
50 {
51 return Message(sourceLineNumbers, Ids.UnknownMsiPackagePlatform, "The MsiPackage '{0}' has an unknown platform: '{1}'. It is assumed to be 64-bit.", msiPath, platform);
52 }
53
54 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
55 {
56 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
57 }
58
59 public enum Ids
60 {
61 AttachedContainerPayloadCollision = 8500,
62 AttachedContainerPayloadCollision2 = 8501,
63 EmptyContainer = 8502,
64 FailedToExtractAttachedContainers = 8503,
65 UnknownCoffMachineType = 8504,
66 UnknownBundleRelationAction = 8505,
67 HiddenBundleNotSupported = 8506,
68 UnknownMsiPackagePlatform = 8507,
69 CannotParseBundleVersionAsFourPartVersion = 8508,
70 } // last available is 8999. 9000 is VerboseMessages.
71 }
72 }