From da6597f8fbd7049bc9aef1192f6660a2dd2ee31d Mon Sep 17 00:00:00 2001 From: Baipyrus <39416358+Baipyrus@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:23:18 +0200 Subject: [PATCH 1/2] replace $programDir with $programPath --- install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 24beade..bace686 100644 --- a/install.ps1 +++ b/install.ps1 @@ -53,7 +53,7 @@ if ($isRelease) # Add program to PATH for cli application $userpath = [System.Environment]::GetEnvironmentVariable("PATH", "User") -$userpath = $userpath + ";$programDir" +$userpath = $userpath + ";$programPath" [System.Environment]::SetEnvironmentVariable("PATH", $userpath, "User") # Create Startmenu Shortcut From 836a1de27ee1cabbf236cb436f4e6117b9506a62 Mon Sep 17 00:00:00 2001 From: Baipyrus <39416358+Baipyrus@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:31:07 +0200 Subject: [PATCH 2/2] conditionally add to user path on install --- install.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index bace686..44c4caa 100644 --- a/install.ps1 +++ b/install.ps1 @@ -53,8 +53,10 @@ if ($isRelease) # Add program to PATH for cli application $userpath = [System.Environment]::GetEnvironmentVariable("PATH", "User") -$userpath = $userpath + ";$programPath" -[System.Environment]::SetEnvironmentVariable("PATH", $userpath, "User") +if ($userpath.Split(";") -notcontains $programPath) { + $userpath = $userpath + ";$programPath" + [System.Environment]::SetEnvironmentVariable("PATH", $userpath, "User") +} # Create Startmenu Shortcut Write-Host "Creating shortcuts for easy access..." -ForegroundColor Cyan