aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/CompilerWarnings.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/CompilerWarnings.cs')
-rw-r--r--src/WixToolset.Core/CompilerWarnings.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/WixToolset.Core/CompilerWarnings.cs b/src/WixToolset.Core/CompilerWarnings.cs
new file mode 100644
index 00000000..3b9666dd
--- /dev/null
+++ b/src/WixToolset.Core/CompilerWarnings.cs
@@ -0,0 +1,53 @@
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
3namespace WixToolset.Core
4{
5 using WixToolset.Data;
6
7 internal static class CompilerWarnings
8 {
9 public static Message DiscouragedVersionAttribute(SourceLineNumber sourceLineNumbers)
10 {
11 return Message(sourceLineNumbers, Ids.DiscouragedVersionAttribute, "The Provides/@Version attribute should not be specified in an MSI package. The ProductVersion will be used by default.");
12 }
13
14 public static Message DiscouragedVersionAttribute(SourceLineNumber sourceLineNumbers, string id)
15 {
16 return Message(sourceLineNumbers, Ids.DiscouragedVersionAttribute, "The Provides/@Version attribute should not be specified for MSI package {0}. The ProductVersion will be used by default.", id);
17 }
18
19 public static Message PropertyRemoved(string name)
20 {
21 return Message(null, Ids.PropertyRemoved, "The property {0} was authored in the package with a value and will be removed. The property should not be authored.", name);
22 }
23
24 public static Message ProvidesKeyNotFound(SourceLineNumber sourceLineNumbers, string id)
25 {
26 return Message(sourceLineNumbers, Ids.ProvidesKeyNotFound, "The provider key with identifier {0} was not found in the WixDependencyProvider table. Related registry rows will not be removed from authoring.", id);
27 }
28
29 public static Message RequiresKeyNotFound(SourceLineNumber sourceLineNumbers, string id)
30 {
31 return Message(sourceLineNumbers, Ids.RequiresKeyNotFound, "The dependency key with identifier {0} was not found in the WixDependency table. Related registry rows will not be removed from authoring.", id);
32 }
33
34 public static Message Win64Component(SourceLineNumber sourceLineNumbers, string componentId)
35 {
36 return Message(sourceLineNumbers, Ids.Win64Component, "The Provides element should not be authored in the 64-bit component with identifier {0}. The dependency feature may not work if installing this package on 64-bit Windows operating systems prior to Windows 7 and Windows Server 2008 R2. Set the Component/@Bitness attribute to \"always32\" to ensure the dependency feature works correctly on legacy operating systems.", componentId);
37 }
38
39 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
40 {
41 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
42 }
43
44 public enum Ids
45 {
46 ProvidesKeyNotFound = 5431,
47 RequiresKeyNotFound = 5432,
48 PropertyRemoved = 5433,
49 DiscouragedVersionAttribute = 5434,
50 Win64Component = 5435,
51 }
52 }
53}