diff options
Diffstat (limited to 'src/wixext/UtilWarnings.cs')
-rw-r--r-- | src/wixext/UtilWarnings.cs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/wixext/UtilWarnings.cs b/src/wixext/UtilWarnings.cs new file mode 100644 index 00000000..13dcea4e --- /dev/null +++ b/src/wixext/UtilWarnings.cs | |||
@@ -0,0 +1,72 @@ | |||
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.Util | ||
4 | { | ||
5 | using System; | ||
6 | using System.Resources; | ||
7 | using WixToolset.Data; | ||
8 | |||
9 | public static class UtilWarnings | ||
10 | { | ||
11 | public static Message AssemblyHarvestFailed(string file, string message) | ||
12 | { | ||
13 | return Message(null, Ids.AssemblyHarvestFailed, "Could not harvest data from a file that was expected to be an assembly: {0}. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); | ||
14 | } | ||
15 | |||
16 | public static Message DeprecatedPerfCounterElement(SourceLineNumber sourceLineNumbers) | ||
17 | { | ||
18 | return Message(sourceLineNumbers, Ids.DeprecatedPerfCounterElement, "The PerfCounter element has been deprecated. Please use the PerformanceCounter element instead."); | ||
19 | } | ||
20 | |||
21 | public static Message DuplicateDllRegistryEntry(string registryKey, string componentId) | ||
22 | { | ||
23 | return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId); | ||
24 | } | ||
25 | |||
26 | public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId) | ||
27 | { | ||
28 | return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{2}'. The registry key value '{1}' will not be harvested.", registryKey, registryKeyValue, componentId); | ||
29 | } | ||
30 | |||
31 | public static Message RequiredAttributeForWindowsXP(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | ||
32 | { | ||
33 | return Message(sourceLineNumbers, Ids.RequiredAttributeForWindowsXP, "The {0}/@{1} attribute must be specified to successfully install on Windows XP. You can ignore this warning if this installation does not install on Windows XP.", elementName, attributeName); | ||
34 | } | ||
35 | |||
36 | public static Message SelfRegHarvestFailed(string file, string message) | ||
37 | { | ||
38 | return Message(null, Ids.SelfRegHarvestFailed, "Could not harvest data from a file that was expected to be a SelfReg DLL: {0}. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); | ||
39 | } | ||
40 | |||
41 | public static Message TypeLibLoadFailed(string file, string message) | ||
42 | { | ||
43 | return Message(null, Ids.TypeLibLoadFailed, "Could not load file that was expected to be a type library based off of file extension: {0}. If this file is not a type library you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the load failure: {1}", file, message); | ||
44 | } | ||
45 | |||
46 | public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType) | ||
47 | { | ||
48 | return Message(null, Ids.UnsupportedRegistryType, "Ignoring the registry value '{0}' found on line {1}, because it is of a type unsupported by Windows Installer ({2}).", registryValue, regFileLineNumber, unsupportedType); | ||
49 | } | ||
50 | |||
51 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) | ||
52 | { | ||
53 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); | ||
54 | } | ||
55 | |||
56 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) | ||
57 | { | ||
58 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); | ||
59 | } | ||
60 | |||
61 | public enum Ids | ||
62 | { | ||
63 | SelfRegHarvestFailed = 5150, | ||
64 | AssemblyHarvestFailed = 5151, | ||
65 | TypeLibLoadFailed = 5152, | ||
66 | DeprecatedPerfCounterElement = 5153, | ||
67 | RequiredAttributeForWindowsXP = 5154, | ||
68 | DuplicateDllRegistryEntry = 5156, | ||
69 | UnsupportedRegistryType = 5157, | ||
70 | } | ||
71 | } | ||
72 | } | ||