aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/wixext/UtilErrors.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-05-03 09:55:22 -0700
committerRob Mensching <rob@firegiant.com>2021-05-03 09:55:22 -0700
commitff659159e041bf6c083e6b7fcb9b726065a9dd73 (patch)
treeea95bf3d3e031edcee65de33b9e6954178be669c /src/ext/Util/wixext/UtilErrors.cs
parent8a8a25695351ee542f08886a9d0957c78c6af366 (diff)
downloadwix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.gz
wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.bz2
wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.zip
Move Util.wixext into ext
Diffstat (limited to 'src/ext/Util/wixext/UtilErrors.cs')
-rw-r--r--src/ext/Util/wixext/UtilErrors.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/ext/Util/wixext/UtilErrors.cs b/src/ext/Util/wixext/UtilErrors.cs
new file mode 100644
index 00000000..b9ce1688
--- /dev/null
+++ b/src/ext/Util/wixext/UtilErrors.cs
@@ -0,0 +1,49 @@
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.Util
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class UtilErrors
10 {
11 public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
12 {
13 return Message(sourceLineNumbers, Ids.IllegalAttributeWithoutComponent, "The {0}/@{1} attribute cannot be specified unless the element has a Component as an ancestor. A {0} that does not have a Component ancestor is not installed.", elementName, attributeName);
14 }
15
16 public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName)
17 {
18 return Message(sourceLineNumbers, Ids.IllegalElementWithoutComponent, "The {0} element cannot be specified unless the element has a Component as an ancestor. A {0} that does not have a Component ancestor is not installed.", elementName);
19 }
20
21 public static Message IllegalFileValueInPerfmonOrManifest(string file, string table)
22 {
23 return Message(null, Ids.IllegalFileValueInPerfmonOrManifest, "The value '{0}' in the File column, {1} table is invalid. It should be in the form of '[#file]' or '[!file]'.", file, table);
24 }
25
26 public static Message InvalidRegistryObject(SourceLineNumber sourceLineNumbers, string registryElementName)
27 {
28 return Message(sourceLineNumbers, Ids.InvalidRegistryObject, "The {0} element has no id and cannot have its permissions set. If you want to set permissions on a 'placeholder' registry key, force its creation by setting the ForceCreateOnInstall attribute to yes.", registryElementName);
29 }
30
31 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
32 {
33 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
34 }
35
36 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
37 {
38 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
39 }
40
41 public enum Ids
42 {
43 IllegalAttributeWithoutComponent = 5050,
44 IllegalElementWithoutComponent = 5051,
45 IllegalFileValueInPerfmonOrManifest = 5054,
46 InvalidRegistryObject = 5063,
47 }
48 }
49}