diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wixext/FirewallCompiler.cs | 16 | ||||
| -rw-r--r-- | src/wixext/FirewallExtensionData.cs | 10 | ||||
| -rw-r--r-- | src/wixext/FirewallTableDefinitions.cs | 4 | ||||
| -rw-r--r-- | src/wixext/Tuples/FirewallTupleDefinitions.cs | 14 | ||||
| -rw-r--r-- | src/wixext/Tuples/WixFirewallExceptionTuple.cs | 82 |
5 files changed, 63 insertions, 63 deletions
diff --git a/src/wixext/FirewallCompiler.cs b/src/wixext/FirewallCompiler.cs index 900af7aa..aefc7f2c 100644 --- a/src/wixext/FirewallCompiler.cs +++ b/src/wixext/FirewallCompiler.cs | |||
| @@ -8,7 +8,7 @@ namespace WixToolset.Firewall | |||
| 8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| 9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
| 10 | using WixToolset.Extensibility.Data; | 10 | using WixToolset.Extensibility.Data; |
| 11 | using WixToolset.Firewall.Tuples; | 11 | using WixToolset.Firewall.Symbols; |
| 12 | 12 | ||
| 13 | /// <summary> | 13 | /// <summary> |
| 14 | /// The compiler for the WiX Toolset Firewall Extension. | 14 | /// The compiler for the WiX Toolset Firewall Extension. |
| @@ -259,7 +259,7 @@ namespace WixToolset.Firewall | |||
| 259 | fileId = file; | 259 | fileId = file; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | var tuple = section.AddTuple(new WixFirewallExceptionTuple(sourceLineNumbers, id) | 262 | var symbol = section.AddSymbol(new WixFirewallExceptionSymbol(sourceLineNumbers, id) |
| 263 | { | 263 | { |
| 264 | Name = name, | 264 | Name = name, |
| 265 | RemoteAddresses = remoteAddresses, | 265 | RemoteAddresses = remoteAddresses, |
| @@ -271,7 +271,7 @@ namespace WixToolset.Firewall | |||
| 271 | 271 | ||
| 272 | if (!String.IsNullOrEmpty(port)) | 272 | if (!String.IsNullOrEmpty(port)) |
| 273 | { | 273 | { |
| 274 | tuple.Port = port; | 274 | symbol.Port = port; |
| 275 | 275 | ||
| 276 | if (!protocol.HasValue) | 276 | if (!protocol.HasValue) |
| 277 | { | 277 | { |
| @@ -282,22 +282,22 @@ namespace WixToolset.Firewall | |||
| 282 | 282 | ||
| 283 | if (protocol.HasValue) | 283 | if (protocol.HasValue) |
| 284 | { | 284 | { |
| 285 | tuple.Protocol = protocol.Value; | 285 | symbol.Protocol = protocol.Value; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | if (!String.IsNullOrEmpty(fileId)) | 288 | if (!String.IsNullOrEmpty(fileId)) |
| 289 | { | 289 | { |
| 290 | tuple.Program = $"[#{fileId}]"; | 290 | symbol.Program = $"[#{fileId}]"; |
| 291 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, fileId); | 291 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.File, fileId); |
| 292 | } | 292 | } |
| 293 | else if (!String.IsNullOrEmpty(program)) | 293 | else if (!String.IsNullOrEmpty(program)) |
| 294 | { | 294 | { |
| 295 | tuple.Program = program; | 295 | symbol.Program = program; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | if (CompilerConstants.IntegerNotSet != attributes) | 298 | if (CompilerConstants.IntegerNotSet != attributes) |
| 299 | { | 299 | { |
| 300 | tuple.Attributes = attributes; | 300 | symbol.Attributes = attributes; |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFirewallExceptionsInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64 | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); | 303 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFirewallExceptionsInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64 | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); |
diff --git a/src/wixext/FirewallExtensionData.cs b/src/wixext/FirewallExtensionData.cs index 44cae0d6..7481d993 100644 --- a/src/wixext/FirewallExtensionData.cs +++ b/src/wixext/FirewallExtensionData.cs | |||
| @@ -9,15 +9,15 @@ namespace WixToolset.Firewall | |||
| 9 | { | 9 | { |
| 10 | public override string DefaultCulture => "en-US"; | 10 | public override string DefaultCulture => "en-US"; |
| 11 | 11 | ||
| 12 | public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) | 12 | public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) |
| 13 | { | 13 | { |
| 14 | tupleDefinition = FirewallTupleDefinitions.ByName(name); | 14 | symbolDefinition = FirewallSymbolDefinitions.ByName(name); |
| 15 | return tupleDefinition != null; | 15 | return symbolDefinition != null; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) | 18 | public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) |
| 19 | { | 19 | { |
| 20 | return Intermediate.Load(typeof(FirewallExtensionData).Assembly, "WixToolset.Firewall.firewall.wixlib", tupleDefinitions); | 20 | return Intermediate.Load(typeof(FirewallExtensionData).Assembly, "WixToolset.Firewall.firewall.wixlib", symbolDefinitions); |
| 21 | } | 21 | } |
| 22 | } | 22 | } |
| 23 | } | 23 | } |
diff --git a/src/wixext/FirewallTableDefinitions.cs b/src/wixext/FirewallTableDefinitions.cs index 068fe696..eae897d5 100644 --- a/src/wixext/FirewallTableDefinitions.cs +++ b/src/wixext/FirewallTableDefinitions.cs | |||
| @@ -8,7 +8,7 @@ namespace WixToolset.Firewall | |||
| 8 | { | 8 | { |
| 9 | public static readonly TableDefinition WixFirewallException = new TableDefinition( | 9 | public static readonly TableDefinition WixFirewallException = new TableDefinition( |
| 10 | "WixFirewallException", | 10 | "WixFirewallException", |
| 11 | FirewallTupleDefinitions.WixFirewallException, | 11 | FirewallSymbolDefinitions.WixFirewallException, |
| 12 | new[] | 12 | new[] |
| 13 | { | 13 | { |
| 14 | new ColumnDefinition("WixFirewallException", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The primary key, a non-localized token.", modularizeType: ColumnModularizeType.Column), | 14 | new ColumnDefinition("WixFirewallException", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The primary key, a non-localized token.", modularizeType: ColumnModularizeType.Column), |
| @@ -23,7 +23,7 @@ namespace WixToolset.Firewall | |||
| 23 | new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in Windows Firewall manager for this firewall rule."), | 23 | new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in Windows Firewall manager for this firewall rule."), |
| 24 | new ColumnDefinition("Direction", ColumnType.Number, 1, primaryKey: false, nullable: true, ColumnCategory.Integer, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"), | 24 | new ColumnDefinition("Direction", ColumnType.Number, 1, primaryKey: false, nullable: true, ColumnCategory.Integer, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"), |
| 25 | }, | 25 | }, |
| 26 | tupleIdIsPrimaryKey: true | 26 | symbolIdIsPrimaryKey: true |
| 27 | ); | 27 | ); |
| 28 | 28 | ||
| 29 | public static readonly TableDefinition[] All = new[] | 29 | public static readonly TableDefinition[] All = new[] |
diff --git a/src/wixext/Tuples/FirewallTupleDefinitions.cs b/src/wixext/Tuples/FirewallTupleDefinitions.cs index 2710380e..887893c7 100644 --- a/src/wixext/Tuples/FirewallTupleDefinitions.cs +++ b/src/wixext/Tuples/FirewallTupleDefinitions.cs | |||
| @@ -5,18 +5,18 @@ namespace WixToolset.Firewall | |||
| 5 | using System; | 5 | using System; |
| 6 | using WixToolset.Data; | 6 | using WixToolset.Data; |
| 7 | 7 | ||
| 8 | public enum FirewallTupleDefinitionType | 8 | public enum FirewallSymbolDefinitionType |
| 9 | { | 9 | { |
| 10 | WixFirewallException, | 10 | WixFirewallException, |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | public static partial class FirewallTupleDefinitions | 13 | public static partial class FirewallSymbolDefinitions |
| 14 | { | 14 | { |
| 15 | public static readonly Version Version = new Version("4.0.0"); | 15 | public static readonly Version Version = new Version("4.0.0"); |
| 16 | 16 | ||
| 17 | public static IntermediateTupleDefinition ByName(string name) | 17 | public static IntermediateSymbolDefinition ByName(string name) |
| 18 | { | 18 | { |
| 19 | if (!Enum.TryParse(name, out FirewallTupleDefinitionType type)) | 19 | if (!Enum.TryParse(name, out FirewallSymbolDefinitionType type)) |
| 20 | { | 20 | { |
| 21 | return null; | 21 | return null; |
| 22 | } | 22 | } |
| @@ -24,12 +24,12 @@ namespace WixToolset.Firewall | |||
| 24 | return ByType(type); | 24 | return ByType(type); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | public static IntermediateTupleDefinition ByType(FirewallTupleDefinitionType type) | 27 | public static IntermediateSymbolDefinition ByType(FirewallSymbolDefinitionType type) |
| 28 | { | 28 | { |
| 29 | switch (type) | 29 | switch (type) |
| 30 | { | 30 | { |
| 31 | case FirewallTupleDefinitionType.WixFirewallException: | 31 | case FirewallSymbolDefinitionType.WixFirewallException: |
| 32 | return FirewallTupleDefinitions.WixFirewallException; | 32 | return FirewallSymbolDefinitions.WixFirewallException; |
| 33 | 33 | ||
| 34 | default: | 34 | default: |
| 35 | throw new ArgumentOutOfRangeException(nameof(type)); | 35 | throw new ArgumentOutOfRangeException(nameof(type)); |
diff --git a/src/wixext/Tuples/WixFirewallExceptionTuple.cs b/src/wixext/Tuples/WixFirewallExceptionTuple.cs index d34b8207..620de969 100644 --- a/src/wixext/Tuples/WixFirewallExceptionTuple.cs +++ b/src/wixext/Tuples/WixFirewallExceptionTuple.cs | |||
| @@ -3,34 +3,34 @@ | |||
| 3 | namespace WixToolset.Firewall | 3 | namespace WixToolset.Firewall |
| 4 | { | 4 | { |
| 5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 6 | using WixToolset.Firewall.Tuples; | 6 | using WixToolset.Firewall.Symbols; |
| 7 | 7 | ||
| 8 | public static partial class FirewallTupleDefinitions | 8 | public static partial class FirewallSymbolDefinitions |
| 9 | { | 9 | { |
| 10 | public static readonly IntermediateTupleDefinition WixFirewallException = new IntermediateTupleDefinition( | 10 | public static readonly IntermediateSymbolDefinition WixFirewallException = new IntermediateSymbolDefinition( |
| 11 | FirewallTupleDefinitionType.WixFirewallException.ToString(), | 11 | FirewallSymbolDefinitionType.WixFirewallException.ToString(), |
| 12 | new[] | 12 | new[] |
| 13 | { | 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Name), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Name), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.RemoteAddresses), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.RemoteAddresses), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Port), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Port), IntermediateFieldType.String), |
| 17 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Protocol), IntermediateFieldType.Number), | 17 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Protocol), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Program), IntermediateFieldType.String), | 18 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Program), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Attributes), IntermediateFieldType.Number), | 19 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Attributes), IntermediateFieldType.Number), |
| 20 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Profile), IntermediateFieldType.Number), | 20 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Profile), IntermediateFieldType.Number), |
| 21 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.ComponentRef), IntermediateFieldType.String), | 21 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 22 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Description), IntermediateFieldType.String), | 22 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Description), IntermediateFieldType.String), |
| 23 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Direction), IntermediateFieldType.Number), | 23 | new IntermediateFieldDefinition(nameof(WixFirewallExceptionSymbolFields.Direction), IntermediateFieldType.Number), |
| 24 | }, | 24 | }, |
| 25 | typeof(WixFirewallExceptionTuple)); | 25 | typeof(WixFirewallExceptionSymbol)); |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | namespace WixToolset.Firewall.Tuples | 29 | namespace WixToolset.Firewall.Symbols |
| 30 | { | 30 | { |
| 31 | using WixToolset.Data; | 31 | using WixToolset.Data; |
| 32 | 32 | ||
| 33 | public enum WixFirewallExceptionTupleFields | 33 | public enum WixFirewallExceptionSymbolFields |
| 34 | { | 34 | { |
| 35 | Name, | 35 | Name, |
| 36 | RemoteAddresses, | 36 | RemoteAddresses, |
| @@ -44,76 +44,76 @@ namespace WixToolset.Firewall.Tuples | |||
| 44 | Direction, | 44 | Direction, |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | public class WixFirewallExceptionTuple : IntermediateTuple | 47 | public class WixFirewallExceptionSymbol : IntermediateSymbol |
| 48 | { | 48 | { |
| 49 | public WixFirewallExceptionTuple() : base(FirewallTupleDefinitions.WixFirewallException, null, null) | 49 | public WixFirewallExceptionSymbol() : base(FirewallSymbolDefinitions.WixFirewallException, null, null) |
| 50 | { | 50 | { |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | public WixFirewallExceptionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(FirewallTupleDefinitions.WixFirewallException, sourceLineNumber, id) | 53 | public WixFirewallExceptionSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(FirewallSymbolDefinitions.WixFirewallException, sourceLineNumber, id) |
| 54 | { | 54 | { |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | public IntermediateField this[WixFirewallExceptionTupleFields index] => this.Fields[(int)index]; | 57 | public IntermediateField this[WixFirewallExceptionSymbolFields index] => this.Fields[(int)index]; |
| 58 | 58 | ||
| 59 | public string Name | 59 | public string Name |
| 60 | { | 60 | { |
| 61 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Name].AsString(); | 61 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Name].AsString(); |
| 62 | set => this.Set((int)WixFirewallExceptionTupleFields.Name, value); | 62 | set => this.Set((int)WixFirewallExceptionSymbolFields.Name, value); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | public string RemoteAddresses | 65 | public string RemoteAddresses |
| 66 | { | 66 | { |
| 67 | get => this.Fields[(int)WixFirewallExceptionTupleFields.RemoteAddresses].AsString(); | 67 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.RemoteAddresses].AsString(); |
| 68 | set => this.Set((int)WixFirewallExceptionTupleFields.RemoteAddresses, value); | 68 | set => this.Set((int)WixFirewallExceptionSymbolFields.RemoteAddresses, value); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | public string Port | 71 | public string Port |
| 72 | { | 72 | { |
| 73 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Port].AsString(); | 73 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Port].AsString(); |
| 74 | set => this.Set((int)WixFirewallExceptionTupleFields.Port, value); | 74 | set => this.Set((int)WixFirewallExceptionSymbolFields.Port, value); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | public int? Protocol | 77 | public int? Protocol |
| 78 | { | 78 | { |
| 79 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Protocol].AsNullableNumber(); | 79 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Protocol].AsNullableNumber(); |
| 80 | set => this.Set((int)WixFirewallExceptionTupleFields.Protocol, value); | 80 | set => this.Set((int)WixFirewallExceptionSymbolFields.Protocol, value); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | public string Program | 83 | public string Program |
| 84 | { | 84 | { |
| 85 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Program].AsString(); | 85 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Program].AsString(); |
| 86 | set => this.Set((int)WixFirewallExceptionTupleFields.Program, value); | 86 | set => this.Set((int)WixFirewallExceptionSymbolFields.Program, value); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | public int Attributes | 89 | public int Attributes |
| 90 | { | 90 | { |
| 91 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Attributes].AsNumber(); | 91 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Attributes].AsNumber(); |
| 92 | set => this.Set((int)WixFirewallExceptionTupleFields.Attributes, value); | 92 | set => this.Set((int)WixFirewallExceptionSymbolFields.Attributes, value); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | public int Profile | 95 | public int Profile |
| 96 | { | 96 | { |
| 97 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Profile].AsNumber(); | 97 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Profile].AsNumber(); |
| 98 | set => this.Set((int)WixFirewallExceptionTupleFields.Profile, value); | 98 | set => this.Set((int)WixFirewallExceptionSymbolFields.Profile, value); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | public string ComponentRef | 101 | public string ComponentRef |
| 102 | { | 102 | { |
| 103 | get => this.Fields[(int)WixFirewallExceptionTupleFields.ComponentRef].AsString(); | 103 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.ComponentRef].AsString(); |
| 104 | set => this.Set((int)WixFirewallExceptionTupleFields.ComponentRef, value); | 104 | set => this.Set((int)WixFirewallExceptionSymbolFields.ComponentRef, value); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | public string Description | 107 | public string Description |
| 108 | { | 108 | { |
| 109 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Description].AsString(); | 109 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Description].AsString(); |
| 110 | set => this.Set((int)WixFirewallExceptionTupleFields.Description, value); | 110 | set => this.Set((int)WixFirewallExceptionSymbolFields.Description, value); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | public int Direction | 113 | public int Direction |
| 114 | { | 114 | { |
| 115 | get => this.Fields[(int)WixFirewallExceptionTupleFields.Direction].AsNumber(); | 115 | get => this.Fields[(int)WixFirewallExceptionSymbolFields.Direction].AsNumber(); |
| 116 | set => this.Set((int)WixFirewallExceptionTupleFields.Direction, value); | 116 | set => this.Set((int)WixFirewallExceptionSymbolFields.Direction, value); |
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| 119 | } \ No newline at end of file | 119 | } \ No newline at end of file |
