aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2021-12-12 17:35:18 -0500
committerBob Arnson <github@bobs.org>2021-12-17 09:03:18 -0500
commitee8b4f230241a00d8e3ed145e85fb5d8d3c75914 (patch)
treeee3d67d9452d8e4776ccf024261e1fbb7583f19f /src
parent3542ddd0b007673f3fc338bd53c3b807c3ed7308 (diff)
downloadwix-ee8b4f230241a00d8e3ed145e85fb5d8d3c75914.tar.gz
wix-ee8b4f230241a00d8e3ed145e85fb5d8d3c75914.tar.bz2
wix-ee8b4f230241a00d8e3ed145e85fb5d8d3c75914.zip
Clean up Firewall extension (model for all).
Diffstat (limited to 'src')
-rw-r--r--src/ext/Firewall/Firewall.wixext.sln4
-rw-r--r--src/ext/Firewall/ca/caDecor.h13
-rw-r--r--src/ext/Firewall/ca/precomp.h2
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs17
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs22
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.en-us.wxl11
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.wxs15
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/PackageComponents.wxs14
-rw-r--r--src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/example.txt1
-rw-r--r--src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi3
-rw-r--r--src/ext/Firewall/wixlib/caDecor.wxi39
-rw-r--r--src/ext/Firewall/wixlib/firewall.wixproj14
12 files changed, 24 insertions, 131 deletions
diff --git a/src/ext/Firewall/Firewall.wixext.sln b/src/ext/Firewall/Firewall.wixext.sln
index 02bb8c0f..4061bea9 100644
--- a/src/ext/Firewall/Firewall.wixext.sln
+++ b/src/ext/Firewall/Firewall.wixext.sln
@@ -1,7 +1,7 @@
1 1
2Microsoft Visual Studio Solution File, Format Version 12.00 2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio 15 3# Visual Studio Version 16
4VisualStudioVersion = 15.0.27130.2003 4VisualStudioVersion = 16.0.31624.102
5MinimumVisualStudioVersion = 15.0.26124.0 5MinimumVisualStudioVersion = 15.0.26124.0
6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fwca", "ca\fwca.vcxproj", "{F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}" 6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fwca", "ca\fwca.vcxproj", "{F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}"
7EndProject 7EndProject
diff --git a/src/ext/Firewall/ca/caDecor.h b/src/ext/Firewall/ca/caDecor.h
deleted file mode 100644
index da274650..00000000
--- a/src/ext/Firewall/ca/caDecor.h
+++ /dev/null
@@ -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
diff --git a/src/ext/Firewall/ca/precomp.h b/src/ext/Firewall/ca/precomp.h
index 03845e1e..d8398bb2 100644
--- a/src/ext/Firewall/ca/precomp.h
+++ b/src/ext/Firewall/ca/precomp.h
@@ -16,4 +16,4 @@
16#include "CustomMsiErrors.h" 16#include "CustomMsiErrors.h"
17#include "cost.h" 17#include "cost.h"
18 18
19#include "caDecor.h" 19#include "..\..\caDecor.h"
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs
index ffdc1326..5804675c 100644
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs
+++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs
@@ -25,7 +25,7 @@ namespace WixToolsetTest.Firewall
25 "CustomAction:Wix4RollbackFirewallExceptionsUninstall_X86\t3329\tWix4FWCA_X86\tExecFirewallExceptions\t", 25 "CustomAction:Wix4RollbackFirewallExceptionsUninstall_X86\t3329\tWix4FWCA_X86\tExecFirewallExceptions\t",
26 "CustomAction:Wix4SchedFirewallExceptionsInstall_X86\t1\tWix4FWCA_X86\tSchedFirewallExceptionsInstall\t", 26 "CustomAction:Wix4SchedFirewallExceptionsInstall_X86\t1\tWix4FWCA_X86\tSchedFirewallExceptionsInstall\t",
27 "CustomAction:Wix4SchedFirewallExceptionsUninstall_X86\t1\tWix4FWCA_X86\tSchedFirewallExceptionsUninstall\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); 29 }, results);
30 } 30 }
31 31
@@ -44,20 +44,7 @@ namespace WixToolsetTest.Firewall
44 "CustomAction:Wix4RollbackFirewallExceptionsUninstall_A64\t3329\tWix4FWCA_A64\tExecFirewallExceptions\t", 44 "CustomAction:Wix4RollbackFirewallExceptionsUninstall_A64\t3329\tWix4FWCA_A64\tExecFirewallExceptions\t",
45 "CustomAction:Wix4SchedFirewallExceptionsInstall_A64\t1\tWix4FWCA_A64\tSchedFirewallExceptionsInstall\t", 45 "CustomAction:Wix4SchedFirewallExceptionsInstall_A64\t1\tWix4FWCA_A64\tSchedFirewallExceptionsInstall\t",
46 "CustomAction:Wix4SchedFirewallExceptionsUninstall_A64\t1\tWix4FWCA_A64\tSchedFirewallExceptionsUninstall\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", 47 "Wix4FirewallException:ExampleFirewall\texample\t*\t42\t6\t[#filNdJBJmq3UCUIwmXS8x21aAsvqzk]\t0\t2147483647\tfilNdJBJmq3UCUIwmXS8x21aAsvqzk\tAn example firewall\t2",
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",
61 }, results); 48 }, results);
62 } 49 }
63 50
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs
index 53e75427..6e8e4ebf 100644
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs
+++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingFirewall/PackageComponents.wxs
@@ -1,14 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" 2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall"> 3 xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall">
4 <Fragment> 4 <Fragment>
5 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 5 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6 <Component> 6 <Component>
7 <File Source="example.txt" /> 7 <File Name="fw.exe" Source="example.txt">
8 <fw:FirewallException Id="ExampleFirewall" Description="An example firewall" Name="example" Port="42"> 8 <Shortcut Id="FwShortcut" Directory="INSTALLFOLDER" Name="Firewall" />
9 <fw:RemoteAddress Value="*" /> 9 <fw:FirewallException Id="ExampleFirewall" Description="An example firewall" Name="example" Port="42" Outbound="true">
10 </fw:FirewallException> 10 <fw:RemoteAddress Value="*" />
11 </Component> 11 </fw:FirewallException>
12 </ComponentGroup> 12 </File>
13 </Fragment> 13 </Component>
14 </ComponentGroup>
15 </Fragment>
14</Wix> 16</Wix>
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.en-us.wxl b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.en-us.wxl
deleted file mode 100644
index 38c12ac1..00000000
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.en-us.wxl
+++ /dev/null
@@ -1,11 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4This 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>
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.wxs b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.wxs
deleted file mode 100644
index 411893bc..00000000
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/Package.wxs
+++ /dev/null
@@ -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>
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/PackageComponents.wxs b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/PackageComponents.wxs
deleted file mode 100644
index 8084706e..00000000
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/PackageComponents.wxs
+++ /dev/null
@@ -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>
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/example.txt b/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/example.txt
deleted file mode 100644
index 1b4ffe8a..00000000
--- a/src/ext/Firewall/test/WixToolsetTest.Firewall/TestData/UsingOutboundFirewall/example.txt
+++ /dev/null
@@ -1 +0,0 @@
1This is example.txt. \ No newline at end of file
diff --git a/src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi b/src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi
index 3861bd5d..ae02bcd0 100644
--- a/src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi
+++ b/src/ext/Firewall/wixlib/FirewallExtension_Platform.wxi
@@ -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. --> 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 2
3<Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> 3<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
4 <?include caDecor.wxi ?> 4 <?include ..\..\caDecor.wxi ?>
5
5 <Fragment> 6 <Fragment>
6 <UIRef Id="WixFirewallErrors" /> 7 <UIRef Id="WixFirewallErrors" />
7 <UI> 8 <UI>
diff --git a/src/ext/Firewall/wixlib/caDecor.wxi b/src/ext/Firewall/wixlib/caDecor.wxi
deleted file mode 100644
index b1711518..00000000
--- a/src/ext/Firewall/wixlib/caDecor.wxi
+++ /dev/null
@@ -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>
diff --git a/src/ext/Firewall/wixlib/firewall.wixproj b/src/ext/Firewall/wixlib/firewall.wixproj
index 2230ee0d..51941541 100644
--- a/src/ext/Firewall/wixlib/firewall.wixproj
+++ b/src/ext/Firewall/wixlib/firewall.wixproj
@@ -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. --> 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"> 2<Project Sdk="WixToolset.Sdk" ToolsVersion="4.0">
3
4 <PropertyGroup> 3 <PropertyGroup>
5 <OutputType>Library</OutputType> 4 <OutputType>Library</OutputType>
6 <BindFiles>true</BindFiles> 5 <BindFiles>true</BindFiles>
7 <Cultures>en-us</Cultures> 6 <Cultures>en-us</Cultures>
8 </PropertyGroup> 7 </PropertyGroup>
9
10 <ItemGroup> 8 <ItemGroup>
11 <BindInputPaths Include="$(OutputPath)x86" BindName='x86' /> 9 <BindInputPaths Include="$(OutputPath)x86" BindName="x86" />
12 <BindInputPaths Include="$(OutputPath)x64" BindName='x64' /> 10 <BindInputPaths Include="$(OutputPath)x64" BindName="x64" />
13 <BindInputPaths Include="$(OutputPath)arm64" BindName='arm64' /> 11 <BindInputPaths Include="$(OutputPath)arm64" BindName="arm64" />
14 </ItemGroup> 12 </ItemGroup>
15
16 <ItemGroup> 13 <ItemGroup>
17 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=ARM64" ReferenceOutputAssembly="false" /> 14 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=ARM64" ReferenceOutputAssembly="false" />
18 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x86" ReferenceOutputAssembly="false" /> 15 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x86" ReferenceOutputAssembly="false" />
19 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x64" ReferenceOutputAssembly="false" /> 16 <ProjectReference Include="..\ca\fwca.vcxproj" Properties="Platform=x64" ReferenceOutputAssembly="false" />
20 </ItemGroup> 17 </ItemGroup>
21
22 <ItemGroup> 18 <ItemGroup>
23 <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" /> 19 <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
24 <PackageReference Include="GitInfo" PrivateAssets="All" /> 20 <PackageReference Include="GitInfo" PrivateAssets="All" />
25 </ItemGroup> 21 </ItemGroup>
26</Project> 22</Project> \ No newline at end of file