fix(desktop): accept missing shared install paths

This commit is contained in:
程序员阿江(Relakkes) 2026-07-14 04:58:43 +08:00
parent d7de7d47c9
commit 5dcf9b80d4
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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')