diff options
Diffstat (limited to '')
18 files changed, 275 insertions, 75 deletions
diff --git a/src/test/burn/TestData/Manual/BundleB/Bundle.wxs b/src/test/burn/TestData/Manual/BundleB/Bundle.wxs index 8c670577..248ec05c 100644 --- a/src/test/burn/TestData/Manual/BundleB/Bundle.wxs +++ b/src/test/burn/TestData/Manual/BundleB/Bundle.wxs | |||
@@ -30,11 +30,11 @@ | |||
30 | <?elseif $(var.BA) = "hyperlinkLicense"?> | 30 | <?elseif $(var.BA) = "hyperlinkLicense"?> |
31 | <BootstrapperApplication> | 31 | <BootstrapperApplication> |
32 | <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" /> | 32 | <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" /> |
33 | <PayloadGroupRef Id="BAPayloads" /> | 33 | <Payloads Include="$(sys.SOURCEFILEDIR)\BAPayloads\**" /> |
34 | </BootstrapperApplication> | 34 | </BootstrapperApplication> |
35 | <?else?> | 35 | <?else?> |
36 | <BootstrapperApplicationRef Id="$(var.BA)"> | 36 | <BootstrapperApplicationRef Id="$(var.BA)"> |
37 | <PayloadGroupRef Id="BAPayloads" /> | 37 | <Payloads Include="$(sys.SOURCEFILEDIR)\BAPayloads\**" /> |
38 | </BootstrapperApplicationRef> | 38 | </BootstrapperApplicationRef> |
39 | <?endif?> | 39 | <?endif?> |
40 | 40 | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj b/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj index 36792c2b..d0b05bc1 100644 --- a/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj +++ b/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj | |||
@@ -8,24 +8,10 @@ | |||
8 | </PropertyGroup> | 8 | </PropertyGroup> |
9 | 9 | ||
10 | <ItemGroup> | 10 | <ItemGroup> |
11 | <HarvestDirectory Include="BAPayloads"> | ||
12 | <ComponentGroupName>BAPayloads</ComponentGroupName> | ||
13 | <DirectoryRefId>BAPayloads</DirectoryRefId> | ||
14 | <Transforms>ba.xslt</Transforms> | ||
15 | </HarvestDirectory> | ||
16 | <HarvestDirectory Include="PackagePayloads"> | ||
17 | <ComponentGroupName>PackagePayloads</ComponentGroupName> | ||
18 | <DirectoryRefId>PackagePayloads</DirectoryRefId> | ||
19 | <Transforms>package.xslt</Transforms> | ||
20 | </HarvestDirectory> | ||
21 | </ItemGroup> | ||
22 | |||
23 | <ItemGroup> | ||
24 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | 11 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> |
25 | </ItemGroup> | 12 | </ItemGroup> |
26 | 13 | ||
27 | <ItemGroup> | 14 | <ItemGroup> |
28 | <PackageReference Include="WixToolset.Heat" /> | ||
29 | <PackageReference Include="WixToolset.BootstrapperApplications.wixext" /> | 15 | <PackageReference Include="WixToolset.BootstrapperApplications.wixext" /> |
30 | </ItemGroup> | 16 | </ItemGroup> |
31 | 17 | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/BundleB.wxs b/src/test/burn/TestData/Manual/BundleB/BundleB.wxs index 54082131..f1a04445 100644 --- a/src/test/burn/TestData/Manual/BundleB/BundleB.wxs +++ b/src/test/burn/TestData/Manual/BundleB/BundleB.wxs | |||
@@ -4,7 +4,7 @@ | |||
4 | <Fragment> | 4 | <Fragment> |
5 | <PackageGroup Id="BundlePackages"> | 5 | <PackageGroup Id="BundlePackages"> |
6 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)"> | 6 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)"> |
7 | <PayloadGroupRef Id="PackagePayloads" /> | 7 | <Payloads Include="$(sys.SOURCEFILEDIR)\PackagePayloads\**" /> |
8 | </MsiPackage> | 8 | </MsiPackage> |
9 | </PackageGroup> | 9 | </PackageGroup> |
10 | </Fragment> | 10 | </Fragment> |
diff --git a/src/test/burn/TestData/Manual/BundleB/ba.xslt b/src/test/burn/TestData/Manual/BundleB/ba.xslt deleted file mode 100644 index 54bc7fe6..00000000 --- a/src/test/burn/TestData/Manual/BundleB/ba.xslt +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" | ||
4 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" | ||
5 | > | ||
6 | <xsl:output method="xml" indent="yes"/> | ||
7 | |||
8 | <xsl:template match="@* | node()"> | ||
9 | <xsl:copy> | ||
10 | <xsl:apply-templates select="@* | node()"/> | ||
11 | </xsl:copy> | ||
12 | </xsl:template> | ||
13 | |||
14 | <xsl:template match="wix:Payload" > | ||
15 | <xsl:copy> | ||
16 | <xsl:apply-templates select="@* | node()"/> | ||
17 | <xsl:attribute name="Id">ba_<xsl:value-of select="substring(@SourceFile, 11)" /></xsl:attribute> | ||
18 | <xsl:attribute name="SourceFile">BAPayloads<xsl:value-of select="substring(@SourceFile, 10)" /></xsl:attribute> | ||
19 | </xsl:copy> | ||
20 | </xsl:template> | ||
21 | </xsl:stylesheet> | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/package.xslt b/src/test/burn/TestData/Manual/BundleB/package.xslt deleted file mode 100644 index 304ff78b..00000000 --- a/src/test/burn/TestData/Manual/BundleB/package.xslt +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" | ||
4 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" | ||
5 | > | ||
6 | <xsl:output method="xml" indent="yes"/> | ||
7 | |||
8 | <xsl:template match="@* | node()"> | ||
9 | <xsl:copy> | ||
10 | <xsl:apply-templates select="@* | node()"/> | ||
11 | </xsl:copy> | ||
12 | </xsl:template> | ||
13 | |||
14 | <xsl:template match="wix:Payload" > | ||
15 | <xsl:copy> | ||
16 | <xsl:apply-templates select="@* | node()"/> | ||
17 | <xsl:attribute name="Id">package_<xsl:value-of select="substring(@SourceFile, 11)" /></xsl:attribute> | ||
18 | <xsl:attribute name="SourceFile">PackagePayloads<xsl:value-of select="substring(@SourceFile, 10)" /></xsl:attribute> | ||
19 | </xsl:copy> | ||
20 | </xsl:template> | ||
21 | </xsl:stylesheet> | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/Bundle.wxs b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/Bundle.wxs new file mode 100644 index 00000000..2e920297 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/Bundle.wxs | |||
@@ -0,0 +1,58 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | |||
3 | <?ifndef TestVersion?> | ||
4 | <?define TestVersion = 1.0.0.0?> | ||
5 | <?endif?> | ||
6 | <?ifndef BundleLogDirectory?> | ||
7 | <?define BundleLogDirectory = .?> | ||
8 | <?endif?> | ||
9 | |||
10 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
11 | <Bundle Name="~$(TestGroupName)" Version="$(TestVersion)" Manufacturer="Acme" UpgradeCode="$(UpgradeCode)" Compressed="yes"> | ||
12 | <Log Prefix="$(BundleLogDirectory)\~$(TestGroupName)_$(BundleName)" /> | ||
13 | |||
14 | <Variable Name="TestGroupName" Value="$(TestGroupName)" /> | ||
15 | |||
16 | <OptionalUpdateRegistration ProductFamily="GreetingsAndFelicitations" Department="Setup Geeks" Classification="Bundle" /> | ||
17 | |||
18 | <?ifdef SoftwareTag?> | ||
19 | <SoftwareTag Regid="regid.1995-08.com.example" InstallPath="[CommonAppDataFolder]TestingSwidTags" /> | ||
20 | <?endif?> | ||
21 | |||
22 | <?ifndef BA?> | ||
23 | <!-- pulled in through the PackageGroupRef below --> | ||
24 | <?elseif $(BA) = "TestBA_x64"?> | ||
25 | <!-- pulled in through the PackageGroupRef below --> | ||
26 | <?elseif $(BA) = "WixBA"?> | ||
27 | <!-- pulled in through the PackageGroupRef below --> | ||
28 | <?elseif $(BA) = "hyperlinkLicense"?> | ||
29 | <BootstrapperApplication> | ||
30 | <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" /> | ||
31 | <PayloadGroupRef Id="ExtraPayloads" /> | ||
32 | </BootstrapperApplication> | ||
33 | <?elseif $(BA) = "iui"?> | ||
34 | <BootstrapperApplication> | ||
35 | <bal:WixInternalUIBootstrapperApplication /> | ||
36 | </BootstrapperApplication> | ||
37 | <?else?> | ||
38 | <BootstrapperApplicationRef Id="$(BA)" /> | ||
39 | <?endif?> | ||
40 | |||
41 | <Chain> | ||
42 | <?ifndef BA?> | ||
43 | <PackageGroupRef Id="TestBA" /> | ||
44 | <?elseif $(BA) = "TestBA_x64"?> | ||
45 | <PackageGroupRef Id="TestBA_x64" /> | ||
46 | <?elseif $(BA) = "WixBA"?> | ||
47 | <PackageGroupRef Id="WixBA" /> | ||
48 | <?endif?> | ||
49 | |||
50 | <PackageGroupRef Id="BundlePackages" /> | ||
51 | </Chain> | ||
52 | </Bundle> | ||
53 | |||
54 | <Fragment> | ||
55 | <PayloadGroup Id="virtual ExtraPayloads" /> | ||
56 | </Fragment> | ||
57 | |||
58 | </Wix> | ||
diff --git a/src/tools/test/Directory.Build.props b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleA.props index a0c9a659..6d91ba06 100644 --- a/src/tools/test/Directory.Build.props +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleA.props | |||
@@ -1,10 +1,8 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | |||
4 | <Project> | 2 | <Project> |
5 | <Import Project="..\Directory.Build.props" /> | ||
6 | |||
7 | <PropertyGroup> | 3 | <PropertyGroup> |
8 | <OutputPath>$(OutputPath)test\$(ProjectName)</OutputPath> | 4 | <OutputType>Bundle</OutputType> |
5 | <BA>hyperlinkLicense</BA> | ||
6 | <UpgradeCode>{9510DDE7-CD4F-45B3-9D57-3F7EA04DB33D}</UpgradeCode> | ||
9 | </PropertyGroup> | 7 | </PropertyGroup> |
10 | </Project> | 8 | </Project> |
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wixproj b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wixproj new file mode 100644 index 00000000..0dea1e40 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wixproj | |||
@@ -0,0 +1,12 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <Import Project="BundleA.props" /> | ||
4 | <ItemGroup> | ||
5 | <ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" /> | ||
6 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
7 | </ItemGroup> | ||
8 | <ItemGroup> | ||
9 | <PackageReference Include="WixToolset.BootstrapperApplications.wixext" /> | ||
10 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
11 | </ItemGroup> | ||
12 | </Project> | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wxs b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wxs new file mode 100644 index 00000000..7bf16212 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv1/BundleAv1.wxs | |||
@@ -0,0 +1,10 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | |||
3 | |||
4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
5 | <Fragment> | ||
6 | <PackageGroup Id="BundlePackages"> | ||
7 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> | ||
8 | </PackageGroup> | ||
9 | </Fragment> | ||
10 | </Wix> | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wixproj b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wixproj new file mode 100644 index 00000000..271bf54b --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wixproj | |||
@@ -0,0 +1,18 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <Import Project="..\BundleAv1\BundleA.props" /> | ||
4 | <PropertyGroup> | ||
5 | <TestVersion>2.0.0.0</TestVersion> | ||
6 | </PropertyGroup> | ||
7 | <ItemGroup> | ||
8 | <Compile Include="..\BundleAv1\Bundle.wxs" /> | ||
9 | </ItemGroup> | ||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\PackageAv2\PackageAv2.wixproj" /> | ||
12 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
13 | </ItemGroup> | ||
14 | <ItemGroup> | ||
15 | <PackageReference Include="WixToolset.BootstrapperApplications.wixext" /> | ||
16 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
17 | </ItemGroup> | ||
18 | </Project> | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wxs b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wxs new file mode 100644 index 00000000..5cbee5a8 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/BundleAv2/BundleAv2.wxs | |||
@@ -0,0 +1,10 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | |||
3 | |||
4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
5 | <Fragment> | ||
6 | <PackageGroup Id="BundlePackages"> | ||
7 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv2.TargetPath)" /> | ||
8 | </PackageGroup> | ||
9 | </Fragment> | ||
10 | </Wix> | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageA.props b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageA.props new file mode 100644 index 00000000..25ae3f42 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageA.props | |||
@@ -0,0 +1,9 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | <Project> | ||
3 | <PropertyGroup> | ||
4 | <UpgradeCode>{30746E93-9A4A-48EC-BAEA-3093A2530E73}</UpgradeCode> | ||
5 | </PropertyGroup> | ||
6 | <ItemGroup> | ||
7 | <Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" /> | ||
8 | </ItemGroup> | ||
9 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageAv1.wixproj b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageAv1.wixproj new file mode 100644 index 00000000..45d3b2c8 --- /dev/null +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv1/PackageAv1.wixproj | |||
@@ -0,0 +1,4 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
2 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <Import Project="PackageA.props" /> | ||
4 | </Project> \ No newline at end of file | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv2/PackageAv2.wixproj index 755976bc..d4455f2b 100644 --- a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj +++ b/src/test/burn/TestData/OptionalUpdateRegistrationTests/PackageAv2/PackageAv2.wixproj | |||
@@ -1,8 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | 2 | <Project Sdk="WixToolset.Sdk"> | |
4 | <Project Sdk="Microsoft.NET.Sdk"> | 3 | <Import Project="..\PackageAv1\PackageA.props" /> |
5 | <PropertyGroup> | 4 | <PropertyGroup> |
6 | <TargetFramework>netstandard2.0</TargetFramework> | 5 | <TestVersion>2.0.0.0</TestVersion> |
7 | </PropertyGroup> | 6 | </PropertyGroup> |
8 | </Project> | 7 | </Project> |
diff --git a/src/test/burn/WixTestTools/BundleUpdateRegistration.cs b/src/test/burn/WixTestTools/BundleUpdateRegistration.cs new file mode 100644 index 00000000..2ce68122 --- /dev/null +++ b/src/test/burn/WixTestTools/BundleUpdateRegistration.cs | |||
@@ -0,0 +1,57 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixTestTools | ||
4 | { | ||
5 | using System; | ||
6 | using Microsoft.Win32; | ||
7 | |||
8 | public class BundleUpdateRegistration | ||
9 | { | ||
10 | public const string BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PACKAGE_NAME = "PackageName"; | ||
11 | public const string BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PACKAGE_VERSION = "PackageVersion"; | ||
12 | public const string BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PUBLISHER = "Publisher"; | ||
13 | public const string BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PUBLISHING_GROUP = "PublishingGroup"; | ||
14 | |||
15 | public string PackageName { get; set; } | ||
16 | |||
17 | public string PackageVersion { get; set; } | ||
18 | |||
19 | public string Publisher { get; set; } | ||
20 | |||
21 | public string PublishingGroup { get; set; } | ||
22 | |||
23 | public static bool TryGetPerMachineBundleUpdateRegistration(string manufacturer, string productFamily, string name, bool x64, out BundleUpdateRegistration registration) | ||
24 | { | ||
25 | return TryGetUpdateRegistration(manufacturer, productFamily, name, x64, perUser: false, out registration); | ||
26 | } | ||
27 | |||
28 | public static bool TryGetPerUserBundleUpdateRegistration(string manufacturer, string productFamily, string name, out BundleUpdateRegistration registration) | ||
29 | { | ||
30 | return TryGetUpdateRegistration(manufacturer, productFamily, name, x64: true, perUser: true, out registration); | ||
31 | } | ||
32 | |||
33 | private static bool TryGetUpdateRegistration(string manufacturer, string productFamily, string name, bool x64, bool perUser, out BundleUpdateRegistration registration) | ||
34 | { | ||
35 | var baseKey = perUser ? Registry.CurrentUser : Registry.LocalMachine; | ||
36 | var baseKeyPath = x64 ? @$"SOFTWARE\{manufacturer}\Updates\{productFamily}\{name}" | ||
37 | : @$"SOFTWARE\WOW6432Node\{manufacturer}\Updates\{productFamily}\{name}"; | ||
38 | using var idKey = baseKey.OpenSubKey(baseKeyPath); | ||
39 | |||
40 | if (idKey == null) | ||
41 | { | ||
42 | registration = null; | ||
43 | return false; | ||
44 | } | ||
45 | |||
46 | registration = new BundleUpdateRegistration() | ||
47 | { | ||
48 | PackageName = idKey.GetValue(BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PACKAGE_NAME) as string, | ||
49 | PackageVersion = idKey.GetValue(BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PACKAGE_VERSION) as string, | ||
50 | Publisher = idKey.GetValue(BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PUBLISHER) as string, | ||
51 | PublishingGroup = idKey.GetValue(BURN_UPDATE_REGISTRATION_REGISTRY_BUNDLE_PUBLISHING_GROUP) as string, | ||
52 | }; | ||
53 | |||
54 | return true; | ||
55 | } | ||
56 | } | ||
57 | } | ||
diff --git a/src/test/burn/WixTestTools/BundleVerifier.cs b/src/test/burn/WixTestTools/BundleVerifier.cs index da61d96e..b6181047 100644 --- a/src/test/burn/WixTestTools/BundleVerifier.cs +++ b/src/test/burn/WixTestTools/BundleVerifier.cs | |||
@@ -6,6 +6,7 @@ namespace WixTestTools | |||
6 | using System.IO; | 6 | using System.IO; |
7 | using System.Linq; | 7 | using System.Linq; |
8 | using System.Text; | 8 | using System.Text; |
9 | using System.Xml.Linq; | ||
9 | using Microsoft.Win32; | 10 | using Microsoft.Win32; |
10 | using WixInternal.TestSupport; | 11 | using WixInternal.TestSupport; |
11 | using WixToolset.Data; | 12 | using WixToolset.Data; |
@@ -23,6 +24,8 @@ namespace WixTestTools | |||
23 | 24 | ||
24 | private WixBundleSymbol BundleSymbol { get; set; } | 25 | private WixBundleSymbol BundleSymbol { get; set; } |
25 | 26 | ||
27 | private WixUpdateRegistrationSymbol UpdateRegistrationSymbol { get; set; } | ||
28 | |||
26 | private WixBundleSymbol GetBundleSymbol() | 29 | private WixBundleSymbol GetBundleSymbol() |
27 | { | 30 | { |
28 | if (this.BundleSymbol == null) | 31 | if (this.BundleSymbol == null) |
@@ -36,6 +39,19 @@ namespace WixTestTools | |||
36 | return this.BundleSymbol; | 39 | return this.BundleSymbol; |
37 | } | 40 | } |
38 | 41 | ||
42 | private WixUpdateRegistrationSymbol GetUpdateRegistrationSymbol() | ||
43 | { | ||
44 | if (this.UpdateRegistrationSymbol == null) | ||
45 | { | ||
46 | using var wixOutput = WixOutput.Read(this.BundlePdb); | ||
47 | var intermediate = Intermediate.Load(wixOutput); | ||
48 | var section = intermediate.Sections.Single(); | ||
49 | this.UpdateRegistrationSymbol = section.Symbols.OfType<WixUpdateRegistrationSymbol>().Single(); | ||
50 | } | ||
51 | |||
52 | return this.UpdateRegistrationSymbol; | ||
53 | } | ||
54 | |||
39 | public string GetFullBurnPolicyRegistryPath() | 55 | public string GetFullBurnPolicyRegistryPath() |
40 | { | 56 | { |
41 | var bundleSymbol = this.GetBundleSymbol(); | 57 | var bundleSymbol = this.GetBundleSymbol(); |
@@ -118,6 +134,27 @@ namespace WixTestTools | |||
118 | } | 134 | } |
119 | } | 135 | } |
120 | 136 | ||
137 | public bool TryGetUpdateRegistration(out BundleUpdateRegistration registration) | ||
138 | { | ||
139 | var bundleSymbol = this.GetBundleSymbol(); | ||
140 | var x64 = bundleSymbol.Platform != Platform.X86; | ||
141 | |||
142 | var updateRegistrationSymbol = this.GetUpdateRegistrationSymbol(); | ||
143 | var manufacturer = updateRegistrationSymbol.Manufacturer; | ||
144 | var productFamily = updateRegistrationSymbol.ProductFamily; | ||
145 | var name = updateRegistrationSymbol.Name; | ||
146 | |||
147 | |||
148 | if (bundleSymbol.PerMachine) | ||
149 | { | ||
150 | return BundleUpdateRegistration.TryGetPerMachineBundleUpdateRegistration(manufacturer, productFamily, name, x64, out registration); | ||
151 | } | ||
152 | else | ||
153 | { | ||
154 | return BundleUpdateRegistration.TryGetPerUserBundleUpdateRegistration(manufacturer, productFamily, name, out registration); | ||
155 | } | ||
156 | } | ||
157 | |||
121 | public BundleRegistration VerifyRegisteredAndInPackageCache(int? expectedSystemComponent = null) | 158 | public BundleRegistration VerifyRegisteredAndInPackageCache(int? expectedSystemComponent = null) |
122 | { | 159 | { |
123 | Assert.True(this.TryGetRegistration(out var registration)); | 160 | Assert.True(this.TryGetRegistration(out var registration)); |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs index a7438564..e7c7ee5b 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs | |||
@@ -30,7 +30,7 @@ namespace WixToolsetTest.BurnE2E | |||
30 | perMachineArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | 30 | perMachineArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
31 | arpEntryExePackage.VerifyRegistered(false); | 31 | arpEntryExePackage.VerifyRegistered(false); |
32 | 32 | ||
33 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 33 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
34 | } | 34 | } |
35 | 35 | ||
36 | [RuntimeFact] | 36 | [RuntimeFact] |
@@ -52,7 +52,7 @@ namespace WixToolsetTest.BurnE2E | |||
52 | perMachineArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | 52 | perMachineArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
53 | arpEntryExePackage.VerifyRegistered(false); | 53 | arpEntryExePackage.VerifyRegistered(false); |
54 | 54 | ||
55 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 55 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
56 | } | 56 | } |
57 | 57 | ||
58 | [RuntimeFact] | 58 | [RuntimeFact] |
@@ -85,7 +85,7 @@ namespace WixToolsetTest.BurnE2E | |||
85 | packageTestExe.VerifyInstalled(true); | 85 | packageTestExe.VerifyInstalled(true); |
86 | 86 | ||
87 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe, default: None, requested: Acquire")); | 87 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe, default: None, requested: Acquire")); |
88 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 88 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
89 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); | 89 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); |
90 | } | 90 | } |
91 | 91 | ||
@@ -113,7 +113,7 @@ namespace WixToolsetTest.BurnE2E | |||
113 | packageTestExe.VerifyInstalled(true); | 113 | packageTestExe.VerifyInstalled(true); |
114 | 114 | ||
115 | Assert.False(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe")); | 115 | Assert.False(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe")); |
116 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 116 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
117 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); | 117 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); |
118 | } | 118 | } |
119 | 119 | ||
@@ -144,7 +144,7 @@ namespace WixToolsetTest.BurnE2E | |||
144 | packageTestExe.VerifyInstalled(true); | 144 | packageTestExe.VerifyInstalled(true); |
145 | 145 | ||
146 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe, default: None, requested: None")); | 146 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, "TESTBA: OnCachePackageNonVitalValidationFailure() - id: TestExe, default: None, requested: None")); |
147 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 147 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
148 | } | 148 | } |
149 | 149 | ||
150 | [RuntimeFact] | 150 | [RuntimeFact] |
@@ -161,7 +161,7 @@ namespace WixToolsetTest.BurnE2E | |||
161 | arpEntryExePackage.VerifyRegistered(false); | 161 | arpEntryExePackage.VerifyRegistered(false); |
162 | 162 | ||
163 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); | 163 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, $"TestExe.exe\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},DisplayVersion,String,1.0.0.0\" /regw \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId},QuietUninstallString,String,\\\"")); |
164 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, $"testexe.exe\" /regd HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 164 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, $"testexe.exe\" /regd \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
165 | } | 165 | } |
166 | 166 | ||
167 | [RuntimeFact] | 167 | [RuntimeFact] |
@@ -209,7 +209,7 @@ namespace WixToolsetTest.BurnE2E | |||
209 | perUserArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | 209 | perUserArpEntryExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
210 | arpEntryExePackage.VerifyRegistered(false); | 210 | arpEntryExePackage.VerifyRegistered(false); |
211 | 211 | ||
212 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}")); | 212 | Assert.True(LogVerifier.MessageInLogFile(uninstallLogPath, $"testexe.exe\" /regd \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{arpId}\"")); |
213 | } | 213 | } |
214 | 214 | ||
215 | [RuntimeFact] | 215 | [RuntimeFact] |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs new file mode 100644 index 00000000..3731b0cc --- /dev/null +++ b/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs | |||
@@ -0,0 +1,44 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.BurnE2E | ||
4 | { | ||
5 | using WixTestTools; | ||
6 | using Xunit; | ||
7 | using Xunit.Abstractions; | ||
8 | |||
9 | public class OptionalUpdateRegistrationTests : BurnE2ETests | ||
10 | { | ||
11 | public OptionalUpdateRegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
12 | |||
13 | [RuntimeFact] | ||
14 | public void BundleUpdateRegistrationIsStickyAndAccurateAcrossUpgrades() | ||
15 | { | ||
16 | var packageAv1 = this.CreatePackageInstaller("PackageAv1"); | ||
17 | var packageAv2 = this.CreatePackageInstaller("PackageAv2"); | ||
18 | var bundleAv1 = this.CreateBundleInstaller("BundleAv1"); | ||
19 | var bundleAv2 = this.CreateBundleInstaller("BundleAv2"); | ||
20 | |||
21 | bundleAv1.Install(); | ||
22 | bundleAv1.VerifyRegisteredAndInPackageCache(); | ||
23 | var gotV1Registration = bundleAv1.TryGetUpdateRegistration(out var v1Registration); | ||
24 | |||
25 | bundleAv2.Install(); | ||
26 | bundleAv2.VerifyRegisteredAndInPackageCache(); | ||
27 | var gotV2Registration = bundleAv2.TryGetUpdateRegistration(out var v2Registration); | ||
28 | |||
29 | bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
30 | |||
31 | Assert.True(gotV1Registration, "Missing update registration after v1 install."); | ||
32 | Assert.True(gotV2Registration, "Missing update registration after v2 upgrade."); | ||
33 | |||
34 | Assert.Equal("Acme", v1Registration.Publisher); | ||
35 | Assert.Equal("Acme", v2Registration.Publisher); | ||
36 | Assert.Equal("Setup Geeks", v1Registration.PublishingGroup); | ||
37 | Assert.Equal("Setup Geeks", v2Registration.PublishingGroup); | ||
38 | Assert.Equal("~OptionalUpdateRegistrationTests", v1Registration.PackageName); | ||
39 | Assert.Equal("~OptionalUpdateRegistrationTests", v2Registration.PackageName); | ||
40 | Assert.Equal("1.0.0.0", v1Registration.PackageVersion); | ||
41 | Assert.Equal("2.0.0.0", v2Registration.PackageVersion); | ||
42 | } | ||
43 | } | ||
44 | } | ||