OpenRCT2/setenv.ps1

39 lines
1.1 KiB
PowerShell
Raw Normal View History

2015-12-12 19:55:10 +01:00
###########################################################
# Setups a PowerShell environment for OpenRCT2 development
2015-12-12 19:55:10 +01:00
###########################################################
2015-12-12 20:41:54 +01:00
# Setup
$ErrorActionPreference = "Stop"
$rootPath = Split-Path $Script:MyInvocation.MyCommand.Path
2015-12-12 19:55:10 +01:00
$scriptsPath = "$rootPath\scripts\ps"
2015-12-12 20:41:54 +01:00
Import-Module "$scriptsPath\common.psm1" -DisableNameChecking
Write-Host "Setting up OpenRCT2 development environment for Windows" -ForegroundColor Cyan
$appExists = @{}
$appExists["msbuild"] = AppExists("msbuild");
$appExists["7za"] = AppExists("7za");
$appExists["7z"] = AppExists("7z");
if (-not $appExists["msbuild"])
{
2015-12-12 20:41:54 +01:00
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64")
{
$lookPath = Join-Path ${env:ProgramFiles(x86)} "MSBuild\14.0\Bin\amd64\MSBuild.exe"
}
else
{
$lookPath = Join-Path $env:ProgramFiles "MSBuild\14.0\Bin\MSBuild.exe"
}
if (Test-Path $lookPath)
{
2015-12-12 20:41:54 +01:00
AddPath(Split-Path $lookPath)
}
else
{
Write-Host "Warning: msbuild not found, please include it in your PATH" -ForegroundColor Yellow
}
}
AddPath($scriptsPath)