aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/burn/test/BurnUnitTest/CacheTest.cpp2
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/burn/test/BurnUnitTest/CacheTest.cpp b/src/burn/test/BurnUnitTest/CacheTest.cpp
index 2bec05fe..8e3660b2 100644
--- a/src/burn/test/BurnUnitTest/CacheTest.cpp
+++ b/src/burn/test/BurnUnitTest/CacheTest.cpp
@@ -83,7 +83,7 @@ namespace Bootstrapper
83 CacheUninitialize(&cache); 83 CacheUninitialize(&cache);
84 84
85 // Second fallback is system-level %TMP%. 85 // Second fallback is system-level %TMP%.
86 hr = RegWriteExpandString(hkSystemEnvironment, L"TMP", L"B:\\TEST\\TMP\\"); 86 hr = RegWriteString(hkSystemEnvironment, L"TMP", L"B:\\TEST\\TMP\\");
87 NativeAssert::Succeeded(hr, "Failed to write TEMP system environment value."); 87 NativeAssert::Succeeded(hr, "Failed to write TEMP system environment value.");
88 88
89 hr = CacheInitialize(&cache, &internalCommand); 89 hr = CacheInitialize(&cache, &internalCommand);
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
index d9eb36ba..65d0c9cd 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
@@ -15,6 +15,7 @@ namespace WixToolsetTest.BurnE2E
15 [RuntimeFact] 15 [RuntimeFact]
16 public void AllowsBAToKeepRegistration() 16 public void AllowsBAToKeepRegistration()
17 { 17 {
18 const string fakeInstallDay = "20230101";
18 this.CreatePackageInstaller("PackageA"); 19 this.CreatePackageInstaller("PackageA");
19 var bundleA = this.CreateBundleInstaller("BundleA"); 20 var bundleA = this.CreateBundleInstaller("BundleA");
20 var testBAController = this.CreateTestBAController(); 21 var testBAController = this.CreateTestBAController();
@@ -35,6 +36,12 @@ namespace WixToolsetTest.BurnE2E
35 testBAController.SetForceKeepRegistration(null); 36 testBAController.SetForceKeepRegistration(null);
36 testBAController.ResetPackageStates("PackageA"); 37 testBAController.ResetPackageStates("PackageA");
37 38
39 // Pretend the bundle was installed on this day to be able to verify that it is only written on the initial install.
40 using (var registrationKey = initialRegistration.BaseKey.OpenSubKey(initialRegistration.KeyPath, writable: true))
41 {
42 registrationKey.SetValue(GenericArpRegistration.REGISTRY_ARP_INSTALL_DATE, fakeInstallDay);
43 }
44
38 bundleA.Install(); 45 bundleA.Install();
39 var finalRegistration = bundleA.VerifyRegisteredAndInPackageCache(); 46 var finalRegistration = bundleA.VerifyRegisteredAndInPackageCache();
40 47
@@ -42,7 +49,7 @@ namespace WixToolsetTest.BurnE2E
42 Assert.NotNull(finalRegistration.EstimatedSize); 49 Assert.NotNull(finalRegistration.EstimatedSize);
43 Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue); 50 Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue);
44 51
45 Assert.Equal(initialRegistration.InstallDate, finalRegistration.InstallDate); 52 Assert.Equal(fakeInstallDay, finalRegistration.InstallDate);
46 } 53 }
47 54
48 [RuntimeFact] 55 [RuntimeFact]