Harden Studio install id repair cleanup

This commit is contained in:
shimmyshimmer 2026-07-07 02:24:35 -07:00
commit b92df35619
2 changed files with 4 additions and 0 deletions

View file

@ -654,6 +654,7 @@ function Repair-StudioInstallId {
if (`$_ExpectedStudioRootId.Length -ne 64 -or `$_ExpectedStudioRootId -notmatch '^[0-9a-f]{64}$') { return }
try {
`$idTmp = `$null
`$studioHome = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent `$studioExe))
`$idDir = Join-Path `$studioHome 'share'
`$idFile = Join-Path `$idDir 'studio_install_id'

View file

@ -532,6 +532,9 @@ def test_install_ps1_launcher_repairs_missing_studio_install_id():
assert (
"`$_ExpectedStudioRootId.Length -ne 64" in launcher
), "repair helper must reject malformed baked ids"
assert (
"`$idTmp = `$null" in launcher
), "repair helper must initialize `$idTmp before catch cleanup"
assert (
"`$current -match '^[0-9a-f]{64}$'" in launcher
), "repair helper must preserve a different valid install id"