From 1bf8de27b4025aa62357a5b8fe88ee5e489862d0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 21 Aug 2024 18:33:41 +0200 Subject: [PATCH] Replace `osk` with `cmd` during debugging --- scripts/Windows/OS/Install.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 4b6892ef..4f81c20c 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -46,6 +46,20 @@ $null = New-Module { break; } ([SetupStage]::Initialize) { + if ($env:DEBUG) { + & { + $sys32 = "$env:WINDIR/System32"; + $osk = "$sys32/osk.exe"; + $cmd = "$sys32/cmd.exe"; + + if ((Get-FileHash $osk) -ne (Get-FileHash $cmd)) { + Rename-Item $osk "${osk}_"; + Copy-Item $cmd $osk; + continue; + } + }; + } + if (-not ((Test-Command "choco") -and (Test-Command "refreshenv"))) { Invoke-Hook "Install-Chocolatey" -Fallback { # Install chocolatey