Port dependency tests from old repo.

This commit is contained in:
Sean Hall 2021-03-08 16:06:01 -06:00
Родитель 23e3978430
Коммит 99d7440134
74 изменённых файлов: 2206 добавлений и 24 удалений

Просмотреть файл

@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29503.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBA", "src\TestBA\TestBA.csproj", "{04022D35-6D75-49D0-91D2-4208E09DBA6D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestExe", "src\TestExe\TestExe.csproj", "{B038B342-BE42-4951-82A9-7789412CF37F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixTestTools", "src\WixTestTools\WixTestTools.csproj", "{3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BurnE2E", "src\WixToolsetTest.BurnE2E\WixToolsetTest.BurnE2E.csproj", "{FED9D707-E5C3-4867-87B0-FABDB5EB0823}"
@ -31,6 +33,18 @@ Global
{04022D35-6D75-49D0-91D2-4208E09DBA6D}.Release|x64.Build.0 = Release|Any CPU
{04022D35-6D75-49D0-91D2-4208E09DBA6D}.Release|x86.ActiveCfg = Release|Any CPU
{04022D35-6D75-49D0-91D2-4208E09DBA6D}.Release|x86.Build.0 = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|x64.ActiveCfg = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|x64.Build.0 = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|x86.ActiveCfg = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Debug|x86.Build.0 = Debug|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|Any CPU.Build.0 = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|x64.ActiveCfg = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|x64.Build.0 = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|x86.ActiveCfg = Release|Any CPU
{B038B342-BE42-4951-82A9-7789412CF37F}.Release|x86.Build.0 = Release|Any CPU
{3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Debug|x64.ActiveCfg = Debug|Any CPU

Просмотреть файл

@ -1,6 +1,6 @@
{
"msbuild-sdks": {
"WixToolset.Sdk": "4.0.0-build-0194"
"WixToolset.Sdk": "4.0.0-build-0195"
},
"sdk": {
"allowPrerelease": false

Просмотреть файл

@ -5,6 +5,7 @@
<add key="wixtoolset-balutil" value="https://ci.appveyor.com/nuget/wixtoolset-balutil" />
<add key="wixtoolset-bal-wixext" value="https://ci.appveyor.com/nuget/wixtoolset-bal-wixext" />
<add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" />
<add key="wixtoolset-dependency-wixext" value="https://ci.appveyor.com/nuget/wixtoolset-dependency-wixext" />
<add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" />
<add key="wixtoolset-netfx-wixext" value="https://ci.appveyor.com/nuget/wixtoolset-netfx-wixext" />
<add key="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" />

Просмотреть файл

@ -0,0 +1,11 @@
<!-- 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>
<PropertyGroup>
<OutputType>Bundle</OutputType>
<BundleName>BundleA</BundleName>
<UpgradeCode>{6950EF3F-674E-4689-A5C8-80D12AB6E34F}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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">
<Import Project="BundleA.props" />
<PropertyGroup>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<ExePackage Id="ExeA" Cache="no" PerMachine="yes"
DetectCondition="ExeA_Version AND ExeA_Version &gt;= v$(var.Version)"
InstallArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
RepairArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
UninstallArguments="/regd &quot;HKLM\$(var.TestExeRegistryKey),Version&quot;">
<Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" />
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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">
<Import Project="..\BundleAv1\BundleA.props" />
<PropertyGroup>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1_0_1\PackageAv1_0_1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" Name="PackageAv1.msi" SourceFile="$(var.PackageAv1_0_1.TargetPath)" />
<ExePackage Id="ExeA" Cache="no" PerMachine="yes"
DetectCondition="ExeA_Version AND ExeA_Version &gt;= v$(var.Version)"
InstallArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
RepairArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
UninstallArguments="/regd &quot;HKLM\$(var.TestExeRegistryKey),Version&quot;">
<Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" />
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,40 @@
<!-- 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. -->
<?ifndef Version?>
<?define Version = 1.0.0.0?>
<?endif?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
<!-- ProviderKey should be the only thing different from the template -->
<Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" ProviderKey="WiX.$(var.TestGroupName).$(var.BundleName).B">
<Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" />
<Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
<?ifdef SoftwareTag?>
<SoftwareTag Regid="regid.1995-08.com.example" InstallPath="[CommonAppDataFolder]regid.1995-08.com.example" />
<?endif?>
<?ifndef BA?>
<!-- pulled in through the PackageGroupRef below -->
<?elseif $(var.BA) = "TestBAdnc"?>
<!-- pulled in through the PackageGroupRef below -->
<?elseif $(var.BA) = "hyperlinkLicense"?>
<BootstrapperApplication>
<bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" />
</BootstrapperApplication>
<?else?>
<BootstrapperApplicationRef Id="$(var.BA)" />
<?endif?>
<Chain>
<?ifndef BA?>
<PackageGroupRef Id="TestBA" />
<?elseif $(var.BA) = "TestBAdnc"?>
<PackageGroupRef Id="TestBAdnc" />
<?endif?>
<PackageGroupRef Id="BundlePackages" />
</Chain>
</Bundle>
</Wix>

Просмотреть файл

@ -0,0 +1,18 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{228859BB-F917-4F43-A1E0-50C8DCCA92EF}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageB\PackageB.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,22 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" />
<ExePackage Id="ExeA" Cache="no" PerMachine="yes"
DetectCondition="ExeA_Version AND ExeA_Version &gt;= v$(var.Version)"
InstallArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
RepairArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
UninstallArguments="/regd &quot;HKLM\$(var.TestExeRegistryKey),Version&quot;">
<Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" />
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,22 @@
<!-- 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>Bundle</OutputType>
<!-- Same as BundleA -->
<UpgradeCode>{6950EF3F-674E-4689-A5C8-80D12AB6E34F}</UpgradeCode>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PatchA\PatchA.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)">
<SlipstreamMsp Id="PatchA"/>
</MsiPackage>
<MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,22 @@
<!-- 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>Bundle</OutputType>
<!-- Same as BundleA -->
<UpgradeCode>{6950EF3F-674E-4689-A5C8-80D12AB6E34F}</UpgradeCode>
<Version>1.0.1.0</Version>
<SuppressSpecificWarnings>1153</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<ExePackage Id="TestExe" Cache="no" PerMachine="yes" Permanent="yes" InstallArguments="/ec 1603">
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{250B4261-E67F-47E0-AB15-209EF58B769D}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageC\PackageC.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Vital="no" />
<ExePackage Id="ExeA" Cache="no" Vital="no" PerMachine="yes" InstallArguments="/ec 1603"
DetectCondition="ExeA_Version AND ExeA_Version &gt;= v$(var.Version)">
<Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" />
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{EC2B2B3F-E57C-45A4-A0E8-762156DAD99D}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageB\PackageB.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Detect" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,22 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Addon" />
<util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<ExePackage Id="ExeA" Cache="no" PerMachine="yes"
DetectCondition="ExeA_Version AND ExeA_Version &gt;= v$(var.Version)"
InstallArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
RepairArguments="/regw &quot;HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)&quot;"
UninstallArguments="/regd &quot;HKLM\$(var.TestExeRegistryKey),Version&quot;">
<Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" />
<PayloadGroupRef Id="TestExePayloads" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,20 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{022D0F5D-D140-47E1-A19A-5B2CEEE52668}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{8AB16F34-CA65-46E1-BDC0-08F157B4781C}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\BundleF_AddOnA\BundleF_AddOn.wxs" Link="BundleF_AddOn.wxs" />
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,11 @@
<!-- 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>
<PropertyGroup>
<OutputType>Bundle</OutputType>
<BundleName>BundleF_PatchA</BundleName>
<UpgradeCode>{90F41437-BEF8-4ED8-8902-C5DED74E4F6C}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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">
<Import Project="BundleF_PatchA.props" />
<PropertyGroup>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PatchA\PatchA.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<RelatedBundle Id="{EC2B2B3F-E57C-45A4-A0E8-762156DAD99D}" Action="Patch" />
<PackageGroup Id="BundlePackages">
<MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes">
<Provides Key="$(var.TestGroupName)_PatchA" Version="$(var.Version)" />
</MspPackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,17 @@
<!-- 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">
<Import Project="..\BundleF_PatchAv1_0_1\BundleF_PatchA.props" />
<PropertyGroup>
<Version>1.0.2.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PatchA\PatchA.wixproj" />
<ProjectReference Include="..\PatchB\PatchB.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<RelatedBundle Id="{EC2B2B3F-E57C-45A4-A0E8-762156DAD99D}" Action="Patch" />
<PackageGroup Id="BundlePackages">
<MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes">
<Provides Key="$(var.TestGroupName)_PatchA" Version="$(var.Version)" />
</MspPackage>
<MspPackage Id="PatchB" SourceFile="$(var.PatchB.TargetPath)" PerMachine="yes">
<Provides Key="$(var.TestGroupName)_PatchB" Version="$(var.Version)" />
</MspPackage>
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -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>
<PropertyGroup>
<OutputType>Bundle</OutputType>
<UpgradeCode>{C5EA6B61-EF32-48E0-A6F9-08EB6D096843}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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">
<Import Project="BundleH.props" />
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageDv1\PackageDv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,11 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" Visible="yes" Permanent="yes" />
<MsiPackage Id="PackageD" SourceFile="$(var.PackageDv1.TargetPath)" Visible="yes" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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">
<Import Project="..\BundleHv1\BundleH.props" />
<PropertyGroup>
<Version>2.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageDv2\PackageDv2.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,11 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" Visible="yes" Permanent="yes" />
<MsiPackage Id="PackageD" SourceFile="$(var.PackageDv2.TargetPath)" Visible="yes" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{37BDF884-C24A-4C12-9D0C-421FC30747F2}</UpgradeCode>
<Version>1.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageEv1\PackageEv1.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<RelatedBundle Id="{B1617DA6-F824-4B9F-B9B2-A6AFD07A652D}" Action="Detect" />
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<MsiPackage Id="PackageE" SourceFile="$(var.PackageEv1.TargetPath)" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{353B5A34-3B46-424E-8817-25B3D01C8C16}</UpgradeCode>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageEv1_0_1\PackageEv1_0_1.wixproj" />
<ProjectReference Include="..\PatchA\PatchA.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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. -->
<?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<RelatedBundle Id="{B1617DA6-F824-4B9F-B9B2-A6AFD07A652D}" Action="Patch" />
<PackageGroup Id="BundlePackages">
<MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)">
<Provides Key="$(var.TestGroupName)_PatchA" Version="$(var.Version)" />
</MspPackage>
<MsiPackage Id="PackageE" Name="PackageEv1.msi" SourceFile="$(var.PackageEv1_0_1.TargetPath)" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,20 @@
<!-- 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>Bundle</OutputType>
<UpgradeCode>{2EDB07DC-DCCD-419F-AD25-52ABF36B53AE}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageC\PackageC.wixproj" />
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.64" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<PackageGroup Id="BundlePackages">
<MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
<MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Vital="no" />
</PackageGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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>
<PropertyGroup>
<PackageName>PackageA</PackageName>
<ProductComponentsRef>true</ProductComponentsRef>
<ProductCode>{6F171EC9-0774-4974-A8D1-493EF53CAB74}</ProductCode>
<UpgradeCode>{45E933B7-B56A-44D5-8EEC-625EC199085E}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<!-- 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">
<Import Project="PackageA.props" />
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:dep="http://wixtoolset.org/schemas/v4/wxs/dependency">
<Fragment>
<ComponentGroup Id="ProductComponents">
<ComponentRef Id="FileComponent2" />
</ComponentGroup>
</Fragment>
<Fragment>
<Component Id="FileComponent2" Guid="BB609407-F2F4-458D-95F8-BF184D6E8496" Directory="INSTALLFOLDER">
<File Source="$(sys.SOURCEFILEPATH)" />
<Provides Key="WiX.$(var.TestGroupName).A,v1.0" dep:Check="yes" />
</Component>
</Fragment>
</Wix>

Просмотреть файл

@ -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">
<Import Project="..\PackageAv1\PackageA.props" />
<PropertyGroup>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\PackageAv1\ProductComponents.wxs" Link="ProductComponents.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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">
<Import Project="..\PackageAv1\PackageA.props" />
<PropertyGroup>
<Version>1.0.2.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\PackageAv1\ProductComponents.wxs" Link="ProductComponents.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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>
<ProductComponentsRef>true</ProductComponentsRef>
<UpgradeCode>{E26243B0-F1A2-4E74-A82D-25B306908E78}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,18 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:dep="http://wixtoolset.org/schemas/v4/wxs/dependency">
<Fragment>
<ComponentGroup Id="ProductComponents">
<ComponentRef Id="FileComponent2" />
</ComponentGroup>
</Fragment>
<Fragment>
<Component Id="FileComponent2" Guid="A1866388-65B4-4215-A8FB-9A7AADBE4E8E" Directory="INSTALLFOLDER">
<File Source="$(sys.SOURCEFILEPATH)" />
<Provides>
<Requires ProviderKey="WiX.$(var.TestGroupName).A,v1.0" Minimum="1.0.0.0" IncludeMinimum="yes" dep:Enforce="yes" />
</Provides>
</Component>
</Fragment>
</Wix>

Просмотреть файл

@ -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>
<UpgradeCode>{F21201D4-4782-4658-99C9-2E75D51FCFA6}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.77" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,66 @@
<!-- 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. -->
<?ifndef Version?>
<?define Version = 1.0.0.0?>
<?endif?>
<?ifndef ProductCode?>
<?define ProductCode = *?>
<?endif?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:dep="http://wixtoolset.org/schemas/v4/wxs/dependency">
<Package Name="~$(var.TestGroupName) - $(var.PackageName)" Language="1033" Version="$(var.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" ProductCode="$(var.ProductCode)" Scope="perUser">
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<?ifndef CabPrefix?>
<MediaTemplate EmbedCab="yes" />
<?else?>
<MediaTemplate CabinetTemplate="{0}$(var.CabPrefix).cab" />
<?endif?>
<?ifdef SoftwareTag?>
<SoftwareTag Regid="regid.1995-08.com.example" InstallDirectory="LocalAppDataFolder" />
<?endif?>
<PropertyRef Id="TestVersion" />
<Feature Id="Complete" Level="1">
<ComponentRef Id="FileComponent" />
<ComponentRef Id="RegistryComponent" />
<?ifdef var.ProductComponents?>
<ComponentGroupRef Id="ProductComponents" />
<?endif?>
</Feature>
</Package>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder" />
<Directory Id="ProgramFilesFolder">
<Directory Id="WixDir" Name="~Test WiX">
<Directory Id="TestDir" Name="$(var.TestGroupName)">
<Directory Id="INSTALLFOLDER" Name="$(var.PackageName)" />
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<Component Id="FileComponent" Guid="8AEF758B-5890-4490-8485-46BD65616A2B" Directory="INSTALLFOLDER">
<File Source="$(sys.SOURCEFILEPATH)" />
<Provides Key="WiX.$(var.TestGroupName).D,v1.0" dep:Check="yes" />
</Component>
</Fragment>
<Fragment>
<Component Id="RegistryComponent" Directory="INSTALLFOLDER">
<RegistryValue Root="HKCU" Key="Software\WiX\Tests\$(var.TestGroupName)" Name="$(var.PackageName)" Value="!(bind.Property.TestVersion)" Type="string" />
</Component>
</Fragment>
<Fragment>
<Property Id="TestVersion" Value="$(var.Version)" />
</Fragment>
</Wix>

Просмотреть файл

@ -0,0 +1,7 @@
<!-- 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>
<PropertyGroup>
<PackageName>PackageD</PackageName>
<UpgradeCode>{AD82A938-2F54-45B8-A637-B14D8405A959}</UpgradeCode>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<!-- 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">
<Import Project="PackageD.props" />
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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">
<Import Project="..\PackageDv1\PackageD.props" />
<PropertyGroup>
<Version>2.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\PackageDv1\Package.wxs" Link="Package.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,12 @@
<!-- 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>
<PropertyGroup>
<PackageName>PackageE</PackageName>
<ProductComponentsRef>true</ProductComponentsRef>
<ProductCode>{70FA13C7-0338-483F-A256-E5C83750BDE5}</ProductCode>
<UpgradeCode>{212A5698-457E-440F-88CC-98FC49A17378}</UpgradeCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<!-- 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">
<Import Project="PackageE.props" />
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:dep="http://wixtoolset.org/schemas/v4/wxs/dependency">
<Fragment>
<ComponentGroup Id="ProductComponents">
<ComponentRef Id="FileComponent2" />
</ComponentGroup>
</Fragment>
<Fragment>
<Component Id="FileComponent2" Guid="BB609407-F2F4-458D-95F8-BF184D6E8496" Directory="INSTALLFOLDER">
<File Source="$(sys.SOURCEFILEPATH)" />
<Provides Key="WiX.$(var.TestGroupName).E,v1.0" dep:Check="yes" />
</Component>
</Fragment>
</Wix>

Просмотреть файл

@ -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">
<Import Project="..\PackageEv1\PackageE.props" />
<PropertyGroup>
<Version>1.0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\PackageEv1\ProductComponents.wxs" Link="ProductComponents.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,15 @@
<!-- 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>PatchCreation</OutputType>
<TargetExt>.msp</TargetExt>
<SuppressSpecificWarnings>1079</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageAv1_0_1\PackageAv1_0_1.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,22 @@
<!-- 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. -->
<?ifndef Version?>
<?define Version = 1.0.0.0?>
<?endif?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Patch AllowRemoval="yes" Classification="Update" Description="Patch A in test $(var.TestGroupName)" DisplayName="$(var.TestGroupName) - Patch A" Manufacturer="Example Corporation" MinorUpdateTargetRTM="yes">
<Media Id="100" Cabinet="PatchA" EmbedCab="yes">
<PatchBaseline
Id="PatchA"
BaselineFile="$(var.PackageAv1.TargetDir)$(var.PackageAv1.TargetName).wixpdb"
UpdateFile="$(var.PackageAv1_0_1.TargetDir)$(var.PackageAv1_0_1.TargetName).wixpdb"
/>
</Media>
<PatchFamily Id="A" Version="$(var.Version)" Supersede="yes">
<ComponentRef Id="RegistryComponent"/>
<PropertyRef Id="TestVersion"/>
</PatchFamily>
</Patch>
</Wix>

Просмотреть файл

@ -0,0 +1,15 @@
<!-- 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>PatchCreation</OutputType>
<TargetExt>.msp</TargetExt>
<SuppressSpecificWarnings>1079</SuppressSpecificWarnings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
<ProjectReference Include="..\PackageAv1_0_2\PackageAv1_0_2.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Dependency.wixext" Version="4.0.24" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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. -->
<?ifndef Version?>
<?define Version = 1.0.0.0?>
<?endif?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Patch AllowRemoval="yes" Classification="Update" Description="Patch B in test $(var.TestGroupName)" DisplayName="$(var.TestGroupName) - Patch B" Manufacturer="Example Corporation" MinorUpdateTargetRTM="yes">
<Media Id="100" Cabinet="PatchB" EmbedCab="yes">
<PatchBaseline
Id="PatchB"
BaselineFile="$(var.PackageAv1.TargetDir)$(var.PackageAv1.TargetName).wixpdb"
UpdateFile="$(var.PackageAv1_0_2.TargetDir)$(var.PackageAv1_0_2.TargetName).wixpdb"
/>
</Media>
<PatchFamily Id="B" Version="$(var.Version)" Supersede="yes">
<PropertyRef Id="TestVersion"/>
</PatchFamily>
</Patch>
</Wix>

Просмотреть файл

@ -19,7 +19,7 @@
</Feature>
<util:FailWhenDeferred />
<Property Id="WIXFAILWHENDEFERRED" Value="1" />
<Property Id="WIXFAILWHENDEFERRED" Secure="yes" Value="1" />
</Package>
<Fragment>

Просмотреть файл

@ -0,0 +1,9 @@
<!-- 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. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<PayloadGroup Id="TestExePayloads">
<ExePackagePayload SourceFile="!(bindpath.net2x86)\TestExe.exe" />
<Payload SourceFile="!(bindpath.net2x86)\TestExe.exe.config" />
</PayloadGroup>
</Fragment>
</Wix>

Просмотреть файл

@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\TestBA\TestBA.csproj" />
<ProjectReference Include="..\..\..\TestExe\TestExe.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.89" />

Просмотреть файл

@ -5,6 +5,14 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<TestDataProject Include="**\*.wixproj" />
<!-- https://github.com/wixtoolset/issues/issues/6387 -->
<TestDataProject Remove="DependencyTests\BundleC\BundleC.wixproj" />
<TestDataProject Remove="DependencyTests\BundleF_PatchAv1_0_1\BundleF_PatchAv1_0_1.wixproj" />
<TestDataProject Remove="DependencyTests\BundleF_PatchAv1_0_2\BundleF_PatchAv1_0_2.wixproj" />
<TestDataProject Remove="DependencyTests\BundleJ_Patch\BundleJ_Patch.wixproj" />
<TestDataProject Remove="DependencyTests\PatchA\PatchA.wixproj" />
<TestDataProject Remove="DependencyTests\PatchB\PatchB.wixproj" />
</ItemGroup>
<Target Name="Build">

74
src/TestExe/Program.cs Normal file
Просмотреть файл

@ -0,0 +1,74 @@
// 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.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestExe
{
class Program
{
static List<Task> tasks;
static int exitCodeToReturn = 0;
static int Main(string[] args)
{
Usage();
tasks = TaskParser.ParseTasks(args);
foreach (Task t in tasks)
{
// special case for the ExitCodeTask
if (t.GetType() == typeof(ExitCodeTask))
{
exitCodeToReturn = int.Parse(t.data);
}
else
{
t.RunTask();
}
}
Console.WriteLine("Exiting with ExitCode = {0}", exitCodeToReturn);
return exitCodeToReturn;
}
static void Usage()
{
Console.WriteLine(@"TestExe.exe");
Console.WriteLine(@"");
Console.WriteLine(@"TestExe can be passed various switches to define how it will behave and what tasks it will perform.");
Console.WriteLine(@"All switches are optional.");
Console.WriteLine(@"Any # of switches can be combined in any order.");
Console.WriteLine(@"Switches can be specified multiple times.");
Console.WriteLine(@"The order of the switches listed is the order they will be processed.");
Console.WriteLine(@"Info is written to stdout to describe what tasks are being performed as they are executed.");
Console.WriteLine(@"");
Console.WriteLine(@"Usage: TestExe.exe [tasks...]");
Console.WriteLine(@"");
Console.WriteLine(@"");
Console.WriteLine(@"/ec # Exit code to return. Can only be specified once. If not specified, 0 will be returned. Example: “/ec 3010” would return 3010");
Console.WriteLine(@"/s # Milliseconds to sleep before continuing. Example: “/s 5000” would sleep 5 seconds.");
Console.WriteLine(@"/sr #-# Random range of Milliseconds to sleep before continuing. Example: “/sr 5000-10000” would sleep between 5-10 seconds.");
Console.WriteLine(@"/log filename Create a log file called filename. Contents of the log are static text. Example: “/log %temp%\test.log” would create a %temp%\test.log file.");
Console.WriteLine(@"/Pinfo filename Create an xml file containing information about the process: PID, start time, user running the process, etc.");
Console.WriteLine(@"/fe filename Wait for a file to exist before continuing. Example: “/fe %temp%\cache\file.msi” would wait until %temp%\cache\file.msi exists.");
Console.WriteLine(@"/regw regkey,name,type,value (Re)writes a registry key with the specified value");
Console.WriteLine(@"/regd regkey,[name] Deletes registry key name or key and all of its children (subkeys and values)");
Console.WriteLine(@"");
Console.WriteLine(@"Example: ");
Console.WriteLine(@"");
Console.WriteLine(@"TestExe.exe /ec 1603 /Pinfo %temp%\Pinfo1.xml /s 1000 /log %temp%\log1.log /sr 5000-10000 /log %temp%\log2.log");
Console.WriteLine(@"");
Console.WriteLine(@"This would result in the following execution:");
Console.WriteLine(@" - Create an xml file with the current process info in it.");
Console.WriteLine(@" - Sleep 1 seconds");
Console.WriteLine(@" - Create log1.log");
Console.WriteLine(@" - Sleep between 5-10 seconds");
Console.WriteLine(@" - Create log2.log");
Console.WriteLine(@" - Exit with 1603");
Console.WriteLine(@"");
}
}
}

471
src/TestExe/Task.cs Normal file
Просмотреть файл

@ -0,0 +1,471 @@
// 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.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management;
using System.Text;
using Microsoft.Win32;
namespace TestExe
{
public abstract class Task
{
public string data;
public Task(string Data)
{
data = Data;
}
public abstract void RunTask();
}
public class ExitCodeTask : Task
{
public ExitCodeTask(string Data) : base(Data) { }
public override void RunTask()
{
// this task does nothing. Just stores data about what exit code to return.
}
}
public class SleepTask : Task
{
public SleepTask(string Data) : base(Data) { }
public override void RunTask()
{
int milliseconds = int.Parse(this.data);
Console.WriteLine("Starting to sleep for {0} milliseconds", milliseconds);
System.Threading.Thread.Sleep(milliseconds);
}
}
public class SleepRandomTask : Task
{
public SleepRandomTask(string Data) : base(Data) { }
public override void RunTask()
{
int low = int.Parse(data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[0]);
int high = int.Parse(data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[1]);
Random r = new Random();
int milliseconds = r.Next(high - low) + low;
Console.WriteLine("Starting to sleep for {0} milliseconds", milliseconds);
System.Threading.Thread.Sleep(milliseconds);
}
}
public class LogTask : Task
{
string[] argsUsed;
public LogTask(string Data, string[] args)
: base(Data)
{
argsUsed = args;
}
public override void RunTask()
{
string logFile = "";
string argsUsedString = "";
foreach (string a in argsUsed)
{
argsUsedString += a + " ";
}
try
{
logFile = System.Environment.ExpandEnvironmentVariables(data);
Console.WriteLine("creating log file: " + logFile);
StreamWriter textFile = File.CreateText(logFile);
textFile.WriteLine("This is a log file created by TestExe.exe");
textFile.WriteLine("Args used: " + argsUsedString);
textFile.Close();
}
catch
{
Console.WriteLine("creating a log file failed for: {0}", logFile);
}
}
}
public class ProcessInfoTask : Task
{
public ProcessInfoTask(string Data) : base(Data) { }
public override void RunTask()
{
try
{
string processInfoXml = "";
// Get information about the process and who is running it
Process thisProc = Process.GetCurrentProcess();
string username = thisProc.StartInfo.EnvironmentVariables["username"].ToString();
int parentProcId = GetParentProcess(thisProc.Id);
Process parentProc = Process.GetProcessById(parentProcId);
string parentUsername = parentProc.StartInfo.EnvironmentVariables["username"].ToString();
int grandparentProcId = GetParentProcess(parentProc.Id);
Process grandparentProc = Process.GetProcessById(grandparentProcId);
string grandparentUsername = grandparentProc.StartInfo.EnvironmentVariables["username"].ToString();
processInfoXml += "<ProcessInfo>";
processInfoXml += " <ProcessName>" + thisProc.ProcessName + "</ProcessName>";
processInfoXml += " <Id>" + thisProc.Id.ToString() + "</Id>";
processInfoXml += " <SessionId>" + thisProc.SessionId.ToString() + "</SessionId>";
processInfoXml += " <MachineName>" + thisProc.MachineName + "</MachineName>";
// this stuff isn't set since we didn't start the process and tell it what to use. So don't bother
//processInfoXml += " <StartInfo>";
//processInfoXml += " <FileName>" + thisProc.StartInfo.FileName + "</FileName>";
//processInfoXml += " <UserName>" + thisProc.StartInfo.UserName + "</UserName>";
//processInfoXml += " <WorkingDirectory>" + thisProc.StartInfo.WorkingDirectory + "</WorkingDirectory>";
//processInfoXml += " <Arguments>" + thisProc.StartInfo.Arguments + "</Arguments>";
//processInfoXml += " </StartInfo>";
processInfoXml += " <StartTime>" + thisProc.StartTime.ToString() + "</StartTime>";
processInfoXml += " <Username>" + username + "</Username>";
processInfoXml += " <ParentProcess>";
processInfoXml += " <ProcessName>" + parentProc.ProcessName + "</ProcessName>";
processInfoXml += " <Id>" + parentProc.Id.ToString() + "</Id>";
processInfoXml += " <StartTime>" + parentProc.StartTime.ToString() + "</StartTime>";
processInfoXml += " <Username>" + parentUsername + "</Username>";
processInfoXml += " </ParentProcess>";
processInfoXml += " <GrandparentProcess>";
processInfoXml += " <ProcessName>" + grandparentProc.ProcessName + "</ProcessName>";
processInfoXml += " <Id>" + grandparentProc.Id.ToString() + "</Id>";
processInfoXml += " <StartTime>" + grandparentProc.StartTime.ToString() + "</StartTime>";
processInfoXml += " <Username>" + grandparentUsername + "</Username>";
processInfoXml += " </GrandparentProcess>";
processInfoXml += "</ProcessInfo>";
string logFile = System.Environment.ExpandEnvironmentVariables(data);
Console.WriteLine("Creating Process Info data file: " + logFile);
StreamWriter textFile = File.CreateText(logFile);
textFile.WriteLine(processInfoXml);
textFile.Close();
}
catch (Exception eX)
{
Console.WriteLine("Creating Process Info data file failed");
Console.WriteLine(eX.Message);
}
}
private static int GetParentProcess(int Id)
{
int parentPid = 0;
using (ManagementObject mo = new ManagementObject("win32_process.handle='" + Id.ToString() + "'"))
{
mo.Get();
parentPid = Convert.ToInt32(mo["ParentProcessId"]);
}
return parentPid;
}
}
public class FileExistsTask : Task
{
public FileExistsTask(string Data) : base(Data) { }
public override void RunTask()
{
string fileToExist = System.Environment.ExpandEnvironmentVariables(data);
if (!String.IsNullOrEmpty(fileToExist))
{
Console.WriteLine("Waiting for this file to exist: \"" + fileToExist + "\"");
while (!System.IO.File.Exists(fileToExist))
{
System.Threading.Thread.Sleep(250);
}
Console.WriteLine("Found: \"" + fileToExist + "\"");
}
}
}
/// <summary>
/// Task class that will create a registry key and write a name and value in it
/// </summary>
public class RegistryWriterTask : Task
{
private string hive;
private string keyPath;
private string[] keyPathArray;
private string name;
private RegistryValueKind regValueKind;
private object value;
public RegistryWriterTask(string Data) : base(Data) { }
public override void RunTask()
{
if (parseRegKeyNameTypeValue(System.Environment.ExpandEnvironmentVariables(data)))
{
RegistryKey rk = Registry.LocalMachine;
if (hive == "HKCU") rk = Microsoft.Win32.Registry.CurrentUser;
if (hive == "HKCC") rk = Microsoft.Win32.Registry.CurrentConfig;
if (hive == "HKLM") rk = Microsoft.Win32.Registry.LocalMachine;
foreach (string key in keyPathArray)
{
rk = rk.CreateSubKey(key, RegistryKeyPermissionCheck.ReadWriteSubTree);
}
rk.SetValue(name, value, regValueKind);
Console.WriteLine("Created registry key: '{0}' name: '{1}' value: '{2}' of type: '{3}'",
hive + "\\" + keyPath,
name,
value.ToString(),
regValueKind.ToString());
}
else
{
Console.WriteLine("Unable to write registry key.");
}
}
private bool parseRegKeyNameTypeValue(string delimittedData)
{
string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None);
if (splitString.Length != 4)
{
Console.WriteLine("Invalid regkey. Unable to parse key,name,type,value from: \"" + delimittedData + "\"");
return false;
}
else
{
keyPath = splitString[0];
name = splitString[1];
string datatype = splitString[2];
if (datatype == "DWord")
{
value = UInt32.Parse(splitString[3]);
}
else if (datatype == "QWord")
{
value = UInt64.Parse(splitString[3]);
}
else
{
value = splitString[3];
}
if (keyPath.ToUpper().StartsWith("HKLM\\"))
{
hive = "HKLM";
keyPath = keyPath.Replace("HKLM\\", "");
}
else if (keyPath.ToUpper().StartsWith("HKCC\\"))
{
hive = "HKCC";
keyPath = keyPath.Replace("HKCC\\", "");
}
else if (keyPath.ToUpper().StartsWith("HKCU\\"))
{
hive = "HKCU";
keyPath = keyPath.Replace("HKCU\\", "");
}
else
{
Console.WriteLine("Invalid regkey. Unable to determin hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]");
return false;
}
keyPathArray = keyPath.Split(new string[] { "\\" }, StringSplitOptions.None);
try
{
regValueKind = (RegistryValueKind)System.Enum.Parse(typeof(RegistryValueKind), datatype);
}
catch (Exception ex)
{
Console.WriteLine("Invalid datatype. It must be: String, DWord, or QWord (case sensitive)");
Console.WriteLine(ex.Message);
return false;
}
}
return true;
}
}
/// <summary>
/// Task class that will delete a registry key value or registry key and all of its children
/// </summary>
public class RegistryDeleterTask : Task
{
private string hive;
private string keyPath;
private string[] keyPathArray;
private string name;
public RegistryDeleterTask(string Data) : base(Data) { }
public override void RunTask()
{
if (parseRegKeyName(System.Environment.ExpandEnvironmentVariables(data)))
{
try
{
RegistryKey rk = Registry.LocalMachine;
if (hive == "HKCU") rk = Microsoft.Win32.Registry.CurrentUser;
if (hive == "HKCC") rk = Microsoft.Win32.Registry.CurrentConfig;
if (hive == "HKLM") rk = Microsoft.Win32.Registry.LocalMachine;
RegistryKey rkParent = null;
foreach (string key in keyPathArray)
{
rkParent = rk;
rk = rk.OpenSubKey(key, true);
}
if (String.IsNullOrEmpty(name))
{
// delete the key and all of its children
string subkeyToDelete = keyPathArray[keyPathArray.Length - 1];
rkParent.DeleteSubKeyTree(subkeyToDelete);
Console.WriteLine("Deleted registry key: '{0}'", hive + "\\" + keyPath);
}
else
{
// just delete this value
rk.DeleteValue(name);
Console.WriteLine("Deleted registry key: '{0}' name: '{1}'", hive + "\\" + keyPath, name);
}
}
catch (Exception ex)
{
Console.WriteLine("Unable to delete registry key: '{0}'", hive + "\\" + keyPath);
Console.WriteLine(ex.Message);
}
}
else
{
Console.WriteLine("Unable to delete registry key.");
}
}
private bool parseRegKeyName(string delimittedData)
{
string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None);
if (splitString.Length > 2)
{
Console.WriteLine("Unable to parse registry key and name.");
return false;
}
keyPath = splitString[0];
if (splitString.Length == 2)
{
name = splitString[1];
}
if (keyPath.ToUpper().StartsWith("HKLM\\"))
{
hive = "HKLM";
keyPath = keyPath.Replace("HKLM\\", "");
}
else if (keyPath.ToUpper().StartsWith("HKCC\\"))
{
hive = "HKCC";
keyPath = keyPath.Replace("HKCC\\", "");
}
else if (keyPath.ToUpper().StartsWith("HKCU\\"))
{
hive = "HKCU";
keyPath = keyPath.Replace("HKCU\\", "");
}
else
{
Console.WriteLine("Invalid regkey. Unable to determine hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]");
return false;
}
keyPathArray = keyPath.Split(new string[] { "\\" }, StringSplitOptions.None);
return true;
}
}
public class TaskParser
{
public static List<Task> ParseTasks(string[] args)
{
List<Task> tasks = new List<Task>();
try
{
// for invalid args. return empty list
if (args.Length % 2 == 0)
{
Task t;
for (int i = 0; i < args.Length; i += 2)
{
switch (args[i].ToLower())
{
case "/ec":
t = new ExitCodeTask(args[i + 1]);
tasks.Add(t);
break;
case "/s":
t = new SleepTask(args[i + 1]);
tasks.Add(t);
break;
case "/sr":
t = new SleepRandomTask(args[i + 1]);
tasks.Add(t);
break;
case "/log":
t = new LogTask(args[i + 1], args);
tasks.Add(t);
break;
case "/pinfo":
t = new ProcessInfoTask(args[i + 1]);
tasks.Add(t);
break;
case "/fe":
t = new FileExistsTask(args[i + 1]);
tasks.Add(t);
break;
case "/regw":
t = new RegistryWriterTask(args[i + 1]);
tasks.Add(t);
break;
case "/regd":
t = new RegistryDeleterTask(args[i + 1]);
tasks.Add(t);
break;
default:
Console.WriteLine("Error: Invalid switch specified.");
return new List<Task>();
}
}
}
}
catch
{
Console.WriteLine("Error: Invalid switch data specified. Couldn't parse the data.");
return new List<Task>();
}
return tasks;
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
<?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. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net35</TargetFrameworks>
<AssemblyName>TestExe</AssemblyName>
<RootNamespace>TestExe</RootNamespace>
<OutputType>Exe</OutputType>
<DebugType>embedded</DebugType>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Management" />
</ItemGroup>
</Project>

10
src/TestExe/app.config Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<?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>
<startup>
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>

Просмотреть файл

@ -12,12 +12,15 @@ namespace WixTestTools
{
this.Bundle = Path.Combine(testContext.TestDataFolder, $"{name}.exe");
this.BundlePdb = Path.Combine(testContext.TestDataFolder, $"{name}.wixpdb");
this.TestContext = testContext;
this.TestGroupName = testContext.TestGroupName;
this.TestName = testContext.TestName;
}
public string Bundle { get; }
private WixTestContext TestContext { get; }
public string TestGroupName { get; }
public string TestName { get; }

Просмотреть файл

@ -7,7 +7,8 @@ namespace WixTestTools
public class BundleRegistration
{
public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
public const string BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH = "BundleCachePath";
public const string BURN_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE = "BundleAddonCode";
public const string BURN_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE = "BundleDetectCode";
@ -89,13 +90,22 @@ namespace WixTestTools
public static bool TryGetPerMachineBundleRegistrationById(string bundleId, out BundleRegistration registration)
{
var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY}\\{bundleId}";
var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE}\\{bundleId}";
using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath);
var success = registrationKey != null;
registration = success ? GetBundleRegistration(registrationKey) : null;
return success;
}
public static bool TryGetPerUserBundleRegistrationById(string bundleId, out BundleRegistration registration)
{
var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY}\\{bundleId}";
using var registrationKey = Registry.CurrentUser.OpenSubKey(registrationKeyPath);
var success = registrationKey != null;
registration = success ? GetBundleRegistration(registrationKey) : null;
return success;
}
private static BundleRegistration GetBundleRegistration(RegistryKey idKey)
{
var registration = new BundleRegistration();

Просмотреть файл

@ -33,31 +33,46 @@ namespace WixTestTools
return this.BundleSymbol;
}
public string GetPackageCachePathForCacheId(string cacheId)
public string GetPackageCachePathForCacheId(string cacheId, bool perMachine)
{
using var policyKey = Registry.LocalMachine.OpenSubKey(FULL_BURN_POLICY_REGISTRY_PATH);
var redirectedCachePath = policyKey?.GetValue("PackageCache") as string;
var cachePath = redirectedCachePath ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), PACKAGE_CACHE_FOLDER_NAME);
string cachePath;
if (perMachine)
{
using var policyKey = Registry.LocalMachine.OpenSubKey(FULL_BURN_POLICY_REGISTRY_PATH);
var redirectedCachePath = policyKey?.GetValue("PackageCache") as string;
cachePath = redirectedCachePath ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), PACKAGE_CACHE_FOLDER_NAME);
}
else
{
cachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), PACKAGE_CACHE_FOLDER_NAME);
}
return Path.Combine(cachePath, cacheId);
}
public string GetExpectedCachedBundlePath()
{
var bundleSymbol = this.GetBundleSymbol();
var cachePath = this.GetPackageCachePathForCacheId(bundleSymbol.BundleId);
var cachePath = this.GetPackageCachePathForCacheId(bundleSymbol.BundleId, bundleSymbol.PerMachine);
return Path.Combine(cachePath, Path.GetFileName(this.Bundle));
}
public bool TryGetPerMachineRegistration(out BundleRegistration registration)
public bool TryGetRegistration(out BundleRegistration registration)
{
var bundleSymbol = this.GetBundleSymbol();
var bundleId = bundleSymbol.BundleId;
return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, out registration);
if (bundleSymbol.PerMachine)
{
return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, out registration);
}
else
{
return BundleRegistration.TryGetPerUserBundleRegistrationById(bundleId, out registration);
}
}
public string VerifyRegisteredAndInPackageCache()
{
Assert.True(this.TryGetPerMachineRegistration(out var registration));
Assert.True(this.TryGetRegistration(out var registration));
Assert.NotNull(registration.CachePath);
Assert.True(File.Exists(registration.CachePath));
@ -76,7 +91,7 @@ namespace WixTestTools
public void VerifyUnregisteredAndRemovedFromPackageCache(string cachedBundlePath)
{
Assert.False(this.TryGetPerMachineRegistration(out _));
Assert.False(this.TryGetRegistration(out _));
Assert.False(File.Exists(cachedBundlePath));
}
@ -86,11 +101,41 @@ namespace WixTestTools
var intermediate = Intermediate.Load(wixOutput);
var section = intermediate.Sections.Single();
var packageSymbol = section.Symbols.OfType<WixBundlePackageSymbol>().Single(p => p.Id.Id == packageId);
var cachePath = this.GetPackageCachePathForCacheId(packageSymbol.CacheId);
var cachePath = this.GetPackageCachePathForCacheId(packageSymbol.CacheId, packageSymbol.PerMachine == YesNoDefaultType.Yes);
if (Directory.Exists(cachePath))
{
Directory.Delete(cachePath, true);
}
}
public void VerifyPackageIsCached(string packageId)
{
using var wixOutput = WixOutput.Read(this.BundlePdb);
var intermediate = Intermediate.Load(wixOutput);
var section = intermediate.Sections.Single();
var packageSymbol = section.Symbols.OfType<WixBundlePackageSymbol>().Single(p => p.Id.Id == packageId);
var cachePath = this.GetPackageCachePathForCacheId(packageSymbol.CacheId, packageSymbol.PerMachine == YesNoDefaultType.Yes);
Assert.True(Directory.Exists(cachePath));
}
public void VerifyExeTestRegistryRootDeleted(string name)
{
using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(name);
if (testRegistryRoot != null)
{
var actualValue = testRegistryRoot.GetValue("Version") as string;
Assert.Null(actualValue);
}
}
public void VerifyExeTestRegistryValue(string name, string expectedValue)
{
using (var root = this.TestContext.GetTestRegistryRoot(name))
{
Assert.NotNull(root);
var actualValue = root.GetValue("Version") as string;
Assert.Equal(expectedValue, actualValue);
}
}
}
}

Просмотреть файл

@ -2,6 +2,7 @@
namespace WixTestTools
{
using System;
using WixToolset.Dtf.WindowsInstaller;
public class MsiUtilities
@ -23,5 +24,24 @@ namespace WixTestTools
}
return false;
}
/// <summary>
/// Return true if it finds the given productcode in system with the specified version otherwise it returns false
/// </summary>
/// <param name="prodCode"></param>
/// <param name="prodVersion"></param>
/// <returns></returns>
public static bool IsProductInstalledWithVersion(string prodCode, Version prodVersion)
{
//look in all user's products (both per-machine and per-user)
foreach (ProductInstallation product in ProductInstallation.GetProducts(null, "s-1-1-0", UserContexts.All))
{
if (product.ProductCode == prodCode && product.ProductVersion == prodVersion)
{
return true;
}
}
return false;
}
}
}

Просмотреть файл

@ -58,6 +58,13 @@ namespace WixTestTools
Assert.Equal(installed, MsiUtilities.IsProductInstalled(productCode));
}
public void VerifyInstalledWithVersion(bool installed)
{
var productCode = this.GetProperty("ProductCode");
Version prodVersion = new Version(this.GetProperty("ProductVersion"));
Assert.Equal(installed, MsiUtilities.IsProductInstalledWithVersion(productCode, prodVersion));
}
public void DeleteTestRegistryValue(string name)
{
using (var root = this.TestContext.GetTestRegistryRoot())

Просмотреть файл

@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageReference Include="WixBuildTools.TestSupport" Version="4.0.48" />
<PackageReference Include="WixToolset.Data" Version="4.0.196" />
<PackageReference Include="WixToolset.Data" Version="4.0.198" />
<PackageReference Include="WixToolset.Mba.Core" Version="4.0.51" />
</ItemGroup>

Просмотреть файл

@ -2,6 +2,9 @@
namespace WixToolsetTest.BurnE2E
{
using System;
using WixTestTools;
using WixToolset.Mba.Core;
using Xunit;
using Xunit.Abstractions;
@ -12,26 +15,593 @@ namespace WixToolsetTest.BurnE2E
[Fact]
public void CanKeepSameExactPackageAfterUpgradingBundle()
{
var packageA = this.CreatePackageInstaller("PackageF");
var bundleAv1 = this.CreateBundleInstaller("BundleKv1");
var bundleAv2 = this.CreateBundleInstaller("BundleKv2");
var packageF = this.CreatePackageInstaller("PackageF");
var bundleKv1 = this.CreateBundleInstaller("BundleKv1");
var bundleKv2 = this.CreateBundleInstaller("BundleKv2");
packageF.VerifyInstalled(false);
bundleKv1.Install();
bundleKv1.VerifyRegisteredAndInPackageCache();
packageF.VerifyInstalled(true);
bundleKv2.Install();
bundleKv2.VerifyRegisteredAndInPackageCache();
bundleKv1.VerifyUnregisteredAndRemovedFromPackageCache();
packageF.VerifyInstalled(true);
bundleKv2.VerifyPackageIsCached("PackageF");
bundleKv2.Uninstall();
bundleKv2.VerifyUnregisteredAndRemovedFromPackageCache();
packageF.VerifyInstalled(false);
}
[Fact (Skip = "https://github.com/wixtoolset/issues/issues/6387")]
public void CanKeepSameExactPackageAfterUpgradingBundleWithSlipstreamedPatch()
{
var originalVersion = "1.0.0.0";
var patchedVersion = "1.0.1.0";
var testRegistryValue = "PackageA";
var testRegistryValueExe = "ExeA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var bundleA = this.CreateBundleInstaller("BundleAv1");
var bundleC = this.CreateBundleInstaller("BundleC");
packageA.VerifyInstalled(false);
bundleA.Install();
bundleA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, originalVersion);
// Verify https://github.com/wixtoolset/issues/issues/3294 - Uninstalling bundle registers a dependency on a package
bundleC.Install();
bundleC.VerifyRegisteredAndInPackageCache();
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion);
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
// Verify https://github.com/wixtoolset/issues/issues/2915 - Update bundle removes previously cached MSIs
bundleC.Repair();
bundleC.Uninstall();
bundleC.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
}
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/exea")]
public void CanKeepUpgradedPackageAfterUninstallUpgradedBundle()
{
var testRegistryValueExe = "ExeA";
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
var packageAv101 = this.CreatePackageInstaller("PackageAv1_0_1");
var packageB = this.CreatePackageInstaller("PackageB");
var bundleAv1 = this.CreateBundleInstaller("BundleAv1");
var bundleAv101 = this.CreateBundleInstaller("BundleAv1_0_1");
var bundleB = this.CreateBundleInstaller("BundleB");
packageAv1.VerifyInstalledWithVersion(false);
packageAv101.VerifyInstalledWithVersion(false);
packageB.VerifyInstalled(false);
bundleAv1.Install();
bundleAv1.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageAv1.VerifyInstalledWithVersion(true);
bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
bundleAv2.Install();
bundleAv2.VerifyRegisteredAndInPackageCache();
bundleB.Install();
bundleB.VerifyRegisteredAndInPackageCache();
packageAv1.VerifyInstalledWithVersion(true);
bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(true);
bundleAv101.Install();
bundleAv101.VerifyRegisteredAndInPackageCache();
bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache();
packageAv1.VerifyInstalledWithVersion(false);
packageAv101.VerifyInstalledWithVersion(true);
bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.1.0");
bundleAv101.Uninstall();
bundleAv101.VerifyUnregisteredAndRemovedFromPackageCache();
packageAv101.VerifyInstalledWithVersion(true);
bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.1.0");
}
#if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/6387")]
#else
[Fact(Skip = "addon/patch related bundle")]
#endif
public void CanMinorUpgradeDependencyPackageFromPatchBundle()
{
var originalVersion = "1.0.0.0";
var patchedVersion = "1.0.1.0";
var testRegistryValue = "PackageA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageBv1 = this.CreatePackageInstaller("PackageBv1");
var packageBv101 = this.CreatePackageInstaller("PackageBv1_0_1");
var bundleJ = this.CreateBundleInstaller("BundleJ");
var bundleJ_Patch = this.CreateBundleInstaller("BundleJ_Patch");
packageA.VerifyInstalled(false);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(false);
bundleJ.Install();
bundleJ.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion);
packageBv1.VerifyInstalled(true);
bundleJ_Patch.Install();
bundleJ_Patch.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(true);
bundleJ.Uninstall();
bundleJ.VerifyUnregisteredAndRemovedFromPackageCache();
bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(false);
}
#if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/6387")]
#else
[Fact(Skip = "addon/patch related bundle")]
#endif
public void CanMinorUpgradeDependencyPackageFromPatchBundleThenUninstallToRestoreBase()
{
var originalVersion = "1.0.0.0";
var patchedVersion = "1.0.1.0";
var testRegistryValue = "PackageA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageBv1 = this.CreatePackageInstaller("PackageBv1");
var packageBv101 = this.CreatePackageInstaller("PackageBv1_0_1");
var bundleJ = this.CreateBundleInstaller("BundleJ");
var bundleJ_Patch = this.CreateBundleInstaller("BundleJ_Patch");
packageA.VerifyInstalled(false);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(false);
bundleJ.Install();
bundleJ.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion);
packageBv1.VerifyInstalled(true);
bundleJ_Patch.Install();
bundleJ_Patch.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(true);
bundleJ_Patch.Uninstall();
bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion);
packageBv1.VerifyInstalled(true);
packageBv101.VerifyInstalled(false);
bundleJ.Uninstall();
bundleJ.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageBv1.VerifyInstalled(false);
packageBv101.VerifyInstalled(false);
}
#if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES
[Fact]
#else
[Fact(Skip = "addon/patch related bundle")]
#endif
public void CanUninstallBaseWithAddOnsWhenAllSharePackages()
{
var testRegistryValueExe = "ExeA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageB = this.CreatePackageInstaller("PackageB");
var bundleF = this.CreateBundleInstaller("BundleF");
var bundleF_AddOnA = this.CreateBundleInstaller("BundleF_AddOnA");
var bundleF_AddOnB = this.CreateBundleInstaller("BundleF_AddOnB");
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
bundleF.Install();
bundleF.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageB.VerifyInstalled(true);
bundleF_AddOnA.Install();
bundleF_AddOnA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(true);
bundleF_AddOnB.Install();
bundleF_AddOnB.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(true);
bundleF.Uninstall();
bundleF.VerifyUnregisteredAndRemovedFromPackageCache();
bundleF_AddOnA.VerifyUnregisteredAndRemovedFromPackageCache();
bundleF_AddOnB.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
bundleF.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
packageB.VerifyInstalled(false);
}
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/6388")]
public void CanUninstallDependencyPackagesWithBundlesUninstalledInFifoOrder()
{
var testRegistryValueExe = "ExeA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageB = this.CreatePackageInstaller("PackageB");
var bundleA = this.CreateBundleInstaller("BundleAv1");
var bundleB = this.CreateBundleInstaller("BundleB");
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
bundleA.Install();
bundleA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
bundleB.Install();
bundleB.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(true);
bundleA.Uninstall();
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(true);
bundleB.Uninstall();
bundleB.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
packageB.VerifyInstalled(false);
}
[Fact]
public void CanUninstallDependencyPackagesWithBundlesUninstalledInReverseOrder()
{
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageB = this.CreatePackageInstaller("PackageB");
var bundleA = this.CreateBundleInstaller("BundleAv1");
var bundleB = this.CreateBundleInstaller("BundleB");
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
bundleA.Install();
bundleA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleAv2.Uninstall();
bundleAv2.VerifyUnregisteredAndRemovedFromPackageCache();
bundleB.Install();
bundleB.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageB.VerifyInstalled(true);
bundleB.Uninstall();
bundleB.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
bundleA.Uninstall();
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
}
#if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/6387")]
#else
[Fact(Skip = "addon/patch related bundle")]
#endif
public void CanUpgradePatchBundleWithAdditionalPatch()
{
var originalVersion = "1.0.0.0";
var patchedVersion = "1.0.1.0";
var patchedVersion2 = "1.0.2.0";
var testRegistryValue = "PackageA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageB = this.CreatePackageInstaller("PackageBv1");
var bundleF = this.CreateBundleInstaller("BundleJ");
var bundleF_PatchAv101 = this.CreateBundleInstaller("BundleF_PatchAv1_0_1");
var bundleF_PatchAv102 = this.CreateBundleInstaller("BundleF_PatchAv1_0_2");
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
bundleF.Install();
bundleF.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion);
packageB.VerifyInstalled(true);
bundleF_PatchAv101.Install();
bundleF_PatchAv101.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion);
packageB.VerifyInstalled(false);
bundleF_PatchAv102.Install();
bundleF_PatchAv102.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion2);
packageB.VerifyInstalled(false);
bundleF.Uninstall();
bundleF.VerifyUnregisteredAndRemovedFromPackageCache();
bundleF_PatchAv101.VerifyUnregisteredAndRemovedFromPackageCache();
bundleF_PatchAv102.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
}
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/6388")]
public void DoesntRegisterDependencyOnPackageNotSelectedForInstall()
{
var testRegistryValueExe = "ExeA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageB = this.CreatePackageInstaller("PackageB");
var bundleA = this.CreateBundleInstaller("BundleAv1");
var bundleB = this.CreateBundleInstaller("BundleB");
var testBAController = this.CreateTestBAController();
packageA.VerifyInstalled(false);
packageB.VerifyInstalled(false);
bundleA.Install();
bundleA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
// Verify https://github.com/wixtoolset/issues/issues/3456 - Dependency registered on package though unselected to instal
testBAController.SetPackageRequestedState("PackageA", RequestState.None);
testBAController.SetPackageRequestedState("PackageB", RequestState.None);
bundleB.Install();
bundleB.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(false);
bundleA.Uninstall();
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
packageB.VerifyInstalled(false);
bundleB.Uninstall();
bundleB.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
packageB.VerifyInstalled(false);
}
[Fact(Skip = "https://github.com/wixtoolset/issues/issues/3516")]
public void DoesntRollbackPackageInstallIfPreexistingDependents()
{
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageC = this.CreatePackageInstaller("PackageC");
var bundleE = this.CreateBundleInstaller("BundleE");
var bundleL = this.CreateBundleInstaller("BundleL");
var testBAController = this.CreateTestBAController();
packageA.VerifyInstalled(false);
packageC.VerifyInstalled(false);
// Make PackageC fail.
testBAController.SetPackageCancelExecuteAtProgress("PackageC", 10);
bundleE.Install();
bundleE.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(false);
// Make PackageC install then rollback.
testBAController.SetPackageCancelExecuteAtProgress("PackageC", null);
testBAController.SetPackageCancelOnProgressAtProgress("PackageC", 10);
bundleL.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_USEREXIT);
bundleL.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(true);
testBAController.SetPackageCancelOnProgressAtProgress("PackageC", null);
bundleE.Uninstall();
bundleE.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageC.VerifyInstalled(false);
}
[Fact]
public void RegistersDependencyOnFailedNonVitalPackages()
{
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageC = this.CreatePackageInstaller("PackageC");
var bundleE = this.CreateBundleInstaller("BundleE");
var bundleL = this.CreateBundleInstaller("BundleL");
var testBAController = this.CreateTestBAController();
packageA.VerifyInstalled(false);
packageC.VerifyInstalled(false);
// Make PackageC fail.
testBAController.SetPackageCancelExecuteAtProgress("PackageC", 10);
// Verify https://github.com/wixtoolset/issues/issues/3406 - Non-vital failure result in bundle failure (install)
bundleE.Install();
bundleE.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(false);
// Verify https://github.com/wixtoolset/issues/issues/3406 - Non-vital failure result in bundle failure (repair)
bundleE.Repair();
bundleE.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(false);
testBAController.SetPackageCancelExecuteAtProgress("PackageC", null);
bundleL.Install();
bundleL.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(true);
// Verify https://github.com/wixtoolset/issues/issues/3516 - Burn registers dependency on failed packages
bundleL.Uninstall();
bundleL.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
packageC.VerifyInstalled(true);
bundleE.Uninstall();
bundleE.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
packageC.VerifyInstalled(false);
}
[Fact]
public void RemovesDependencyDuringUpgradeRollback()
{
var testRegistryValueExe = "ExeA";
var packageA = this.CreatePackageInstaller("PackageAv1");
var bundleA = this.CreateBundleInstaller("BundleAv1");
var bundleD = this.CreateBundleInstaller("BundleD");
packageA.VerifyInstalled(false);
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
bundleA.Install();
bundleA.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
// Verify https://github.com/wixtoolset/issues/issues/3341 - pkg dependecy not removed in rollback if pkg already present
bundleD.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE);
bundleD.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
bundleA.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0");
bundleA.Uninstall();
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(false);
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
}
[Fact]
public void SkipsCrossScopeDependencyRegistration()
{
var packageA = this.CreatePackageInstaller("PackageAv1");
var packageDv1 = this.CreatePackageInstaller("PackageDv1");
var packageDv2 = this.CreatePackageInstaller("PackageDv2");
var bundleHv1 = this.CreateBundleInstaller("BundleHv1");
var bundleHv2 = this.CreateBundleInstaller("BundleHv2");
packageA.VerifyInstalled(false);
packageDv1.VerifyInstalled(false);
packageDv2.VerifyInstalled(false);
var bundleHv1InstallLogFilePath = bundleHv1.Install();
bundleHv1.VerifyRegisteredAndInPackageCache();
packageA.VerifyInstalled(true);
packageDv1.VerifyInstalled(true);
Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv1InstallLogFilePath, @"Skipping cross-scope dependency registration on package: PackageA, bundle scope: PerUser, package scope: PerMachine"));
var bundleHv2InstallLogFilePath = bundleHv2.Install();
bundleHv2.VerifyRegisteredAndInPackageCache();
bundleHv1.VerifyUnregisteredAndRemovedFromPackageCache();
packageA.VerifyInstalled(true);
packageDv1.VerifyInstalled(false);
packageDv2.VerifyInstalled(true);
Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Skipping cross-scope dependency registration on package: PackageA, bundle scope: PerUser, package scope: PerMachine"));
Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerUser, version: 1\.0\.0\.0, operation: MajorUpgrade"));
bundleHv2.Uninstall();
bundleHv2.VerifyUnregisteredAndRemovedFromPackageCache();
// Verify that permanent packageA is still installed and then remove.
packageA.VerifyInstalled(true);
packageDv2.VerifyInstalled(false);
packageA.UninstallProduct();
packageA.VerifyInstalled(false);
}
}

Просмотреть файл

@ -20,7 +20,7 @@
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageReference Include="WixBuildTools.TestSupport" Version="4.0.48" />
<PackageReference Include="WixToolset.Data" Version="4.0.196" />
<PackageReference Include="WixToolset.Data" Version="4.0.198" />
<PackageReference Include="WixToolset.Mba.Core" Version="4.0.51" />
</ItemGroup>