Skip to content

Commit

Permalink
add cross version test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbednarski committed Sep 29, 2023
1 parent 5e263ef commit bd042f7
Show file tree
Hide file tree
Showing 16 changed files with 448 additions and 1 deletion.
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<packageSourceMapping>
<packageSource key="nuget">
<package pattern="*" />
<package pattern="WixToolset.*" allowedVersions="[,{GitBaseVersionMajor})" />
</packageSource>
<packageSource key="build">
<package pattern="WixToolset.*" />
Expand Down
21 changes: 20 additions & 1 deletion src/internal/SetBuildNumber/SetBuildNumber.proj
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,34 @@
GitThisAssembly;
SetGlobalJson;
SetDirectoryPackagesProps;
SetOverallWixVersions
SetOverallWixVersions;
TransformWixAppConfig
</SetBuildNumbersDependsOn>

<GlobalJsonPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\global.json))</GlobalJsonPath>
<CentralPackageVersionsPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\Directory.Packages.props))</CentralPackageVersionsPath>
<OverallWixVersionsPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\build\wixver.props))</OverallWixVersionsPath>
<GitInfoThisAssemblyFile>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\build\ThisAssembly.WixVer.cs))</GitInfoThisAssemblyFile>
<WixAppConfigTransform>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\wix\wix\app.config))</WixAppConfigTransform>
</PropertyGroup>

<Target Name="TransformWixAppConfig"
Inputs="transform.wix.app.config"
Outputs="$(WixAppConfigTransform)">
<PropertyGroup>
<OverallWixAppConfigHeader></OverallWixAppConfigHeader>
<OverallWixAppConfigText>$([System.IO.File]::ReadAllText(transform.wix.app.config))</OverallWixAppConfigText>
<OverallWixAppConfigText>$(OverallWixAppConfigText.Replace('{GitBaseVersionMajor}', $(GitBaseVersionMajor)))</OverallWixAppConfigText>
</PropertyGroup>

<WriteLinesToFile File="$(WixAppConfigTransform)"
Lines="$(OverallWixAppConfigHeader);$(OverallWixAppConfigText)"
WriteOnlyWhenDifferent="true"
Overwrite="true" />

<Message Importance="high" Text="$(MSBuildProjectName) -&gt; $(WixAppConfigTransform)" />
</Target>

<Target Name="SetGlobalJson"
Inputs="global.json.pp"
Outputs="$(GlobalJsonPath)">
Expand Down
18 changes: 18 additions & 0 deletions src/internal/SetBuildNumber/transform.wix.app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- 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. -->
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WixToolset.Extensibility" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-{GitBaseVersionMajor}.0.0.0" newVersion="{GitBaseVersionMajor}.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WixToolset.Data" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-{GitBaseVersionMajor}.0.0.0" newVersion="{GitBaseVersionMajor}.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- 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. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<SuppressSpecificWarnings>1055;1056</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Module401\Module401.wixproj" />
<ProjectReference Include="..\ModuleCurrent\ModuleCurrent.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Firewall.wixext" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
This file contains the declaration of all the localizable strings.
-->
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">

<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." />
<String Id="FeatureTitle" Value="MsiPackage" />

</WixLocalization>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall">
<Package Name="MsiPackage" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation"
UpgradeCode="41B5F815-E7F6-44E0-B92A-AE95DFF683F9" Compressed="yes" Scope="perMachine">

<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />

<Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
<MergeRef Id="TestMsm1" />
<MergeRef Id="TestMsm2" />
<ComponentRef Id="FirewallComponent1" />
</Feature>
</Package>

<Fragment>
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage">
<Merge Id="TestMsm1" Language="1033" SourceFile="Module401.msm" />
<Merge Id="TestMsm2" Language="1033" SourceFile="ModuleCurrent.msm" />
</Directory>
</StandardDirectory>
</Fragment>

<Fragment>
<Property Id="MSIPORT1" Value="20001" />
<Property Id="MSIPORT2" Value="20002" />

<Component Id="FirewallComponent1" Guid="3E9A6190-3E6B-4BC2-8C84-D89D1549FEBD" Directory="INSTALLFOLDER">
<File Source="$(sys.SOURCEFILEPATH)">
<fw:FirewallException Id="FirewallException1" Description="WiX Toolset firewall exception rule integration test - package app" Name="WiXToolset Test - 0026" Scope="any" Port="[MSIPORT1]" />
</File>
<fw:FirewallException Id="FirewallException2" Description="WiX Toolset firewall exception rule integration test - package port" Name="WiXToolset Test - 0027" Scope="any" Port="[MSIPORT2]" />
</Component>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
This file contains the declaration of all the localizable strings.
-->
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">

<String Id="Manufacturer" Value="Example Company - Module 401" />

</WixLocalization>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- 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. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<OutputType>Module</OutputType>
<SuppressSpecificWarnings>1072</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Firewall.wixext" VersionOverride="4.0.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is test.txt.
36 changes: 36 additions & 0 deletions src/test/msi/TestData/FirewallExtensionTests/Module401/module.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall" >
<Module Id="MergeModule1" Language="1033" Version="1.0.0.0" Guid="4B2C61BF-59F5-453B-98E3-3389F681EA00">
<SummaryInformation Manufacturer="!(loc.Manufacturer)" />

<Property Id="MODULE401PORT1" Value="40101" />
<Property Id="MODULE401PORT2" Value="40102" />
<Property Id="MODULE401PORT3" Value="40103" />
<Property Id="MODULE401PORT4" Value="40104" />

<Directory Id="MergeRedirectFolder">
<Component Id="ModuleComponent1" Guid="257F9283-1334-423C-A7E7-FEE848BCD37F">
<File Id="File1" Name="file1.txt" Source="data/test.txt">
<fw:FirewallException Id="FirewallException1"
Description="WiX Toolset firewall exception rule integration test - module 401 MergeRedirectFolder - app"
Name="WiXToolset401 Test - 0018" Scope="any" Port="[MODULE401PORT1]" />
</File>
<fw:FirewallException Id="FirewallException2"
Description="WiX Toolset firewall exception rule integration test - module 401 MergeRedirectFolder - port"
Name="WiXToolset401 Test - 0019" Scope="any" Port="[MODULE401PORT2]" />
</Component>
</Directory>

<Directory Id="NotTheMergeRedirectFolder">
<Component Id="ModuleComponent2" Guid="48A2D573-0ADB-4010-84E3-96C3D6803E90">
<File Id="File2" Name="file2.txt" Source="data/test.txt">
<fw:FirewallException Id="FirewallException3"
Description="WiX Toolset firewall exception rule integration test - module 401 NotTheMergeRedirectFolder - app"
Name="WiXToolset401 Test - 0020" Scope="any" Port="[MODULE401PORT3]" />
</File>
<fw:FirewallException Id="FirewallException4"
Description="WiX Toolset firewall exception rule integration test - module 401 NotTheMergeRedirectFolder - port"
Name="WiXToolset401 Test - 0021" Scope="any" Port="[MODULE401PORT4]" />
</Component>
</Directory>
</Module>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- 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. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<OutputType>Module</OutputType>
<SuppressSpecificWarnings>1072</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Firewall.wixext" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is test.txt.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
This file contains the declaration of all the localizable strings.
-->
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">

<String Id="Manufacturer" Value="Example Company - Module Current" />

</WixLocalization>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall" >
<Module Id="MergeModule1" Language="1033" Version="1.0.0.0" Guid="44FA5DBE-2413-436E-99B3-A0751D6EB420">
<SummaryInformation Manufacturer="!(loc.Manufacturer)" />

<Property Id="MODULECURRENTPORT1" Value="50001" />
<Property Id="MODULECURRENTPORT2" Value="50002" />
<Property Id="MODULECURRENTPORT3" Value="50003" />
<Property Id="MODULECURRENTPORT4" Value="50004" />

<Directory Id="MergeRedirectFolder">
<Component Id="ModuleComponent1" Guid="EB7B8A63-85C4-4ABB-B9DA-33AECAFE38F7">
<File Id="File1" Name="file1.txt" Source="data/test.txt">
<fw:FirewallException Id="FirewallException1"
Description="WiX Toolset firewall exception rule integration test - module MergeRedirectFolder - app"
Name="WiXToolset Test - 0022" Scope="any" Port="[MODULECURRENTPORT1]" />
</File>
<fw:FirewallException Id="FirewallException2"
Description="WiX Toolset firewall exception rule integration test - module MergeRedirectFolder - port"
Name="WiXToolset Test - 0023" Scope="any" Port="[MODULECURRENTPORT2]" />
</Component>
</Directory>

<Directory Id="NotTheMergeRedirectFolder">
<Component Id="ModuleComponent2" Guid="0C9DD4FC-5A54-4E96-830D-DDE27B3017B5">
<File Id="File2" Name="file2.txt" Source="data/test.txt">
<fw:FirewallException Id="FirewallException3"
Description="WiX Toolset firewall exception rule integration test - module NotTheMergeRedirectFolder - app"
Name="WiXToolset Test - 0024" Scope="any" Port="[MODULECURRENTPORT3]" />
</File>
<fw:FirewallException Id="FirewallException4"
Description="WiX Toolset firewall exception rule integration test - module NotTheMergeRedirectFolder - port"
Name="WiXToolset Test - 0025" Scope="any" Port="[MODULECURRENTPORT4]" />
</Component>
</Directory>
</Module>
</Wix>
Loading

0 comments on commit bd042f7

Please sign in to comment.