Enhance installation script for conditional build modes

- 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.
This commit is contained in:
Joe 2026-01-24 04:41:05 -06:00
parent 9692c843e7
commit a1cba88b94

View file

@ -5,7 +5,11 @@ param([string]$Mode = "release")
$InstallDir = "C:\Program Files\Rojo"
Set-Location $PSScriptRoot
cargo build "--$Mode"
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" }
@ -13,6 +17,7 @@ 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*") {