From 4293e1c36ced33115d3080e3054dc9edf829fd63 Mon Sep 17 00:00:00 2001 From: nick Date: Sat, 7 Nov 2026 15:27:53 +0000 Subject: [PATCH] Align unified Companion installer and upgrade checks with 1.0.0.15 --- .../WindowsValidation/Setup/Build-Setup.ps1 | 2 +- .../WindowsValidation/Setup/README.md | 10 +++++----- .../WindowsValidation/Setup/Release.json | 8 ++++---- .../WindowsValidation/Setup/Test-DeveloperPayload.ps1 | 1 + .../WindowsValidation/Setup/Test-SetupPackage.ps1 | 6 +++--- .../WindowsValidation/Setup/Test-UpgradeRegression.ps1 | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Build-Setup.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Build-Setup.ps1 index 29ecf000..504e2129 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Build-Setup.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Build-Setup.ps1 @@ -13,7 +13,7 @@ $repo=(Resolve-Path (Join-Path $PSScriptRoot '..\..\..')).Path if(!$ExpectedSourceCommit){$ExpectedSourceCommit=(& git -C $repo rev-parse HEAD).Trim();if($LASTEXITCODE -ne 0){throw 'Cannot read the exact setup source revision.'}} if($ExpectedSourceCommit -notmatch '^[0-9a-f]{40}$' -or $package.version -ne $release.version -or $package.commit -ne $ExpectedSourceCommit){throw 'Release version or exact package source SHA does not match the requested build.'} Invoke-Checked git @('-C',$repo,'merge-base','--is-ancestor',$release.atlasBaseline,$package.commit) -if($release.productCode -in @($release.baselineProductCode,'{0B1E8E22-FCF5-4D9C-99A1-5D0F4BD3210C}','{A5831E49-6675-4BCA-9A3D-E03C992F4A13}') -or $release.upgradeCode -ne '{641A087B-9779-458C-B290-BCBBAD49319A}'){throw 'This release requires a new major-upgrade ProductCode and the established UpgradeCode.'} +if($release.productCode -in @($release.baselineProductCode,'{0B1E8E22-FCF5-4D9C-99A1-5D0F4BD3210C}','{A5831E49-6675-4BCA-9A3D-E03C992F4A13}','{AB41F7C2-328C-4CEE-A75F-404160ABE4DD}') -or $release.upgradeCode -ne '{641A087B-9779-458C-B290-BCBBAD49319A}'){throw 'This release requires a new major-upgrade ProductCode and the established UpgradeCode.'} foreach($relative in @('PlotDirector.WordAddIn.dll','Agent\PlotDirector.Companion.Agent.exe')){ if([Diagnostics.FileVersionInfo]::GetVersionInfo((Join-Path $PackagePath $relative)).FileVersion -ne $release.version){throw "Wrong application bytes/version: $relative"} } diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/README.md b/PlotDirector.NativeCompanion/WindowsValidation/Setup/README.md index 0d0e6864..d9fdbe8b 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/README.md +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/README.md @@ -1,9 +1,9 @@ -# Complete per-user Windows installer — version14 candidate +# Complete per-user Windows installer — version15 candidate Run **PlotDirectorCompanionSetup.exe** from normal File Explorer after closing Word. It contains the MSI and both application components; no adjacent payload folder is -needed. `Release.json` deliberately selects application **1.0.0.14**, MSI **1.0.14**, -and Atlas baseline `9e313f1abec8cd3b4797edf6a32ad5b43a360455`. The exact clean +needed. `Release.json` deliberately selects application **1.0.0.15**, MSI **1.0.15**, +and Atlas baseline `1ccb6c43220ca06725a53ae86b8fed775b9bdcea`. The exact clean build SHA must match `package.json` and `-ExpectedSourceCommit` (defaults to HEAD). This is a packaging candidate, not a claim of installed Windows acceptance. @@ -26,9 +26,9 @@ produce a specific error; they are not installed or repaired automatically. ## Installation contract -- Version14 uses ProductCode `{AB41F7C2-328C-4CEE-A75F-404160ABE4DD}` with +- Version15 uses ProductCode `{2212AB81-D2DD-4DBC-B859-BC74AE9C3DE5}` with the established UpgradeCode. Its transactional older-product range includes both - versions 10 through 13; same-version14 uses the existing maintenance path. + versions 10 through 14; same-version15 uses the existing maintenance path. Version12-specific notes below describe the preserved historical correction. - Before registration/VSTO/MSI changes, setup stops only the exact installed tray executable in this session, holds its existing singleton lock against restart, diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json index 185e4e1e..b42993f4 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json @@ -1,9 +1,9 @@ { - "version": "1.0.0.14", - "msiVersion": "1.0.14", - "productCode": "{AB41F7C2-328C-4CEE-A75F-404160ABE4DD}", + "version": "1.0.0.15", + "msiVersion": "1.0.15", + "productCode": "{2212AB81-D2DD-4DBC-B859-BC74AE9C3DE5}", "upgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}", - "atlasBaseline": "9e313f1abec8cd3b4797edf6a32ad5b43a360455", + "atlasBaseline": "1ccb6c43220ca06725a53ae86b8fed775b9bdcea", "baselineProductCode": "{98F46939-764D-407F-BD1F-1D88315D010A}", "baselineSetupSha256": "9526E3781EB2EF9936132786E1E2242633349933A553E93E7A7D0B038160A7FF" } diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-DeveloperPayload.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-DeveloperPayload.ps1 index d9349459..ae9d981a 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-DeveloperPayload.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-DeveloperPayload.ps1 @@ -43,6 +43,7 @@ $fixture=[CompanionInstalledProduct]::new();$fixture.ProductCode=$release.baseli [CompanionInstallerInventory]::RequireCurrentUser(@($fixture),$release.msiVersion);$checks.Add('Native context guard accepts the existing current-user version10 upgrade') $fixture.Version='1.0.12';[CompanionInstallerInventory]::RequireCurrentUser(@($fixture),$release.msiVersion);$checks.Add('Native context guard accepts the working current-user version12 upgrade') $fixture.Version='1.0.13';[CompanionInstallerInventory]::RequireCurrentUser(@($fixture),$release.msiVersion);$checks.Add('Native context guard accepts the working current-user version13 upgrade') +$fixture.Version='1.0.14';[CompanionInstallerInventory]::RequireCurrentUser(@($fixture),$release.msiVersion);$checks.Add('Native context guard accepts the working current-user version14 upgrade') foreach($test in @('machine','foreign-user','newer-version')){ $fixture.Context=2;$fixture.UserSid=$sid;$fixture.Version='1.0.10' switch($test){'machine'{$fixture.Context=4};'foreign-user'{$fixture.UserSid='S-1-5-18'};'newer-version'{$fixture.Version='1.0.'+(([version]$release.msiVersion).Build+1)}} diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-SetupPackage.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-SetupPackage.ps1 index 897dbc2e..56ae9919 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-SetupPackage.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-SetupPackage.ps1 @@ -70,7 +70,7 @@ $tables=@{};foreach($table in @('Property','File','Component','Directory','Regis $properties=@{};foreach($row in $tables.Property){$properties[$row.Property]=$row.Value} $oldProperties=@{};foreach($row in @(Read-Table $baseline 'Property')){$oldProperties[$row.Property]=$row.Value} Assert-Package ($properties.ProductVersion -eq $release.msiVersion -and $properties.COMPANIONVERSION -eq $release.version -and $properties.SOURCECOMMIT -eq $package.commit) 'MSI version and source metadata match the final application' -Assert-Package ($properties.ProductCode -eq $release.productCode -and $properties.ProductCode -ne $oldProperties.ProductCode -and $properties.UpgradeCode -eq $oldProperties.UpgradeCode) 'Major upgrade changes ProductCode and preserves the qualified version10 UpgradeCode' +Assert-Package ($properties.ProductCode -eq $release.productCode -and $properties.ProductCode -ne $oldProperties.ProductCode -and $properties.UpgradeCode -eq $oldProperties.UpgradeCode) "Major upgrade changes ProductCode and preserves the baseline UpgradeCode ($($oldProperties.ProductVersion))" Assert-Package (!$properties.ContainsKey('ALLUSERS') -and $properties.MSIINSTALLPERUSER -eq '1' -and @($tables.LaunchCondition | Where-Object Condition -eq 'NOT ALLUSERS').Count -eq 1) 'MSI is authored strictly per-user' $summary=Get-Com $database 'SummaryInformation' @(0) Assert-Package (([int](Get-Com $summary 'Property' @(15)) -band 10) -eq 10 -and (Get-Com $summary 'Property' @(7)) -eq 'x64;1033') 'MSI summary is compressed x64 and requires no elevated privileges' @@ -90,7 +90,7 @@ foreach($file in $tables.File){ Assert-Package ((Test-Path $expected) -and (Get-FileHash $actual).Hash -eq (Get-FileHash $expected).Hash) "Embedded CAB hash matches verified payload: $relative" Assert-Package ((Get-Item $actual).Length -eq [long]$file.FileSize) "MSI file size matches payload: $relative" $logical=$component.Directory_+'/'+$name - if($oldPaths.ContainsKey($logical)){Assert-Package ($component.ComponentId -eq $oldPaths[$logical]) "Component GUID remains stable from version10: $relative"} + if($oldPaths.ContainsKey($logical)){Assert-Package ($component.ComponentId -eq $oldPaths[$logical]) "Component GUID remains stable from baseline $($oldProperties.ProductVersion): $relative"} $installed+=@{path=$relative;sha256=(Get-FileHash $actual).Hash;componentId=$component.ComponentId;fileId=$file.File} if($relative -eq 'Agent/PlotDirector.Companion.Agent.exe'){$agentId=$file.File} } @@ -107,7 +107,7 @@ $sequence=@{};foreach($row in $tables.InstallExecuteSequence){$sequence[$row.Act Assert-Package ($sequence.InstallInitialize -lt $sequence.RemoveExistingProducts -and $sequence.RemoveExistingProducts -lt $sequence.InstallFiles -and $sequence.InstallFiles -lt $sequence.InstallFinalize) 'Older MSI removal is transactional and precedes new files' Assert-Package (@(@('RemoveFiles','RemoveRegistryValues','RemoveShortcuts','RegisterProduct','PublishProduct') | Where-Object {!$sequence.ContainsKey($_)}).Count -eq 0) 'Standard MSI installation and unified removal actions are present' $older=@($tables.Upgrade | Where-Object ActionProperty -eq 'OLDPRODUCTS');$newer=@($tables.Upgrade | Where-Object ActionProperty -eq 'NEWERPRODUCTS') -Assert-Package ($older.Count -eq 1 -and $older[0].VersionMax -eq $release.msiVersion -and [int]$older[0].Attributes -eq 0 -and $older[0].Remove -eq 'ALL') 'Upgrade range includes version10 without migrating advertised feature state' +Assert-Package ($older.Count -eq 1 -and $older[0].VersionMax -eq $release.msiVersion -and [int]$older[0].Attributes -eq 0 -and $older[0].Remove -eq 'ALL' -and [version]$oldProperties.ProductVersion -lt [version]$older[0].VersionMax) "Upgrade range includes baseline $($oldProperties.ProductVersion) without migrating advertised feature state" Assert-Package ($newer.Count -eq 1 -and $newer[0].VersionMin -eq $release.msiVersion -and [int]$newer[0].Attributes -eq 2 -and @($tables.LaunchCondition | Where-Object Condition -eq 'Installed OR NOT NEWERPRODUCTS').Count -eq 1) 'Newer versions are detected without removal and blocked from downgrade' $runtime=Get-Content -Raw (Join-Path $PackagePath 'Agent\PlotDirector.Companion.Agent.runtimeconfig.json') | ConvertFrom-Json $deps=Get-Content -Raw (Join-Path $PackagePath 'Agent\PlotDirector.Companion.Agent.deps.json') | ConvertFrom-Json diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 index feadcc6d..8289f3c9 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Test-UpgradeRegression.ps1 @@ -44,7 +44,7 @@ foreach($scenario in @(@{name='version10 advertised-feature major upgrade';regis Assert-Upgrade ($properties -match '(^| )ADDLOCAL=Complete( |$)' -and $properties -match 'REINSTALLMODE=vamus' -and $properties -notmatch 'ADVERTISE=') "Compiled bootstrapper requests local files: $($scenario.name)" 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.12'},@{word='1.0.0.13';agent='1.0.0.13'},@{word=$release.version;agent='1.0.0.10'},@{word='1.0.0.10';agent=$release.version})){ +foreach($versions in @(@{word='1.0.0.10';agent='1.0.0.10'},@{word='1.0.0.12';agent='1.0.0.12'},@{word='1.0.0.13';agent='1.0.0.13'},@{word='1.0.0.14';agent='1.0.0.14'},@{word=$release.version;agent='1.0.0.10'},@{word='1.0.0.10';agent=$release.version})){ $message=$null;try{$policy.GetMethod('VerifyVersions').Invoke($null,@($release.version,$versions.word,$versions.agent))}catch{$message=$_.Exception.GetBaseException().Message} Assert-Upgrade ($message.Contains('Expected '+$release.version) -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)" }