Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Profile column definition. #508

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="FirewallComponent" Guid="28DF3387-F30E-4DBE-90E2-D2C760CB4DD9">
<File Source="$(sys.SOURCEFILEPATH)" />
<fw:FirewallException
Name="[NAME]"
Port="[LOCALPORT]"
Expand Down Expand Up @@ -31,8 +32,8 @@
/>

<fw:FirewallException Name="Single Nested properties" >
<fw:RemoteAddress Value="[REMOTEADDRESS]" />
<fw:LocalAddress Value="[LOCALADDRESS]" />
<fw:RemoteAddress Value="[REMOTEADDRESS]" />
<fw:LocalAddress Value="[LOCALADDRESS]" />
<fw:InterfaceType Value="[INTERFACETYPE]" />
<fw:Interface Name="[INTERFACE]" />
</fw:FirewallException>
Expand Down
4 changes: 2 additions & 2 deletions src/ext/Firewall/wixext/FirewallTableDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"),
robmen marked this conversation as resolved.
Show resolved Hide resolved
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),
Expand Down
15 changes: 14 additions & 1 deletion src/internal/WixInternal.TestSupport/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public string[] BuildAndQuery(Action<string[]> buildFunc, bool validate, params
}
}

public void BuildAndDecompileAndBuild(Action<string[]> buildFunc, Action<string[]> decompileFunc, string decompilePath)
public void BuildAndDecompileAndBuild(Action<string[]> buildFunc, Action<string[]> decompileFunc, string decompilePath, bool validate = false)
{
var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs");
var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl");
Expand Down Expand Up @@ -145,6 +145,19 @@ public void BuildAndDecompileAndBuild(Action<string[]> buildFunc, Action<string[

buildFunc(firstBuildArgs.ToArray());

if (validate)
{
firstBuildArgs = new List<string>
{
"msi",
"validate",
"-intermediateFolder", intermediateFolder,
outputPath,
};

buildFunc(firstBuildArgs.ToArray());
}

// Decompile built output.
var decompileArgs = new List<string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading