| 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 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall"> |
| 4 | <Fragment> |
| 5 | <ComponentGroup Id="ProductComponents"> |
| 6 | <ComponentRef Id="FirewallComponent2"/> |
| 7 | </ComponentGroup> |
| 8 | |
| 9 | <Property Id="PORTNUMBER" Secure="yes"> |
| 10 | <RegistrySearch Id="FindPortNumber" Root="HKLM" Key="SOFTWARE\WiX\Tests\$(var.TestGroupName)" Name="PortNumber" Type="raw" /> |
| 11 | </Property> |
| 12 | |
| 13 | <CustomAction Id="SavePortNumberCmdLineValue" Property="CMDLINE_PORTNUMBER" Value="[PORTNUMBER]" Execute="firstSequence" /> |
| 14 | <CustomAction Id="SetPortNumberFromCmdLineValue" Property="PORTNUMBER" Value="[CMDLINE_PORTNUMBER]" Execute="firstSequence" /> |
| 15 | <CustomAction Id="SetPortNumberDefaultValue" Property="PORTNUMBER" Value="9999" Execute="firstSequence" /> |
| 16 | |
| 17 | <InstallExecuteSequence> |
| 18 | <Custom Action="SavePortNumberCmdLineValue" Before="AppSearch" /> |
| 19 | <Custom Action="SetPortNumberFromCmdLineValue" After="AppSearch" Condition="CMDLINE_PORTNUMBER" /> |
| 20 | <Custom Action="SetPortNumberDefaultValue" After="SetPortNumberFromCmdLineValue" Condition="NOT PORTNUMBER" /> |
| 21 | </InstallExecuteSequence> |
| 22 | </Fragment> |
| 23 | |
| 24 | <Fragment> |
| 25 | <Component Id="FirewallComponent2" Guid="528C212C-09C6-47FC-A466-A3799DD04D25" Directory="INSTALLFOLDER" > |
| 26 | <RegistryValue Root="HKLM" Key="SOFTWARE\WiX\Tests\$(var.TestGroupName)" Name="PortNumber" Value="[PORTNUMBER]" Type="string" /> |
| 27 | |
| 28 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" > |
| 29 | <fw:FirewallException Id="FirewallException1" |
| 30 | Port="[PORTNUMBER]" |
| 31 | Description="WiX Toolset firewall exception rule integration test - dynamic app description [PORTNUMBER]" |
| 32 | Name="WiXToolset401 Test - 0003" Scope="localSubnet" /> |
| 33 | </File> |
| 34 | |
| 35 | <fw:FirewallException Id="FirewallException2" |
| 36 | Description="WiX Toolset firewall exception rule integration test - dynamic port description [PORTNUMBER]" |
| 37 | Name="WiXToolset401 Test - 0004" Scope="any" Port="[PORTNUMBER]" /> |
| 38 | |
| 39 | <fw:FirewallException Id="FirewallException3" |
| 40 | Description="WiX Toolset firewall exception rule integration test - dynamic Name [PORTNUMBER]" |
| 41 | Program="%windir%\system32\[PORTNUMBER].exe" |
| 42 | Port="[PORTNUMBER]" |
| 43 | Protocol="udp" Profile="private" |
| 44 | Name="WiXToolset401 Test - 0005 - [PORTNUMBER]" > |
| 45 | <fw:RemoteAddress Value="127.0.0.1" /> |
| 46 | <fw:RemoteAddress Value="192.168.1.1" /> |
| 47 | </fw:FirewallException> |
| 48 | </Component> |
| 49 | </Fragment> |
| 50 | </Wix> |