diff options
author | Rob Mensching <rob@firegiant.com> | 2021-03-14 07:30:11 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-03-14 07:41:14 -0700 |
commit | db5c1dd657a495d9ff33b42b4f1d6c8f53c0fc00 (patch) | |
tree | d693914cc194d582af55adc543b4f6257a881c24 /src | |
parent | 0832f4f8538a9621c8197f406edd95990232dfe4 (diff) | |
download | wix-db5c1dd657a495d9ff33b42b4f1d6c8f53c0fc00.tar.gz wix-db5c1dd657a495d9ff33b42b4f1d6c8f53c0fc00.tar.bz2 wix-db5c1dd657a495d9ff33b42b4f1d6c8f53c0fc00.zip |
Extract data out of Core to minimize public surface area
Part of wixtoolset/issues#6374
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Data/Localization.cs | 4 | ||||
-rw-r--r-- | src/WixToolset.Data/Symbols/LockPermissionsSymbol.cs | 81 | ||||
-rw-r--r-- | src/WixToolset.Data/Symbols/PatchMetadataSymbol.cs | 31 | ||||
-rw-r--r-- | src/WixToolset.Data/Symbols/UpgradeSymbol.cs | 23 | ||||
-rw-r--r-- | src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs | 30 |
5 files changed, 166 insertions, 3 deletions
diff --git a/src/WixToolset.Data/Localization.cs b/src/WixToolset.Data/Localization.cs index ccc531f3..7ce765f4 100644 --- a/src/WixToolset.Data/Localization.cs +++ b/src/WixToolset.Data/Localization.cs | |||
@@ -12,8 +12,8 @@ namespace WixToolset.Data | |||
12 | /// </summary> | 12 | /// </summary> |
13 | public sealed class Localization | 13 | public sealed class Localization |
14 | { | 14 | { |
15 | private Dictionary<string, BindVariable> variables = new Dictionary<string, BindVariable>(); | 15 | private readonly Dictionary<string, BindVariable> variables = new Dictionary<string, BindVariable>(); |
16 | private Dictionary<string, LocalizedControl> localizedControls = new Dictionary<string, LocalizedControl>(); | 16 | private readonly Dictionary<string, LocalizedControl> localizedControls = new Dictionary<string, LocalizedControl>(); |
17 | 17 | ||
18 | /// <summary> | 18 | /// <summary> |
19 | /// Instantiates a new localization object. | 19 | /// Instantiates a new localization object. |
diff --git a/src/WixToolset.Data/Symbols/LockPermissionsSymbol.cs b/src/WixToolset.Data/Symbols/LockPermissionsSymbol.cs index 12562fd1..b9337446 100644 --- a/src/WixToolset.Data/Symbols/LockPermissionsSymbol.cs +++ b/src/WixToolset.Data/Symbols/LockPermissionsSymbol.cs | |||
@@ -31,6 +31,87 @@ namespace WixToolset.Data.Symbols | |||
31 | Permission, | 31 | Permission, |
32 | } | 32 | } |
33 | 33 | ||
34 | /// <summary> | ||
35 | ///------------------------------------------------------------------------------------------------- | ||
36 | /// Layout of an Access Mask (from http://technet.microsoft.com/en-us/library/cc783530(WS.10).aspx) | ||
37 | /// | ||
38 | /// ------------------------------------------------------------------------------------------------- | ||
39 | /// |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00| | ||
40 | /// ------------------------------------------------------------------------------------------------- | ||
41 | /// |GR|GW|GE|GA| Reserved |AS|StandardAccessRights| Object-Specific Access Rights | | ||
42 | /// | ||
43 | /// Key | ||
44 | /// GR = Generic Read | ||
45 | /// GW = Generic Write | ||
46 | /// GE = Generic Execute | ||
47 | /// GA = Generic All | ||
48 | /// AS = Right to access SACL | ||
49 | /// </summary> | ||
50 | public static class LockPermissionConstants | ||
51 | { | ||
52 | /// <summary> | ||
53 | /// Generic Access Rights (per WinNT.h) | ||
54 | /// --------------------- | ||
55 | /// GENERIC_ALL (0x10000000L) | ||
56 | /// GENERIC_EXECUTE (0x20000000L) | ||
57 | /// GENERIC_WRITE (0x40000000L) | ||
58 | /// GENERIC_READ (0x80000000L) | ||
59 | /// </summary> | ||
60 | public static readonly string[] GenericPermissions = { "GenericAll", "GenericExecute", "GenericWrite", "GenericRead" }; | ||
61 | |||
62 | /// <summary> | ||
63 | /// Standard Access Rights (per WinNT.h) | ||
64 | /// ---------------------- | ||
65 | /// DELETE (0x00010000L) | ||
66 | /// READ_CONTROL (0x00020000L) | ||
67 | /// WRITE_DAC (0x00040000L) | ||
68 | /// WRITE_OWNER (0x00080000L) | ||
69 | /// SYNCHRONIZE (0x00100000L) | ||
70 | /// </summary> | ||
71 | public static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" }; | ||
72 | |||
73 | /// <summary> | ||
74 | /// Object-Specific Access Rights | ||
75 | /// ============================= | ||
76 | /// Directory Access Rights (per WinNT.h) | ||
77 | /// ----------------------- | ||
78 | /// FILE_LIST_DIRECTORY ( 0x0001 ) | ||
79 | /// FILE_ADD_FILE ( 0x0002 ) | ||
80 | /// FILE_ADD_SUBDIRECTORY ( 0x0004 ) | ||
81 | /// FILE_READ_EA ( 0x0008 ) | ||
82 | /// FILE_WRITE_EA ( 0x0010 ) | ||
83 | /// FILE_TRAVERSE ( 0x0020 ) | ||
84 | /// FILE_DELETE_CHILD ( 0x0040 ) | ||
85 | /// FILE_READ_ATTRIBUTES ( 0x0080 ) | ||
86 | /// FILE_WRITE_ATTRIBUTES ( 0x0100 ) | ||
87 | /// </summary> | ||
88 | public static readonly string[] FolderPermissions = { "Read", "CreateFile", "CreateChild", "ReadExtendedAttributes", "WriteExtendedAttributes", "Traverse", "DeleteChild", "ReadAttributes", "WriteAttributes" }; | ||
89 | |||
90 | /// <summary> | ||
91 | /// Registry Access Rights | ||
92 | /// ---------------------- | ||
93 | /// </summary> | ||
94 | public static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" }; | ||
95 | |||
96 | /// <summary> | ||
97 | /// File Access Rights (per WinNT.h) | ||
98 | /// ------------------ | ||
99 | /// FILE_READ_DATA ( 0x0001 ) | ||
100 | /// FILE_WRITE_DATA ( 0x0002 ) | ||
101 | /// FILE_APPEND_DATA ( 0x0004 ) | ||
102 | /// FILE_READ_EA ( 0x0008 ) | ||
103 | /// FILE_WRITE_EA ( 0x0010 ) | ||
104 | /// FILE_EXECUTE ( 0x0020 ) | ||
105 | /// via mask FILE_ALL_ACCESS ( 0x0040 ) | ||
106 | /// FILE_READ_ATTRIBUTES ( 0x0080 ) | ||
107 | /// FILE_WRITE_ATTRIBUTES ( 0x0100 ) | ||
108 | /// | ||
109 | /// STANDARD_RIGHTS_REQUIRED (0x000F0000L) | ||
110 | /// FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) | ||
111 | /// </summary> | ||
112 | public static readonly string[] FilePermissions = { "Read", "Write", "Append", "ReadExtendedAttributes", "WriteExtendedAttributes", "Execute", "FileAllRights", "ReadAttributes", "WriteAttributes" }; | ||
113 | } | ||
114 | |||
34 | public class LockPermissionsSymbol : IntermediateSymbol | 115 | public class LockPermissionsSymbol : IntermediateSymbol |
35 | { | 116 | { |
36 | public LockPermissionsSymbol() : base(SymbolDefinitions.LockPermissions, null, null) | 117 | public LockPermissionsSymbol() : base(SymbolDefinitions.LockPermissions, null, null) |
diff --git a/src/WixToolset.Data/Symbols/PatchMetadataSymbol.cs b/src/WixToolset.Data/Symbols/PatchMetadataSymbol.cs index 3f67aef7..201b8444 100644 --- a/src/WixToolset.Data/Symbols/PatchMetadataSymbol.cs +++ b/src/WixToolset.Data/Symbols/PatchMetadataSymbol.cs | |||
@@ -20,6 +20,8 @@ namespace WixToolset.Data | |||
20 | 20 | ||
21 | namespace WixToolset.Data.Symbols | 21 | namespace WixToolset.Data.Symbols |
22 | { | 22 | { |
23 | using System; | ||
24 | |||
23 | public enum PatchMetadataSymbolFields | 25 | public enum PatchMetadataSymbolFields |
24 | { | 26 | { |
25 | Company, | 27 | Company, |
@@ -27,6 +29,33 @@ namespace WixToolset.Data.Symbols | |||
27 | Value, | 29 | Value, |
28 | } | 30 | } |
29 | 31 | ||
32 | /// <summary> | ||
33 | /// Values for the OptimizeCA MsiPatchMetdata property, which indicates whether custom actions can be skipped when applying the patch. | ||
34 | /// </summary> | ||
35 | [Flags] | ||
36 | public enum OptimizeCAFlags | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// No custom actions are skipped. | ||
40 | /// </summary> | ||
41 | None = 0, | ||
42 | |||
43 | /// <summary> | ||
44 | /// Skip property (type 51) and directory (type 35) assignment custom actions. | ||
45 | /// </summary> | ||
46 | SkipAssignment = 1, | ||
47 | |||
48 | /// <summary> | ||
49 | /// Skip immediate custom actions that are not property or directory assignment custom actions. | ||
50 | /// </summary> | ||
51 | SkipImmediate = 2, | ||
52 | |||
53 | /// <summary> | ||
54 | /// Skip custom actions that run within the script. | ||
55 | /// </summary> | ||
56 | SkipDeferred = 4 | ||
57 | } | ||
58 | |||
30 | public class PatchMetadataSymbol : IntermediateSymbol | 59 | public class PatchMetadataSymbol : IntermediateSymbol |
31 | { | 60 | { |
32 | public PatchMetadataSymbol() : base(SymbolDefinitions.PatchMetadata, null, null) | 61 | public PatchMetadataSymbol() : base(SymbolDefinitions.PatchMetadata, null, null) |
@@ -57,4 +86,4 @@ namespace WixToolset.Data.Symbols | |||
57 | set => this.Set((int)PatchMetadataSymbolFields.Value, value); | 86 | set => this.Set((int)PatchMetadataSymbolFields.Value, value); |
58 | } | 87 | } |
59 | } | 88 | } |
60 | } \ No newline at end of file | 89 | } |
diff --git a/src/WixToolset.Data/Symbols/UpgradeSymbol.cs b/src/WixToolset.Data/Symbols/UpgradeSymbol.cs index d8deee73..51eb74ef 100644 --- a/src/WixToolset.Data/Symbols/UpgradeSymbol.cs +++ b/src/WixToolset.Data/Symbols/UpgradeSymbol.cs | |||
@@ -45,6 +45,29 @@ namespace WixToolset.Data.Symbols | |||
45 | ActionProperty, | 45 | ActionProperty, |
46 | } | 46 | } |
47 | 47 | ||
48 | public static class WixUpgradeConstants | ||
49 | { | ||
50 | /// <summary> | ||
51 | /// Standard property for detecting upgrades. | ||
52 | /// </summary> | ||
53 | public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; | ||
54 | |||
55 | /// <summary> | ||
56 | /// Standard condition to prevent upgrades. | ||
57 | /// </summary> | ||
58 | public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; | ||
59 | |||
60 | /// <summary> | ||
61 | /// Standard property for downgrade detected. | ||
62 | /// </summary> | ||
63 | public const string DowngradeDetectedProperty = "WIX_DOWNGRADE_DETECTED"; | ||
64 | |||
65 | /// <summary> | ||
66 | /// Standard condition to prevent downgrades. | ||
67 | /// </summary> | ||
68 | public const string DowngradePreventedCondition = "NOT WIX_DOWNGRADE_DETECTED"; | ||
69 | } | ||
70 | |||
48 | public class UpgradeSymbol : IntermediateSymbol | 71 | public class UpgradeSymbol : IntermediateSymbol |
49 | { | 72 | { |
50 | public UpgradeSymbol() : base(SymbolDefinitions.Upgrade, null, null) | 73 | public UpgradeSymbol() : base(SymbolDefinitions.Upgrade, null, null) |
diff --git a/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs b/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs index c4f4324d..344fc058 100644 --- a/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs +++ b/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs | |||
@@ -20,6 +20,8 @@ namespace WixToolset.Data | |||
20 | 20 | ||
21 | namespace WixToolset.Data.Symbols | 21 | namespace WixToolset.Data.Symbols |
22 | { | 22 | { |
23 | using System; | ||
24 | |||
23 | public enum WixPatchIdSymbolFields | 25 | public enum WixPatchIdSymbolFields |
24 | { | 26 | { |
25 | ClientPatchId, | 27 | ClientPatchId, |
@@ -27,6 +29,34 @@ namespace WixToolset.Data.Symbols | |||
27 | ApiPatchingSymbolFlags, | 29 | ApiPatchingSymbolFlags, |
28 | } | 30 | } |
29 | 31 | ||
32 | /// <summary> | ||
33 | /// The following flags are used with PATCH_OPTION_DATA SymbolOptionFlags: | ||
34 | /// </summary> | ||
35 | [Flags] | ||
36 | [CLSCompliant(false)] | ||
37 | public enum PatchSymbolFlags : uint | ||
38 | { | ||
39 | /// <summary> | ||
40 | /// Don't use imagehlp.dll | ||
41 | /// </summary> | ||
42 | PatchSymbolNoImagehlp = 0x00000001, | ||
43 | |||
44 | /// <summary> | ||
45 | /// Don't fail patch due to imagehlp failures. | ||
46 | /// </summary> | ||
47 | PatchSymbolNoFailures = 0x00000002, | ||
48 | |||
49 | /// <summary> | ||
50 | /// After matching decorated symbols, try to match remaining by undecorated names. | ||
51 | /// </summary> | ||
52 | PatchSymbolUndecoratedToo = 0x00000004, | ||
53 | |||
54 | /// <summary> | ||
55 | /// (used internally) | ||
56 | /// </summary> | ||
57 | PatchSymbolReserved = 0x80000000, | ||
58 | } | ||
59 | |||
30 | public class WixPatchIdSymbol : IntermediateSymbol | 60 | public class WixPatchIdSymbol : IntermediateSymbol |
31 | { | 61 | { |
32 | public WixPatchIdSymbol() : base(SymbolDefinitions.WixPatchId, null, null) | 62 | public WixPatchIdSymbol() : base(SymbolDefinitions.WixPatchId, null, null) |