From b92df356194d4dc9c7e6a6e73a40c48e4f41527e Mon Sep 17 00:00:00 2001 From: shimmyshimmer Date: Tue, 7 Jul 2026 02:24:35 -0700 Subject: [PATCH] Harden Studio install id repair cleanup --- install.ps1 | 1 + tests/test_studio_install_workspace_guard.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/install.ps1 b/install.ps1 index f285d5099e..c6d4045896 100644 --- a/install.ps1 +++ b/install.ps1 @@ -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' diff --git a/tests/test_studio_install_workspace_guard.py b/tests/test_studio_install_workspace_guard.py index ad315423f5..f25466d594 100644 --- a/tests/test_studio_install_workspace_guard.py +++ b/tests/test_studio_install_workspace_guard.py @@ -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"