mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
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:
parent
033dec4e18
commit
5cfc803094
1 changed files with 11 additions and 1 deletions
12
install.ps1
12
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"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue