From e71e51df20aa0e460286552008172158428fda82 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 6 Nov 2026 19:57:25 +0000 Subject: [PATCH] Record advertised-upgrade regression and corrected installer evidence --- .../Fixtures/Advertised-Version10-Upgrade.txt | 11 +++ .../Setup/Test-UpgradeRegression.ps1 | 4 +- .../Setup/Upgrade-Fix-2026-11-06.md | 95 +++++++++++++++++++ 3 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 PlotDirector.NativeCompanion/WindowsValidation/Setup/Fixtures/Advertised-Version10-Upgrade.txt create mode 100644 PlotDirector.NativeCompanion/WindowsValidation/Setup/Upgrade-Fix-2026-11-06.md diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Fixtures/Advertised-Version10-Upgrade.txt b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Fixtures/Advertised-Version10-Upgrade.txt new file mode 100644 index 00000000..0b651c47 --- /dev/null +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Fixtures/Advertised-Version10-Upgrade.txt @@ -0,0 +1,11 @@ +Sanitised evidence from the real 2026-11-06 19:50 upgrade failure. +FindRelatedProducts: OLDPRODUCTS = version10 ProductCode. +MigrateFeatureStates: based on existing product, setting feature 'Complete' to 'Advertise' state. +Feature: Complete; Installed: Absent; Request: Advertise; Action: Advertise +Every new payload component: Installed: Absent; Request: Null; Action: Null +Windows Installer result=0 +Native MSI product context=2; ProductVersion=1.0.12 +Word add-in physical file version=1.0.0.10 +Tray executable physical file version=1.0.0.10 +Bootstrapper expected application version=1.0.0.12 +Installed component version mismatch. diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 index 0b8b8d24..8d7bde3f 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 @@ -26,7 +26,7 @@ function Authoring($installer,[string]$path){ if(@($sequence | Where-Object Action -eq 'MigrateFeatureStates').Count){$problems.Add('MigrateFeatureStates action is scheduled')} return @{problems=@($problems);properties=$properties;files=@(Rows $db 'File');components=@(Rows $db 'FeatureComponents')} } -$fixture=Get-Content -Raw (Join-Path $PSScriptRoot 'Fixtures\Advertised-Version10-Upgrade.log') +$fixture=Get-Content -Raw (Join-Path $PSScriptRoot 'Fixtures\Advertised-Version10-Upgrade.txt') Assert-Upgrade ($fixture -match "setting feature 'Complete' to 'Advertise'" -and $fixture -match 'Request: Null; Action: Null') 'Regression fixture records the real advertised-feature/no-file-action failure' $installer=New-Object -ComObject WindowsInstaller.Installer $failed=Authoring $installer (Join-Path $FailedSetupDirectory 'PlotDirectorCompanion.msi') @@ -44,7 +44,7 @@ foreach($scenario in @(@{name='version10 advertised-feature major upgrade';regis Assert-Upgrade (($properties -match 'REINSTALL=ALL') -eq [bool]$scenario.registered) "Compiled bootstrapper chooses correct repair mode: $($scenario.name)" } foreach($versions in @(@{word='1.0.0.10';agent='1.0.0.10'},@{word='1.0.0.12';agent='1.0.0.10'},@{word='1.0.0.10';agent='1.0.0.12'})){ - $message=$null;try{$policy.GetMethod('VerifyVersions').Invoke($null,@('1.0.0.12',$versions.word,$versions.agent))}catch{$message=$_.Exception.InnerException.Message} + $message=$null;try{$policy.GetMethod('VerifyVersions').Invoke($null,@('1.0.0.12',$versions.word,$versions.agent))}catch{$message=$_.Exception.GetBaseException().Message} Assert-Upgrade ($message -like '*Expected 1.0.0.12*' -and $message.Contains('Word add-in detected '+$versions.word) -and $message.Contains('tray executable detected '+$versions.agent)) "Strict check rejects and diagnoses old/mixed files: $($versions.word) / $($versions.agent)" } $null=$policy.GetMethod('VerifyVersions').Invoke($null,@('1.0.0.12','1.0.0.12','1.0.0.12'));$checks.Add('Strict check accepts matching version12 files') diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Upgrade-Fix-2026-11-06.md b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Upgrade-Fix-2026-11-06.md new file mode 100644 index 00000000..8c2bc440 --- /dev/null +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Upgrade-Fix-2026-11-06.md @@ -0,0 +1,95 @@ +# Version12 advertised-feature upgrade failure and corrected installer + +## Demonstrated cause + +The original bootstrapper's `Setup.cs` compared `FileVersionInfo.FileVersion` for: + +- `%LOCALAPPDATA%\Programs\PlotDirector Companion\PlotDirector.WordAddIn.dll` +- `%LOCALAPPDATA%\Programs\PlotDirector Companion\Agent\PlotDirector.Companion.Agent.exe` + +Both physical files are **1.0.0.10**. The expected application version is correctly +**1.0.0.12** (`SetupRelease.Version`), not the three-part MSI version 1.0.12. This +was not a string-format comparison error or permission to accept the old versions. + +The real failed setup log at `20261106-194958` records VSTO uninstall result0, MSI +result0 and current-user context2 verification, then the mismatch at 19:50:19 UTC. +The MSI trace gives the causal sequence: + +```text +FindRelatedProducts: OLDPRODUCTS = version10 ProductCode +MigrateFeatureStates: based on existing product, setting feature 'Complete' to 'Advertise' state. +Feature: Complete; Installed: Absent; Request: Advertise; Action: Advertise +All new payload components: Request: Null; Action: Null +``` + +The version10 MSI feature was advertised despite the physical version10 files. +Version12 had the migration bit in its Upgrade row and scheduled MigrateFeatureStates. +It inherited Advertise, registered the new product but scheduled no local file copies. +The strict version check correctly caught that false installation success. + +Read-only native inventory after the user's failed attempt now shows the version12 +ProductCode registered at ProductVersion **1.0.12**, context **2**, with Complete +feature state **1 (Advertised)** and the physical application files still version10. +The old MSI product registration was removed by that earlier attempt. This task did +not attempt to restore, uninstall, repair, launch or replace anything installed. +Before/after inspection confirms identical physical payload hashes and Word +registration throughout this investigation; settings were not written. + +## Correction + +- Explicit `ADDLOCAL=Complete` in the MSI and compiled bootstrapper policy. +- Required Complete feature attributes **24**: DisallowAdvertise + UIDisallowAbsent. +- Removed the Upgrade-row feature-migration bit and MigrateFeatureStates action. +- Kept the same version12 ProductCode/UpgradeCode. The partially registered version12 + therefore uses same-product repair/recaching, with ADDLOCAL and REINSTALL=ALL; + upgrading a version10 registration also explicitly selects local installation. +- Retained exact expected file-version checks. Both detected versions are logged + independently and included in any mismatch error. Native post-install feature + state must additionally be **Local (3)**. +- No application feature, Word adapter, certificate/trust store, user data directory + or alternative installer infrastructure changed. + +## Regression and verification + +`Test-UpgradeRegression.ps1` uses the sanitised real failure fixture, reads both the +original and corrected MSI, and invokes only the compiled bootstrapper's pure +selection/version policy. It never runs Setup.Main, opens an installation session, +executes MSI actions or launches desktop applications. + +**14 assertions passed.** The original released version12 MSI fails the four key +local-install authoring invariants; the corrected MSI passes. Tests cover explicit +local selection for an advertised version10 upgrade and an already registered +version12 repair, continued refusal of old/mixed file versions with precise +diagnostics, matching-version acceptance and membership of both required payload +files in Complete. These checks would have rejected the faulty original package. + +The earlier 135 checks verified contents, identities, ranges and signatures, but +did not enforce local feature selection or reject advertised-state migration. +Their passing results did not prove an installed upgrade. That coverage gap is now +covered explicitly rather than weakening the version check. + +The corrected package also passed the existing **96** MSI/CAB/hash/signature and +scope assertions. The application payload is unchanged from the previously built +and tested version12 package; its seven regression suites were not rerun. Installer +compilation/signing occurred once. Only read-only verification was performed. + +## Corrected artifact + +`C:\Users\Nick\Downloads\PlotDirectorCompanion-1.0.0.12-upgrade-fix\PlotDirectorCompanionSetup.exe` + +- Application/EXE version **1.0.0.12**, MSI **1.0.12**. +- Installer source: `661fdf6650fff8998c83789ade3b2ccbe1e451f7`. +- Reused application payload: `e0e2cda53cd7b474b3f697abf4186e3166a62af1`. +- EXE SHA-256: `10C2E6DD524FCBA45EFFB3B2D87AC9D9863D98B661E0AA8AED27EB6D0A31C6C7`. +- MSI SHA-256: `8C87FEF90C85964A5B2AD261D4FB215F1951CC78AE7EAE47BA903862866F42E0`. +- Existing developer certificate/signing mechanism retained; no public signing trust + is claimed. The original failed package and known-good version10 installer remain. + +Local evidence: `C:\Temp\PlotDirectorUpgradeFix-1.0.0.12`; corrected setup includes +`setup-evidence.json` and the two verification reports alongside the installer. + +**An actual installed upgrade/repair has not been performed.** The user must close +Word normally and run this corrected unified EXE manually, approve normal developer +trust if requested, then confirm installed file versions, Local feature state, +tray/IPC, settings and normal Word restart. No automatic recovery or installation +was attempted by this task. The pre-existing solution edit remains untouched.