From 5cfc803094fbaba68995bcc4549388e401cfcec4 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 19 Jan 2026 15:43:20 -0600 Subject: [PATCH] Add installation directory creation and PATH update in installation script. The script now ensures the installation directory exists before copying the Rojo executable and adds it to the system PATH if not already present, improving accessibility for users. --- install.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 95e237b1..b203f9bb 100644 --- a/install.ps1 +++ b/install.ps1 @@ -2,10 +2,20 @@ param([string]$Mode = "release") +$InstallDir = "C:\Program Files\Rojo" + Set-Location $PSScriptRoot cargo build "--$Mode" $Rojo = ".\target\$Mode\rojo.exe" & "$Rojo" build plugin.project.json --plugin Rojo.rbxm if ($LASTEXITCODE -ne 0) { throw "Plugin build failed" } + gsudo Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue -gsudo Copy-Item "$Rojo" "C:\Program Files\Rojo\" +gsudo New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null +gsudo Copy-Item "$Rojo" "$InstallDir\" + +$MachinePath = [Environment]::GetEnvironmentVariable("Path", "Machine") +if ($MachinePath -notlike "*$InstallDir*") { + gsudo [Environment]::SetEnvironmentVariable "Path" "$MachinePath;$InstallDir" "Machine" + Write-Host "Added '$InstallDir' to system PATH" +}