From 5dcf9b80d451c1ce94e21e90fba3151d1f5cf2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Tue, 14 Jul 2026 04:58:43 +0800 Subject: [PATCH] fix(desktop): accept missing shared install paths --- desktop/build/recover-legacy-install-data.ps1 | 4 ++-- scripts/pr/release-workflow.test.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop/build/recover-legacy-install-data.ps1 b/desktop/build/recover-legacy-install-data.ps1 index 766baa76..f314de4d 100644 --- a/desktop/build/recover-legacy-install-data.ps1 +++ b/desktop/build/recover-legacy-install-data.ps1 @@ -293,7 +293,7 @@ function Get-ExistingInstallDirs { } function Get-PotentialInstallDirs { - param([string[]]$InstallDirs) + param([AllowEmptyString()][string[]]$InstallDirs) $seen = New-Object 'System.Collections.Generic.HashSet[string]' ([StringComparer]::OrdinalIgnoreCase) $result = New-Object 'System.Collections.Generic.List[string]' @@ -805,7 +805,7 @@ function Run-SelfTest { New-Item -ItemType Directory -Path $perUserExternalTarget -Force | Out-Null New-Item -ItemType Junction -Path $perUserAppPayload -Target $perUserExternalTarget | Out-Null $perUserResult = Invoke-LegacyRecovery ` - -InstallDirs @($perUserInstall) ` + -InstallDirs @($perUserInstall) -SharedInstallDirs @('') ` -UserDataDir (Join-Path $testRoot 'per-user app data') ` -RecoveryRoot (Join-Path $testRoot 'per-user recovery') -ProcessName $ProcessName ` -ActiveConfigDir '' -SkipProcessCheck diff --git a/scripts/pr/release-workflow.test.ts b/scripts/pr/release-workflow.test.ts index fb6dd91a..dc7cbdc1 100644 --- a/scripts/pr/release-workflow.test.ts +++ b/scripts/pr/release-workflow.test.ts @@ -518,6 +518,7 @@ describe('release desktop workflow', () => { expect(installerHook).toContain('Quit') expect(recoveryHelper).toContain('function Get-LegacyActiveSource') expect(recoveryHelper).toContain('function Get-PotentialInstallDirs') + expect(recoveryHelper).toContain('param([AllowEmptyString()][string[]]$InstallDirs)') expect(recoveryHelper).toContain('function Assert-NoUndiscoveredLegacySources') expect(recoveryHelper).toContain('function Assert-NoRunningApplication') expect(recoveryHelper).toContain('function Get-TreeManifest')