mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-18 22:16:52 +00:00
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.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user