fix(desktop): avoid full install scan on user upgrades

This commit is contained in:
程序员阿江(Relakkes)
2026-07-14 04:42:14 +08:00
parent 406f603015
commit 835213da53
3 changed files with 31 additions and 6 deletions
+3
View File
@@ -514,6 +514,7 @@ describe('release desktop workflow', () => {
expect(installerHook).toContain('Var ccHahaPerMachineInstallLocation')
expect(installerHook).toMatch(/!macro CcHahaRunLegacyRecovery[\s\S]*ReadRegStr \$ccHahaPerUserInstallLocation[\s\S]*\$ccHahaPerUserUninstallString == ""[\s\S]*No registered installation needs legacy data recovery[\s\S]*Call CcHahaRecoverLegacy/)
expect(installerHook).toContain('SetErrorLevel 20')
expect(installerHook).toContain('/SD IDOK')
expect(installerHook).toContain('Quit')
expect(recoveryHelper).toContain('function Get-LegacyActiveSource')
expect(recoveryHelper).toContain('function Get-PotentialInstallDirs')
@@ -529,6 +530,8 @@ describe('release desktop workflow', () => {
expect(recoveryHelper).toContain('Multiple distinct legacy data sources')
expect(recoveryHelper).toContain('Active CLAUDE_CONFIG_DIR is managed outside Claude Code Haha')
expect(recoveryHelper).toContain('Test-LexicalPathAtOrBelow')
expect(recoveryHelper).toContain('-SharedInstallDirs @($PerMachineInstallDir)')
expect(recoveryHelper).toContain('per-user default-mode reinstall scanned the packaged application tree')
expect(recoveryHelper).toContain('untrusted-elevated')
expect(recoveryHelper).toContain('External CLAUDE_CONFIG_DIR is active while install-contained legacy data still exists')
expect(recoveryHelper).toMatch(/\$source = Get-UnsafeLegacySource[\s\S]*Assert-NoRunningApplication/)