From 6bc6db6f312a9d42cc5978e2bcded6dd5cce9bc0 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 2 Nov 2025 02:26:28 -0500 Subject: [PATCH] fix(windows): add null check for ScriptDir in uninstall script detection Line 166 was calling Test-Path with null ScriptDir when running via irm | iex, causing 'Cannot bind argument to parameter Path because it is null' error. Added null check: if ($ScriptDir -and (Test-Path ...)) to safely skip to standalone mode when ScriptDir is null. --- install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 22a62669..b4a62da9 100644 --- a/install.ps1 +++ b/install.ps1 @@ -163,7 +163,7 @@ if ($InstallMethod -eq "standalone") { } # Install uninstall script -if (Test-Path "$ScriptDir\uninstall.ps1") { +if ($ScriptDir -and (Test-Path "$ScriptDir\uninstall.ps1")) { # Only copy if source and destination are different if ($ScriptDir -ne $CcsDir) { Copy-Item "$ScriptDir\uninstall.ps1" "$CcsDir\uninstall.ps1" -Force