Clean up Firewall extension (model for all).
Bob Arnson committed
Dec 12, 2021 at 17:35 UTC
ee8b4f230241a00d8e3ed145e85fb5d8d3c75914
12 files changed
+24
-131
src/ext/Firewall/Firewall.wixext.sln
+2
-2
@@ -1,7 +1,7 @@
1
2
Microsoft Visual Studio Solution File, Format Version 12.00
3
-# Visual Studio 15
4
-VisualStudioVersion = 15.0.27130.2003
3
+# Visual Studio Version 16
4
+VisualStudioVersion = 16.0.31624.102
5
MinimumVisualStudioVersion = 15.0.26124.0
6
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fwca", "ca\fwca.vcxproj", "{F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}"
7
EndProject
src/ext/Firewall/ca/caDecor.h
deleted
-13
@@ -1,13 +0,0 @@
1
-#pragma once
2
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
-
4
-
5
-#if defined(_M_ARM64)
6
-#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_A64"
7
-#elif defined(_M_AMD64)
8
-#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X64"
9
-#elif defined(_M_ARM)
10
-#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_ARM"
11
-#else
12
-#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X86"
13
-#endif
src/ext/Firewall/ca/precomp.h
+1
-1
@@ -16,4 +16,4 @@
16
#include "CustomMsiErrors.h"
17
#include "cost.h"
18
19
-#include "caDecor.h"
19
+#include "..\..\caDecor.h"
src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs
+2
-15
@@ -25,7 +25,7 @@ namespace WixToolsetTest.Firewall
25
"CustomAction:Wix4RollbackFirewallExceptionsUninstall_X86\t3329\tWix4FWCA_X86\tExecFirewallExceptions\t",
26
"CustomAction:Wix4SchedFirewallExceptionsInstall_X86\t1\tWix4FWCA_X86\tSchedFirewallExceptionsInstall\t",
27
"CustomAction:Wix4SchedFirewallExceptionsUninstall_X86\t1\tWix4FWCA_X86\tSchedFirewallExceptionsUninstall\t",
28
- "Wix4FirewallException:ExampleFirewall\texample\t*\t42\t6\t\t0\t2147483647\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example firewall\t1",
28
+ "Wix4FirewallException:ExampleFirewall\texample\t*\t42\t6\t[#filNdJBJmq3UCUIwmXS8x21aAsvqzk]\t0\t2147483647\tfilNdJBJmq3UCUIwmXS8x21aAsvqzk\tAn example firewall\t2",
29
}, results);
30
}
31
@@ -44,20 +44,7 @@ namespace WixToolsetTest.Firewall
44
"CustomAction:Wix4RollbackFirewallExceptionsUninstall_A64\t3329\tWix4FWCA_A64\tExecFirewallExceptions\t",
45
"CustomAction:Wix4SchedFirewallExceptionsInstall_A64\t1\tWix4FWCA_A64\tSchedFirewallExceptionsInstall\t",
46
"CustomAction:Wix4SchedFirewallExceptionsUninstall_A64\t1\tWix4FWCA_A64\tSchedFirewallExceptionsUninstall\t",
47
- "Wix4FirewallException:ExampleFirewall\texample\t*\t42\t6\t\t0\t2147483647\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example firewall\t1",
48
- }, results);
49
- }
50
-
51
- [Fact]
52
- public void CanBuildUsingOutboundFirewall()
53
- {
54
- var folder = TestData.Get(@"TestData\UsingOutboundFirewall");
55
- var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder });
56
-
57
- var results = build.BuildAndQuery(Build, "Wix4FirewallException");
58
- Assert.Equal(new[]
59
- {
60
- "Wix4FirewallException:fex.5c8b_4C0THcQTvn8tpwhoRrgck\texample\t*\t42\t6\t\t0\t2147483647\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example outbound firewall\t2",
47
+ "Wix4FirewallException:ExampleFirewall\texample\t*\t42\t6\t[#filNdJBJmq3UCUIwmXS8x21aAsvqzk]\t0\t2147483647\tfilNdJBJmq3UCUIwmXS8x21aAsvqzk\tAn example firewall\t2",
48
}, results);
49
}
50
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs
+12
-10
@@ -1,14 +1,16 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3
xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall">
4
- <Fragment>
5
- <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6
- <Component>
7
- <File Source="example.txt" />
8
- <fw:FirewallException Id="ExampleFirewall" Description="An example firewall" Name="example" Port="42">
9
- <fw:RemoteAddress Value="*" />
10
- </fw:FirewallException>
11
- </Component>
12
- </ComponentGroup>
13
- </Fragment>
4
+ <Fragment>
5
+ <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6
+ <Component>
7
+ <File Name="fw.exe" Source="example.txt">
8
+ <Shortcut Id="FwShortcut" Directory="INSTALLFOLDER" Name="Firewall" />
9
+ <fw:FirewallException Id="ExampleFirewall" Description="An example firewall" Name="example" Port="42" Outbound="true">
10
+ <fw:RemoteAddress Value="*" />
11
+ </fw:FirewallException>
12
+ </File>
13
+ </Component>
14
+ </ComponentGroup>
15
+ </Fragment>
16
</Wix>
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.en-us.wxl
deleted
-11
@@ -1,11 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-
3
-<!--
4
-This file contains the declaration of all the localizable strings.
5
--->
6
-<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
7
-
8
- <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String>
9
- <String Id="FeatureTitle">MsiPackage</String>
10
-
11
-</WixLocalization>
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.wxs
deleted
-15
@@ -1,15 +0,0 @@
1
-<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2
- <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
3
- <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
4
-
5
- <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
6
- <ComponentGroupRef Id="ProductComponents" />
7
- </Feature>
8
- </Package>
9
-
10
- <Fragment>
11
- <StandardDirectory Id="ProgramFilesFolder">
12
- <Directory Id="INSTALLFOLDER" Name="MsiPackage" />
13
- </StandardDirectory>
14
- </Fragment>
15
-</Wix>
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/PackageComponents.wxs
deleted
-14
@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3
- xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall">
4
- <Fragment>
5
- <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6
- <Component>
7
- <File Source="example.txt" />
8
- <fw:FirewallException Description="An example outbound firewall" Name="example" Port="42" Outbound="yes">
9
- <fw:RemoteAddress Value="*" />
10
- </fw:FirewallException>
11
- </Component>
12
- </ComponentGroup>
13
- </Fragment>
14
-</Wix>
src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/example.txt
deleted
-1
@@ -1 +0,0 @@
1
-This is example.txt.
\ No newline at end of file
src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi
+2
-1
@@ -1,7 +1,8 @@
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
4
- <?include caDecor.wxi ?>
4
+ <?include ..\..\caDecor.wxi ?>
5
+
6
<Fragment>
7
<UIRef Id="WixFirewallErrors" />
8
<UI>
src/ext/Firewall/wixlib/caDecor.wxi
deleted
-39
@@ -1,39 +0,0 @@
1
-<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
-
3
-
4
-<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5
- <?ifdef Prefix ?>
6
- <?undef Prefix ?>
7
- <?endif?>
8
-
9
- <?define Prefix="Wix4" ?>
10
-
11
- <?ifndef platform ?>
12
- <?define platform="x86" ?>
13
- <?endif?>
14
-
15
- <?if $(var.platform)="" ?>
16
- <?undef platform ?>
17
- <?define platform="x86" ?>
18
- <?endif?>
19
-
20
- <?ifdef Suffix ?>
21
- <?undef Suffix ?>
22
- <?endif?>
23
-
24
- <?if $(var.platform)~="x86" ?>
25
- <?define Suffix="_X86" ?>
26
- <?endif?>
27
-
28
- <?if $(var.platform)~="x64" ?>
29
- <?define Suffix="_X64" ?>
30
- <?endif?>
31
-
32
- <?if $(var.platform)~="arm" ?>
33
- <?define Suffix="_A32" ?>
34
- <?endif?>
35
-
36
- <?if $(var.platform)~="arm64" ?>
37
- <?define Suffix="_A64" ?>
38
- <?endif?>
39
-</Include>
src/ext/Firewall/wixlib/firewall.wixproj
+5
-9
@@ -1,26 +1,22 @@
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
-<Project Sdk="WixToolset.Sdk">
3
-
2
+<Project Sdk="WixToolset.Sdk" ToolsVersion="4.0">
3
<PropertyGroup>
4
<OutputType>Library</OutputType>
5
<BindFiles>true</BindFiles>
6
<Cultures>en-us</Cultures>
7
</PropertyGroup>
9
-
8
<ItemGroup>
11
- <BindInputPaths Include="$(OutputPath)x86" BindName='x86' />
12
- <BindInputPaths Include="$(OutputPath)x64" BindName='x64' />
13
- <BindInputPaths Include="$(OutputPath)arm64" BindName='arm64' />
9
+ <BindInputPaths Include="$(OutputPath)x86" BindName="x86" />
10
+ <BindInputPaths Include="$(OutputPath)x64" BindName="x64" />
11
+ <BindInputPaths Include="$(OutputPath)arm64" BindName="arm64" />
12
</ItemGroup>
15
-
13
<ItemGroup>
14
<ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=ARM64" ReferenceOutputAssembly="false" />
15
<ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x86" ReferenceOutputAssembly="false" />
16
<ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x64" ReferenceOutputAssembly="false" />
17
</ItemGroup>
21
-
18
<ItemGroup>
19
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
20
<PackageReference Include="GitInfo" PrivateAssets="All" />
21
</ItemGroup>
26
-</Project>
22
+</Project>
\ No newline at end of file