Fix Profile column definition.
It's a formatted field but was too short. Fixes https://github.com/wixtoolset/issues/issues/8043.
Bob Arnson committed
Mar 17, 2024 at 12:10 UTC
db7727a8b38e9ca118792c1f22835b3291314869
5 files changed
+20
-7
src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs
+1
-1
@@ -654,7 +654,7 @@ namespace WixToolsetTest.Firewall
654
var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder });
655
var output = Path.Combine(folder, $"Firewall{ruleName}.xml");
656
657
- build.BuildAndDecompileAndBuild(Build, Decompile, output);
657
+ build.BuildAndDecompileAndBuild(Build, Decompile, output, validate: true);
658
659
var doc = XDocument.Load(output);
660
var actual = doc.Descendants()
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingProperties/PackageComponents.wxs
+3
-2
@@ -4,6 +4,7 @@
4
<Fragment>
5
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6
<Component Id="FirewallComponent" Guid="28DF3387-F30E-4DBE-90E2-D2C760CB4DD9">
7
+ <File Source="$(sys.SOURCEFILEPATH)" />
8
<fw:FirewallException
9
Name="[NAME]"
10
Port="[LOCALPORT]"
@@ -31,8 +32,8 @@
32
/>
33
34
<fw:FirewallException Name="Single Nested properties" >
34
- <fw:RemoteAddress Value="[REMOTEADDRESS]" />
35
- <fw:LocalAddress Value="[LOCALADDRESS]" />
35
+ <fw:RemoteAddress Value="[REMOTEADDRESS]" />
36
+ <fw:LocalAddress Value="[LOCALADDRESS]" />
37
<fw:InterfaceType Value="[INTERFACETYPE]" />
38
<fw:Interface Name="[INTERFACE]" />
39
</fw:FirewallException>
src/ext/Firewall/wixext/FirewallTableDefinitions.cs
+2
-2
@@ -18,10 +18,10 @@ namespace WixToolset.Firewall
18
new ColumnDefinition("Protocol", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 0, maxValue: 255, description: "Protocol (6=TCP; 17=UDP). https://www.iana.org/assignments/protocol-numbers", modularizeType: ColumnModularizeType.Property),
19
new ColumnDefinition("Program", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Exception for a program (formatted path name).", modularizeType: ColumnModularizeType.Property),
20
new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Vital=1; IgnoreUpdates=2; EnableOnChange=4; INetFwRule2=8; INetFwRule3=16"),
21
- new ColumnDefinition("Profile", ColumnType.String, 4, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 1, maxValue: 2147483647, description: "Profile (1=domain; 2=private; 4=public; 2147483647=all).", modularizeType: ColumnModularizeType.Property),
21
+ new ColumnDefinition("Profile", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 1, maxValue: 2147483647, description: "Profile (1=domain; 2=private; 4=public; 2147483647=all).", modularizeType: ColumnModularizeType.Property),
22
new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table referencing component that controls the firewall configuration.", modularizeType: ColumnModularizeType.Column),
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: false, ColumnCategory.Integer, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"),
24
+ new ColumnDefinition("Direction", ColumnType.Number, 1, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"),
25
new ColumnDefinition("Action", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 0, maxValue: 1, description: "Action (0=Block; 1=Allow).", modularizeType: ColumnModularizeType.Property),
26
new ColumnDefinition("EdgeTraversal", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 0, maxValue: 3, description: "Edge traversal (0=Deny; 1=Allow; 2=DeferToApp; 3=DeferToUser).", modularizeType: ColumnModularizeType.Property),
27
new ColumnDefinition("Enabled", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, minValue: 0, maxValue: 1, description: "Enabled (0=Disabled; 1=Enabled).", modularizeType: ColumnModularizeType.Property),
src/internal/WixInternal.TestSupport/Builder.cs
+14
-1
@@ -100,7 +100,7 @@ namespace WixInternal.TestSupport
100
}
101
}
102
103
- public void BuildAndDecompileAndBuild(Action<string[]> buildFunc, Action<string[]> decompileFunc, string decompilePath)
103
+ public void BuildAndDecompileAndBuild(Action<string[]> buildFunc, Action<string[]> decompileFunc, string decompilePath, bool validate = false)
104
{
105
var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs");
106
var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl");
@@ -145,6 +145,19 @@ namespace WixInternal.TestSupport
145
146
buildFunc(firstBuildArgs.ToArray());
147
148
+ if (validate)
149
+ {
150
+ firstBuildArgs = new List<string>
151
+ {
152
+ "msi",
153
+ "validate",
154
+ "-intermediateFolder", intermediateFolder,
155
+ outputPath,
156
+ };
157
+
158
+ buildFunc(firstBuildArgs.ToArray());
159
+ }
160
+
161
// Decompile built output.
162
var decompileArgs = new List<string>
163
{
src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs
-1
@@ -4,7 +4,6 @@ namespace WixInternal.TestSupport
4
{
5
using System;
6
using System.Collections.Generic;
7
- using System.IO;
7
using System.Linq;
8
using System.Text;
9
using System.Xml.Linq;