diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-11 12:20:54 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-12 19:28:07 -0700 |
commit | aea4e48d8408689c5749d154dddcfb99ddfb257b (patch) | |
tree | df9e09caf8e16b65da763342c33ad9c385e09a96 /src | |
parent | e1c4d762286bcdd58c2fdac4098c9a5846398920 (diff) | |
download | wix-aea4e48d8408689c5749d154dddcfb99ddfb257b.tar.gz wix-aea4e48d8408689c5749d154dddcfb99ddfb257b.tar.bz2 wix-aea4e48d8408689c5749d154dddcfb99ddfb257b.zip |
Move RestartResource attributes to symbol
Diffstat (limited to 'src')
-rw-r--r-- | src/wixext/Symbols/WixRestartResourceSymbol.cs | 14 | ||||
-rw-r--r-- | src/wixext/UtilCompiler.cs | 22 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/wixext/Symbols/WixRestartResourceSymbol.cs b/src/wixext/Symbols/WixRestartResourceSymbol.cs index 7f76f1b8..01b92b63 100644 --- a/src/wixext/Symbols/WixRestartResourceSymbol.cs +++ b/src/wixext/Symbols/WixRestartResourceSymbol.cs | |||
@@ -30,6 +30,14 @@ namespace WixToolset.Util.Symbols | |||
30 | Attributes, | 30 | Attributes, |
31 | } | 31 | } |
32 | 32 | ||
33 | public enum WixRestartResourceAttributes | ||
34 | { | ||
35 | Filename = 1, | ||
36 | ProcessName, | ||
37 | ServiceName, | ||
38 | TypeMask = 0xf, | ||
39 | } | ||
40 | |||
33 | public class WixRestartResourceSymbol : IntermediateSymbol | 41 | public class WixRestartResourceSymbol : IntermediateSymbol |
34 | { | 42 | { |
35 | public WixRestartResourceSymbol() : base(UtilSymbolDefinitions.WixRestartResource, null, null) | 43 | public WixRestartResourceSymbol() : base(UtilSymbolDefinitions.WixRestartResource, null, null) |
@@ -54,10 +62,10 @@ namespace WixToolset.Util.Symbols | |||
54 | set => this.Set((int)WixRestartResourceSymbolFields.Resource, value); | 62 | set => this.Set((int)WixRestartResourceSymbolFields.Resource, value); |
55 | } | 63 | } |
56 | 64 | ||
57 | public int Attributes | 65 | public WixRestartResourceAttributes? Attributes |
58 | { | 66 | { |
59 | get => this.Fields[(int)WixRestartResourceSymbolFields.Attributes].AsNumber(); | 67 | get => (WixRestartResourceAttributes?)this.Fields[(int)WixRestartResourceSymbolFields.Attributes].AsNullableNumber(); |
60 | set => this.Set((int)WixRestartResourceSymbolFields.Attributes, value); | 68 | set => this.Set((int)WixRestartResourceSymbolFields.Attributes, (int?)value); |
61 | } | 69 | } |
62 | } | 70 | } |
63 | } \ No newline at end of file | 71 | } \ No newline at end of file |
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index c0312f48..12213e63 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs | |||
@@ -41,14 +41,6 @@ namespace WixToolset.Util | |||
41 | Compatible, | 41 | Compatible, |
42 | } | 42 | } |
43 | 43 | ||
44 | internal enum WixRestartResourceAttributes | ||
45 | { | ||
46 | Filename = 1, | ||
47 | ProcessName, | ||
48 | ServiceName, | ||
49 | TypeMask = 0xf, | ||
50 | } | ||
51 | |||
52 | internal enum WixRemoveFolderExOn | 44 | internal enum WixRemoveFolderExOn |
53 | { | 45 | { |
54 | Install = 1, | 46 | Install = 1, |
@@ -2909,7 +2901,7 @@ namespace WixToolset.Util | |||
2909 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2901 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2910 | Identifier id = null; | 2902 | Identifier id = null; |
2911 | string resource = null; | 2903 | string resource = null; |
2912 | var attributes = CompilerConstants.IntegerNotSet; | 2904 | WixRestartResourceAttributes? attributes = null; |
2913 | 2905 | ||
2914 | foreach (var attrib in element.Attributes()) | 2906 | foreach (var attrib in element.Attributes()) |
2915 | { | 2907 | { |
@@ -2923,17 +2915,17 @@ namespace WixToolset.Util | |||
2923 | 2915 | ||
2924 | case "Path": | 2916 | case "Path": |
2925 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2917 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2926 | attributes = (int)WixRestartResourceAttributes.Filename; | 2918 | attributes = WixRestartResourceAttributes.Filename; |
2927 | break; | 2919 | break; |
2928 | 2920 | ||
2929 | case "ProcessName": | 2921 | case "ProcessName": |
2930 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2922 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2931 | attributes = (int)WixRestartResourceAttributes.ProcessName; | 2923 | attributes = WixRestartResourceAttributes.ProcessName; |
2932 | break; | 2924 | break; |
2933 | 2925 | ||
2934 | case "ServiceName": | 2926 | case "ServiceName": |
2935 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2927 | resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2936 | attributes = (int)WixRestartResourceAttributes.ServiceName; | 2928 | attributes = WixRestartResourceAttributes.ServiceName; |
2937 | break; | 2929 | break; |
2938 | 2930 | ||
2939 | default: | 2931 | default: |
@@ -2948,14 +2940,14 @@ namespace WixToolset.Util | |||
2948 | } | 2940 | } |
2949 | 2941 | ||
2950 | // Validate the attribute. | 2942 | // Validate the attribute. |
2951 | if (null == id) | 2943 | if (id == null) |
2952 | { | 2944 | { |
2953 | id = this.ParseHelper.CreateIdentifier("wrr", componentId, resource, attributes.ToString()); | 2945 | id = this.ParseHelper.CreateIdentifier("wrr", componentId, resource, attributes.ToString()); |
2954 | } | 2946 | } |
2955 | 2947 | ||
2956 | if (String.IsNullOrEmpty(resource) || CompilerConstants.IntegerNotSet == attributes) | 2948 | if (!attributes.HasValue) |
2957 | { | 2949 | { |
2958 | this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Path", "ServiceName")); | 2950 | this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Path", "ProcessName", "ServiceName")); |
2959 | } | 2951 | } |
2960 | 2952 | ||
2961 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 2953 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |