aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/WixTestTools/BundleVerifier.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/WixTestTools/BundleVerifier.cs')
-rw-r--r--src/test/burn/WixTestTools/BundleVerifier.cs37
1 files changed, 37 insertions, 0 deletions
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));