From db7727a8b38e9ca118792c1f22835b3291314869 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 17 Mar 2024 12:10:29 -0400 Subject: [PATCH] Fix Profile column definition. It's a formatted field but was too short. Fixes https://github.com/wixtoolset/issues/issues/8043. --- .../FirewallExtensionFixture.cs | 2 +- .../UsingProperties/PackageComponents.wxs | 5 +++-- .../Firewall/wixext/FirewallTableDefinitions.cs | 4 ++-- src/internal/WixInternal.TestSupport/Builder.cs | 15 ++++++++++++++- .../XunitExtensions/WixAssert.cs | 1 - 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs index e39fafaad..65016865f 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs @@ -654,7 +654,7 @@ private static AttributeVerifier BuildAndDecompileAndBuild(string nameSpace, str var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder }); var output = Path.Combine(folder, $"Firewall{ruleName}.xml"); - build.BuildAndDecompileAndBuild(Build, Decompile, output); + build.BuildAndDecompileAndBuild(Build, Decompile, output, validate: true); var doc = XDocument.Load(output); var actual = doc.Descendants() diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingProperties/PackageComponents.wxs b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingProperties/PackageComponents.wxs index 05c3ea8ae..1aab3896e 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingProperties/PackageComponents.wxs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingProperties/PackageComponents.wxs @@ -4,6 +4,7 @@ + - - + + diff --git a/src/ext/Firewall/wixext/FirewallTableDefinitions.cs b/src/ext/Firewall/wixext/FirewallTableDefinitions.cs index 7a35bb594..fc8d7a36b 100644 --- a/src/ext/Firewall/wixext/FirewallTableDefinitions.cs +++ b/src/ext/Firewall/wixext/FirewallTableDefinitions.cs @@ -18,10 +18,10 @@ public static class FirewallTableDefinitions 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), new ColumnDefinition("Program", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Exception for a program (formatted path name).", modularizeType: ColumnModularizeType.Property), new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Vital=1; IgnoreUpdates=2; EnableOnChange=4; INetFwRule2=8; INetFwRule3=16"), - 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), + 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), 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), new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in Windows Firewall manager for this firewall rule."), - new ColumnDefinition("Direction", ColumnType.Number, 1, primaryKey: false, nullable: false, ColumnCategory.Integer, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"), + new ColumnDefinition("Direction", ColumnType.Number, 1, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 2, description: "Direction (1=in; 2=out)"), 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), 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), 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), diff --git a/src/internal/WixInternal.TestSupport/Builder.cs b/src/internal/WixInternal.TestSupport/Builder.cs index 51b7bb0a9..eec51797e 100644 --- a/src/internal/WixInternal.TestSupport/Builder.cs +++ b/src/internal/WixInternal.TestSupport/Builder.cs @@ -100,7 +100,7 @@ public string[] BuildAndQuery(Action buildFunc, bool validate, params } } - public void BuildAndDecompileAndBuild(Action buildFunc, Action decompileFunc, string decompilePath) + public void BuildAndDecompileAndBuild(Action buildFunc, Action decompileFunc, string decompilePath, bool validate = false) { var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs"); var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl"); @@ -145,6 +145,19 @@ public void BuildAndDecompileAndBuild(Action buildFunc, Action + { + "msi", + "validate", + "-intermediateFolder", intermediateFolder, + outputPath, + }; + + buildFunc(firstBuildArgs.ToArray()); + } + // Decompile built output. var decompileArgs = new List { diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs index 1df98d3bd..5ac28de15 100644 --- a/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs @@ -4,7 +4,6 @@ namespace WixInternal.TestSupport { using System; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Text; using System.Xml.Linq;