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.

This commit is contained in:
Joe 2026-01-19 15:43:20 -06:00
parent 033dec4e18
commit 5cfc803094

View file

@ -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"
}