diff options
Diffstat (limited to 'src/WixToolset.Core/Common.cs')
-rw-r--r-- | src/WixToolset.Core/Common.cs | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/WixToolset.Core/Common.cs b/src/WixToolset.Core/Common.cs index 1bb895be..79f06135 100644 --- a/src/WixToolset.Core/Common.cs +++ b/src/WixToolset.Core/Common.cs | |||
@@ -21,9 +21,21 @@ namespace WixToolset.Core | |||
21 | public static class Common | 21 | public static class Common |
22 | { | 22 | { |
23 | // TODO: Find a place to put all of these so they doesn't have to be public and exposed by WixToolset.Core.dll | 23 | // TODO: Find a place to put all of these so they doesn't have to be public and exposed by WixToolset.Core.dll |
24 | /// <summary> | ||
25 | /// | ||
26 | /// </summary> | ||
24 | public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; | 27 | public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; |
28 | /// <summary> | ||
29 | /// | ||
30 | /// </summary> | ||
25 | public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; | 31 | public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; |
32 | /// <summary> | ||
33 | /// | ||
34 | /// </summary> | ||
26 | public const string DowngradeDetectedProperty = "WIX_DOWNGRADE_DETECTED"; | 35 | public const string DowngradeDetectedProperty = "WIX_DOWNGRADE_DETECTED"; |
36 | /// <summary> | ||
37 | /// | ||
38 | /// </summary> | ||
27 | public const string DowngradePreventedCondition = "NOT WIX_DOWNGRADE_DETECTED"; | 39 | public const string DowngradePreventedCondition = "NOT WIX_DOWNGRADE_DETECTED"; |
28 | 40 | ||
29 | //------------------------------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------------------------------- |
@@ -51,6 +63,9 @@ namespace WixToolset.Core | |||
51 | // GENERIC_WRITE (0x40000000L) | 63 | // GENERIC_WRITE (0x40000000L) |
52 | // GENERIC_READ (0x80000000L) | 64 | // GENERIC_READ (0x80000000L) |
53 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll | 65 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll |
66 | /// <summary> | ||
67 | /// | ||
68 | /// </summary> | ||
54 | public static readonly string[] GenericPermissions = { "GenericAll", "GenericExecute", "GenericWrite", "GenericRead" }; | 69 | public static readonly string[] GenericPermissions = { "GenericAll", "GenericExecute", "GenericWrite", "GenericRead" }; |
55 | 70 | ||
56 | // Standard Access Rights (per WinNT.h) | 71 | // Standard Access Rights (per WinNT.h) |
@@ -61,6 +76,9 @@ namespace WixToolset.Core | |||
61 | // WRITE_OWNER (0x00080000L) | 76 | // WRITE_OWNER (0x00080000L) |
62 | // SYNCHRONIZE (0x00100000L) | 77 | // SYNCHRONIZE (0x00100000L) |
63 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll | 78 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll |
79 | /// <summary> | ||
80 | /// | ||
81 | /// </summary> | ||
64 | public static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" }; | 82 | public static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" }; |
65 | 83 | ||
66 | // Object-Specific Access Rights | 84 | // Object-Specific Access Rights |
@@ -77,11 +95,17 @@ namespace WixToolset.Core | |||
77 | // FILE_READ_ATTRIBUTES ( 0x0080 ) | 95 | // FILE_READ_ATTRIBUTES ( 0x0080 ) |
78 | // FILE_WRITE_ATTRIBUTES ( 0x0100 ) | 96 | // FILE_WRITE_ATTRIBUTES ( 0x0100 ) |
79 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll | 97 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll |
98 | /// <summary> | ||
99 | /// | ||
100 | /// </summary> | ||
80 | public static readonly string[] FolderPermissions = { "Read", "CreateFile", "CreateChild", "ReadExtendedAttributes", "WriteExtendedAttributes", "Traverse", "DeleteChild", "ReadAttributes", "WriteAttributes" }; | 101 | public static readonly string[] FolderPermissions = { "Read", "CreateFile", "CreateChild", "ReadExtendedAttributes", "WriteExtendedAttributes", "Traverse", "DeleteChild", "ReadAttributes", "WriteAttributes" }; |
81 | 102 | ||
82 | // Registry Access Rights (per TODO) | 103 | // Registry Access Rights (per TODO) |
83 | // ---------------------- | 104 | // ---------------------- |
84 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll | 105 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll |
106 | /// <summary> | ||
107 | /// | ||
108 | /// </summary> | ||
85 | public static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" }; | 109 | public static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" }; |
86 | 110 | ||
87 | // File Access Rights (per WinNT.h) | 111 | // File Access Rights (per WinNT.h) |
@@ -99,6 +123,9 @@ namespace WixToolset.Core | |||
99 | // STANDARD_RIGHTS_REQUIRED (0x000F0000L) | 123 | // STANDARD_RIGHTS_REQUIRED (0x000F0000L) |
100 | // FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) | 124 | // FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) |
101 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll | 125 | // TODO: Find a place to put this that it doesn't have to be public and exposed by WixToolset.Core.dll |
126 | /// <summary> | ||
127 | /// | ||
128 | /// </summary> | ||
102 | public static readonly string[] FilePermissions = { "Read", "Write", "Append", "ReadExtendedAttributes", "WriteExtendedAttributes", "Execute", "FileAllRights", "ReadAttributes", "WriteAttributes" }; | 129 | public static readonly string[] FilePermissions = { "Read", "Write", "Append", "ReadExtendedAttributes", "WriteExtendedAttributes", "Execute", "FileAllRights", "ReadAttributes", "WriteAttributes" }; |
103 | 130 | ||
104 | internal static readonly char[] IllegalLongFilenameCharacters = new[] { '\\', '/', '?', '*', '|', '>', '<', ':', '\"' }; // illegal: \ / ? | > < : / * " | 131 | internal static readonly char[] IllegalLongFilenameCharacters = new[] { '\\', '/', '?', '*', '|', '>', '<', ':', '\"' }; // illegal: \ / ? | > < : / * " |
@@ -596,10 +623,10 @@ namespace WixToolset.Core | |||
596 | /// <summary> | 623 | /// <summary> |
597 | /// Get an attribute value. | 624 | /// Get an attribute value. |
598 | /// </summary> | 625 | /// </summary> |
626 | /// <param name="messaging"></param> | ||
599 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 627 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
600 | /// <param name="attribute">The attribute containing the value to get.</param> | 628 | /// <param name="attribute">The attribute containing the value to get.</param> |
601 | /// <param name="emptyRule">A rule for the contents of the value. If the contents do not follow the rule, an error is thrown.</param> | 629 | /// <param name="emptyRule">A rule for the contents of the value. If the contents do not follow the rule, an error is thrown.</param> |
602 | /// <param name="messageHandler">A delegate that receives error messages.</param> | ||
603 | /// <returns>The attribute's value.</returns> | 630 | /// <returns>The attribute's value.</returns> |
604 | internal static string GetAttributeValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule) | 631 | internal static string GetAttributeValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule) |
605 | { | 632 | { |
@@ -641,9 +668,9 @@ namespace WixToolset.Core | |||
641 | /// <summary> | 668 | /// <summary> |
642 | /// Get an identifier attribute value and displays an error for an illegal identifier value. | 669 | /// Get an identifier attribute value and displays an error for an illegal identifier value. |
643 | /// </summary> | 670 | /// </summary> |
671 | /// <param name="messaging"></param> | ||
644 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 672 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
645 | /// <param name="attribute">The attribute containing the value to get.</param> | 673 | /// <param name="attribute">The attribute containing the value to get.</param> |
646 | /// <param name="messageHandler">A delegate that receives error messages.</param> | ||
647 | /// <returns>The attribute's identifier value or a special value if an error occurred.</returns> | 674 | /// <returns>The attribute's identifier value or a special value if an error occurred.</returns> |
648 | internal static string GetAttributeIdentifierValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) | 675 | internal static string GetAttributeIdentifierValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) |
649 | { | 676 | { |
@@ -676,11 +703,11 @@ namespace WixToolset.Core | |||
676 | /// <summary> | 703 | /// <summary> |
677 | /// Get an integer attribute value and displays an error for an illegal integer value. | 704 | /// Get an integer attribute value and displays an error for an illegal integer value. |
678 | /// </summary> | 705 | /// </summary> |
706 | /// <param name="messaging"></param> | ||
679 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 707 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
680 | /// <param name="attribute">The attribute containing the value to get.</param> | 708 | /// <param name="attribute">The attribute containing the value to get.</param> |
681 | /// <param name="minimum">The minimum legal value.</param> | 709 | /// <param name="minimum">The minimum legal value.</param> |
682 | /// <param name="maximum">The maximum legal value.</param> | 710 | /// <param name="maximum">The maximum legal value.</param> |
683 | /// <param name="messageHandler">A delegate that receives error messages.</param> | ||
684 | /// <returns>The attribute's integer value or a special value if an error occurred during conversion.</returns> | 711 | /// <returns>The attribute's integer value or a special value if an error occurred during conversion.</returns> |
685 | public static int GetAttributeIntegerValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) | 712 | public static int GetAttributeIntegerValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) |
686 | { | 713 | { |
@@ -715,9 +742,9 @@ namespace WixToolset.Core | |||
715 | /// <summary> | 742 | /// <summary> |
716 | /// Gets a yes/no value and displays an error for an illegal yes/no value. | 743 | /// Gets a yes/no value and displays an error for an illegal yes/no value. |
717 | /// </summary> | 744 | /// </summary> |
745 | /// <param name="messaging"></param> | ||
718 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 746 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
719 | /// <param name="attribute">The attribute containing the value to get.</param> | 747 | /// <param name="attribute">The attribute containing the value to get.</param> |
720 | /// <param name="messageHandler">A delegate that receives error messages.</param> | ||
721 | /// <returns>The attribute's YesNoType value.</returns> | 748 | /// <returns>The attribute's YesNoType value.</returns> |
722 | internal static YesNoType GetAttributeYesNoValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) | 749 | internal static YesNoType GetAttributeYesNoValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) |
723 | { | 750 | { |
@@ -833,6 +860,7 @@ namespace WixToolset.Core | |||
833 | /// <summary> | 860 | /// <summary> |
834 | /// Display an unexpected attribute error. | 861 | /// Display an unexpected attribute error. |
835 | /// </summary> | 862 | /// </summary> |
863 | /// <param name="messaging"></param> | ||
836 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 864 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
837 | /// <param name="attribute">The attribute.</param> | 865 | /// <param name="attribute">The attribute.</param> |
838 | public static void UnexpectedAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) | 866 | public static void UnexpectedAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) |
@@ -848,6 +876,7 @@ namespace WixToolset.Core | |||
848 | /// <summary> | 876 | /// <summary> |
849 | /// Display an unsupported extension attribute error. | 877 | /// Display an unsupported extension attribute error. |
850 | /// </summary> | 878 | /// </summary> |
879 | /// <param name="messaging"></param> | ||
851 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 880 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
852 | /// <param name="extensionAttribute">The extension attribute.</param> | 881 | /// <param name="extensionAttribute">The extension attribute.</param> |
853 | internal static void UnsupportedExtensionAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute extensionAttribute) | 882 | internal static void UnsupportedExtensionAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute extensionAttribute) |