diff options
Diffstat (limited to 'src/wixext/IisErrors.cs')
-rw-r--r-- | src/wixext/IisErrors.cs | 98 |
1 files changed, 62 insertions, 36 deletions
diff --git a/src/wixext/IisErrors.cs b/src/wixext/IisErrors.cs index 874c5609..e38d7807 100644 --- a/src/wixext/IisErrors.cs +++ b/src/wixext/IisErrors.cs | |||
@@ -1,70 +1,96 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset.Iis | 3 | namespace WixToolset.Data |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Data; | 6 | using System.Resources; |
7 | 7 | ||
8 | public static class IIsErrors | 8 | public static class IIsErrors |
9 | { | 9 | { |
10 | public static Message MimeMapExtensionMissingPeriod(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) | 10 | public static Message CannotHarvestWebSite() |
11 | { | ||
12 | return Message(null, Ids.CannotHarvestWebSite, "Cannot harvest website. On Windows Vista, you must install IIS 6 Management Compatibility."); | ||
13 | } | ||
14 | |||
15 | public static Message DeprecatedBinaryChildElement(SourceLineNumber sourceLineNumbers, string elementName) | ||
11 | { | 16 | { |
12 | throw new NotImplementedException(); | 17 | return Message(sourceLineNumbers, Ids.DeprecatedBinaryChildElement, "The {0} element contains a deprecated child Binary element. Please move the Binary element under a Fragment, Module, or Product element and set the {0}/@BinaryKey attribute to the value of the Binary/@Id attribute.", elementName); |
13 | } | 18 | } |
14 | 19 | ||
15 | public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | 20 | public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) |
16 | { | 21 | { |
17 | throw new NotImplementedException(); | 22 | 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); |
18 | } | 23 | } |
19 | 24 | ||
25 | public static Message IllegalCharacterInAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, Char illegalCharacter) | ||
26 | { | ||
27 | return Message(sourceLineNumbers, Ids.IllegalCharacterInAttributeValue, "The {0}/@{1} attribute's value, '{2}', is invalid. It cannot contain the character '{3}'.", elementName, attributeName, value, illegalCharacter); | ||
28 | } | ||
29 | |||
20 | public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) | 30 | public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) |
21 | { | 31 | { |
22 | throw new NotImplementedException(); | 32 | 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); |
23 | } | 33 | } |
24 | 34 | ||
25 | public static Message OneOfAttributesRequiredUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4) | 35 | public static Message InsufficientPermissionHarvestWebSite() |
26 | { | 36 | { |
27 | throw new NotImplementedException(); | 37 | return Message(null, Ids.InsufficientPermissionHarvestWebSite, "Not enough permissions to harvest website. On Windows Vista, you must run Heat elevated."); |
28 | } | 38 | } |
29 | 39 | ||
30 | public static Message WebSiteAttributeUnderWebSite(SourceLineNumber sourceLineNumbers, string elementName) | 40 | public static Message MimeMapExtensionMissingPeriod(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) |
31 | { | 41 | { |
32 | throw new NotImplementedException(); | 42 | return Message(sourceLineNumbers, Ids.MimeMapExtensionMissingPeriod, "The {0}/@{1} attribute's value, '{2}', is not a valid mime map extension. It must begin with a period.", elementName, attributeName, attributeValue); |
33 | } | 43 | } |
34 | 44 | ||
35 | public static Message WebApplicationAlreadySpecified(SourceLineNumber sourceLineNumbers, string elementName) | 45 | public static Message OneOfAttributesRequiredUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4) |
36 | { | 46 | { |
37 | throw new NotImplementedException(); | 47 | return Message(sourceLineNumbers, Ids.OneOfAttributesRequiredUnderComponent, "When nested under a Component, the {0} element must have one of the following attributes specified: {1}, {2}, {3} or {4}.", elementName, attributeName1, attributeName2, attributeName3, attributeName4); |
38 | } | 48 | } |
39 | 49 | ||
40 | public static Message IllegalCharacterInAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, char illegalCharacter) | 50 | public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) |
41 | { | 51 | { |
42 | throw new NotImplementedException(); | 52 | return Message(sourceLineNumbers, Ids.RequiredAttributeUnderComponent, "The {0}/@{1} attribute must be specified when the element has a Component as an ancestor.", elementName, attributeName); |
43 | } | 53 | } |
44 | 54 | ||
45 | public static Message DeprecatedBinaryChildElement(SourceLineNumber sourceLineNumbers, string elementName) | 55 | public static Message WebApplicationAlreadySpecified(SourceLineNumber sourceLineNumbers, string elementName) |
56 | { | ||
57 | return Message(sourceLineNumbers, Ids.WebApplicationAlreadySpecified, "The {0} element can have at most a single WebApplication specified. This can be either through the WebApplication attribute, or through a nested WebApplication element, but not both.", elementName); | ||
58 | } | ||
59 | |||
60 | public static Message WebSiteAttributeUnderWebSite(SourceLineNumber sourceLineNumbers, string elementName) | ||
46 | { | 61 | { |
47 | throw new NotImplementedException(); | 62 | return Message(sourceLineNumbers, Ids.WebSiteAttributeUnderWebSite, "The {0}/@WebSite attribute cannot be specified when the {0} element is nested under a WebSite element.", elementName); |
48 | } | 63 | } |
49 | 64 | ||
50 | public static Message WebSiteNotFound(string webSiteDescription) | 65 | public static Message WebSiteNotFound(string webSiteDescription) |
51 | { | 66 | { |
52 | throw new NotImplementedException(); | 67 | return Message(null, Ids.WebSiteNotFound, "The web site '{0}' could not be found. Please check that the web site exists, and that it is spelled correctly (please note, you must use the correct case).", webSiteDescription); |
53 | } | 68 | } |
54 | 69 | ||
55 | public static Message InsufficientPermissionHarvestWebSite() | 70 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
56 | { | 71 | { |
57 | throw new NotImplementedException(); | 72 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); |
58 | } | 73 | } |
59 | 74 | ||
60 | public static Message CannotHarvestWebSite() | 75 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) |
61 | { | 76 | { |
62 | throw new NotImplementedException(); | 77 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); |
63 | } | 78 | } |
64 | 79 | ||
65 | public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | 80 | public enum Ids |
66 | { | 81 | { |
67 | throw new NotImplementedException(); | 82 | MimeMapExtensionMissingPeriod = 5150, |
83 | IllegalAttributeWithoutComponent = 5151, | ||
84 | IllegalElementWithoutComponent = 5152, | ||
85 | OneOfAttributesRequiredUnderComponent = 5153, | ||
86 | WebSiteAttributeUnderWebSite = 5154, | ||
87 | WebApplicationAlreadySpecified = 5155, | ||
88 | IllegalCharacterInAttributeValue = 5156, | ||
89 | DeprecatedBinaryChildElement = 5157, | ||
90 | WebSiteNotFound = 5158, | ||
91 | InsufficientPermissionHarvestWebSite = 5159, | ||
92 | CannotHarvestWebSite = 5160, | ||
93 | RequiredAttributeUnderComponent = 5161, | ||
68 | } | 94 | } |
69 | } | 95 | } |
70 | } \ No newline at end of file | 96 | } |