diff options
Diffstat (limited to 'src/wixext/FirewallCompiler.cs')
-rw-r--r-- | src/wixext/FirewallCompiler.cs | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/wixext/FirewallCompiler.cs b/src/wixext/FirewallCompiler.cs index 0696b4b1..353afff3 100644 --- a/src/wixext/FirewallCompiler.cs +++ b/src/wixext/FirewallCompiler.cs | |||
@@ -4,10 +4,10 @@ namespace WixToolset.Firewall | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using System.Globalization; | ||
8 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
9 | using WixToolset.Data; | 8 | using WixToolset.Data; |
10 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Firewall.Tuples; | ||
11 | 11 | ||
12 | /// <summary> | 12 | /// <summary> |
13 | /// The compiler for the WiX Toolset Firewall Extension. | 13 | /// The compiler for the WiX Toolset Firewall Extension. |
@@ -255,13 +255,18 @@ namespace WixToolset.Firewall | |||
255 | fileId = file; | 255 | fileId = file; |
256 | } | 256 | } |
257 | 257 | ||
258 | var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFirewallException", id); | 258 | var tuple = new WixFirewallExceptionTuple(sourceLineNumbers, id) |
259 | row.Set(1, name); | 259 | { |
260 | row.Set(2, remoteAddresses); | 260 | Name = name, |
261 | RemoteAddresses = remoteAddresses, | ||
262 | Profile = profile ?? FirewallConstants.NET_FW_PROFILE2_ALL, | ||
263 | ComponentRef = componentId, | ||
264 | Description = description, | ||
265 | }; | ||
261 | 266 | ||
262 | if (!String.IsNullOrEmpty(port)) | 267 | if (!String.IsNullOrEmpty(port)) |
263 | { | 268 | { |
264 | row.Set(3, port); | 269 | tuple.Port = port; |
265 | 270 | ||
266 | if (!protocol.HasValue) | 271 | if (!protocol.HasValue) |
267 | { | 272 | { |
@@ -270,32 +275,24 @@ namespace WixToolset.Firewall | |||
270 | } | 275 | } |
271 | } | 276 | } |
272 | 277 | ||
273 | if (protocol.HasValue) | 278 | tuple.Protocol = protocol.Value; |
274 | { | ||
275 | row.Set(4, protocol); | ||
276 | } | ||
277 | 279 | ||
278 | if (!String.IsNullOrEmpty(fileId)) | 280 | if (!String.IsNullOrEmpty(fileId)) |
279 | { | 281 | { |
280 | row.Set(5, $"[#{fileId}]"); | 282 | tuple.Program = $"[#{fileId}]"; |
281 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", fileId); | 283 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", fileId); |
282 | } | 284 | } |
283 | else if (!String.IsNullOrEmpty(program)) | 285 | else if (!String.IsNullOrEmpty(program)) |
284 | { | 286 | { |
285 | row.Set(5, program); | 287 | tuple.Program = program; |
286 | } | 288 | } |
287 | 289 | ||
288 | if (CompilerConstants.IntegerNotSet != attributes) | 290 | if (CompilerConstants.IntegerNotSet != attributes) |
289 | { | 291 | { |
290 | row.Set(6, attributes); | 292 | tuple.Attributes = attributes; |
291 | } | 293 | } |
292 | 294 | ||
293 | // Default is "all" | 295 | section.Tuples.Add(tuple); |
294 | row.Set(7, profile ?? FirewallConstants.NET_FW_PROFILE2_ALL); | ||
295 | |||
296 | row.Set(8, componentId); | ||
297 | |||
298 | row.Set(9, description); | ||
299 | 296 | ||
300 | if (this.Context.Platform == Platform.ARM) | 297 | if (this.Context.Platform == Platform.ARM) |
301 | { | 298 | { |