mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
- Updated the installation script to conditionally handle release builds by enabling debug information in the release profile. - Added logic to copy the PDB file alongside the executable to the installation directory, improving debugging capabilities.
26 lines
891 B
PowerShell
26 lines
891 B
PowerShell
#Requires -Version 5.1
|
|
|
|
param([string]$Mode = "release")
|
|
|
|
$InstallDir = "C:\Program Files\Rojo"
|
|
|
|
Set-Location $PSScriptRoot
|
|
if ($Mode -eq "release") {
|
|
cargo build --release --config "profile.release.debug=true"
|
|
} else {
|
|
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 New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
|
|
gsudo Copy-Item "$Rojo" "$InstallDir\"
|
|
gsudo Copy-Item ".\target\$Mode\rojo.pdb" "$InstallDir\"
|
|
|
|
$MachinePath = [Environment]::GetEnvironmentVariable("Path", "Machine")
|
|
if ($MachinePath -notlike "*$InstallDir*") {
|
|
gsudo [Environment]::SetEnvironmentVariable "Path" "$MachinePath;$InstallDir" "Machine"
|
|
Write-Host "Added '$InstallDir' to system PATH"
|
|
}
|