From b4da272e25c5c776cc5c66ee069bd3fb7548dd92 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 9 Mar 2026 16:21:15 -0400 Subject: Set more detect-phase values when falling back. When configurable-scope bundle is already installed, find it during detect by falling back from machine to user. Set the scope as early as possible so detect-phase checks (e.g., cache path, state file) work as expected. Fixes https://github.com/wixtoolset/issues/issues/9257 --- .../burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/test') diff --git a/src/test/burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs index 049cefc3..9e8870fc 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs @@ -108,7 +108,12 @@ namespace WixToolsetTest.BurnE2E Assert.True(LogVerifier.MessageInLogFile(log, "Plan begin, 3 packages, action: Install, planned scope: Default")); + log = bundle.Modify(); + Assert.True(LogVerifier.MessageInLogFile(log, "TESTBA: OnDetectBegin: Cached=True")); + Assert.False(LogVerifier.MessageInLogFile(log, "Could not load or read state file:")); + log = bundle.Repair(); + Assert.False(LogVerifier.MessageInLogFile(log, "Could not load or read state file:")); Assert.True(LogVerifier.MessageInLogFile(log, "Bundle was already installed with scope: PerUser. Scope cannot change during maintenance.")); var bundleV2 = this.CreateBundleInstaller("AllPuomBundleTestBAv2"); @@ -132,6 +137,8 @@ namespace WixToolsetTest.BurnE2E Assert.True(LogVerifier.MessageInLogFile(log, "Plan begin, 3 packages, action: Install, planned scope: Default")); log = bundle.Repair(); + Assert.True(LogVerifier.MessageInLogFile(log, "TESTBA: OnDetectBegin: Cached=True")); + Assert.False(LogVerifier.MessageInLogFile(log, "Could not load or read state file:")); Assert.True(LogVerifier.MessageInLogFile(log, "Bundle was already installed with scope: PerUser. Scope cannot change during maintenance.")); var bundleV2 = this.CreateBundleInstaller("AllPuomBundleTestBAv2"); @@ -164,6 +171,8 @@ namespace WixToolsetTest.BurnE2E Assert.True(LogVerifier.MessageInLogFile(log, "Planned package: PmouPkg2.msi, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, scope: PerMachine,")); log = bundle.Repair(); + Assert.True(LogVerifier.MessageInLogFile(log, "TESTBA: OnDetectBegin: Cached=True")); + Assert.False(LogVerifier.MessageInLogFile(log, "Could not load or read state file:")); Assert.True(LogVerifier.MessageInLogFile(log, "Bundle was already installed with scope: PerMachine")); Assert.True(LogVerifier.MessageInLogFile(log, "Detected package: PmouPkg1.msi, state: Present, authored scope: PerMachineOrUser, detected scope: PerMachine,")); Assert.True(LogVerifier.MessageInLogFile(log, "Detected package: PmouPkg2.msi, state: Present, authored scope: PerMachineOrUser, detected scope: PerMachine,")); @@ -508,6 +517,8 @@ namespace WixToolsetTest.BurnE2E Assert.True(LogVerifier.MessageInLogFile(log, "Planned package: PerUserPkg.msi, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, scope: PerUser")); log = bundle.Repair(); + Assert.True(LogVerifier.MessageInLogFile(log, "TESTBA: OnDetectBegin: Cached=True")); + Assert.False(LogVerifier.MessageInLogFile(log, "Could not load or read state file:")); Assert.True(LogVerifier.MessageInLogFile(log, "Detected package: PerMachinePkg.msi, state: Present, authored scope: PerMachine, detected scope: PerMachine,")); Assert.True(LogVerifier.MessageInLogFile(log, "Detected package: PmouPkg1.msi, state: Present, authored scope: PerMachineOrUser, detected scope: PerMachine,")); Assert.True(LogVerifier.MessageInLogFile(log, "Detected package: PmouPkg2.msi, state: Present, authored scope: PerMachineOrUser, detected scope: PerMachine,")); -- cgit v1.2.3-55-g6feb