Harden Studio install id repair cleanup
This commit is contained in:
parent
c9914d5714
commit
b92df35619
2 changed files with 4 additions and 0 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue