OpenRCT2/scripts/ps/appveyor_install.ps1

52 lines
1.6 KiB
PowerShell
Raw Normal View History

2016-05-04 21:48:07 +02:00
#########################################################
# Script to setup OpenRCT2 for building on AppVeyor
#########################################################
function Check-ExitCode
{
if ($LASTEXITCODE -ne 0)
{
$host.SetShouldExit($LASTEXITCODE)
}
}
2016-05-04 21:48:07 +02:00
if ($env:ENCKEY)
{
2016-05-04 23:43:49 +02:00
if (-not (Test-Path "secure-file"))
{
Write-Host "Downloading secure-file from NuGet..." -ForegroundColor Cyan
nuget install secure-file -ExcludeVersion
}
Write-Host "Decrypting code signing key..." -ForegroundColor Cyan
2016-05-04 21:48:07 +02:00
secure-file\tools\secure-file -decrypt distribution\windows\code-sign-key-openrct2.org.pfx.enc -secret $env:ENCKEY
Check-ExitCode
2016-05-04 21:48:07 +02:00
}
# Check if OpenRCT2.org API security token is available
2016-08-25 21:28:30 +02:00
if (${env:OPENRCT2_ORG_TOKEN})
2016-05-04 21:48:07 +02:00
{
if (-not (Test-Path "C:\ProgramData\chocolatey\lib\nsis.portable"))
{
2016-05-04 23:43:49 +02:00
Write-Host "Downloading NSIS from chocolatey..." -ForegroundColor Cyan
cinst nsis.portable --version=3.01-beta1 > $null
if ($LASTEXITCODE -ne 0)
{
Get-Content "C:\ProgramData\chocolatey\logs\chocolatey.log"
$host.SetShouldExit(1)
}
2016-05-04 21:48:07 +02:00
2016-05-04 23:43:49 +02:00
Write-Host "Downloading KillProcDLL for NSIS..." -ForegroundColor Cyan
curl "http://nsis.sourceforge.net/mediawiki/images/5/53/KillProcDll%26FindProcDll.zip" -OutFile nsisxtra.zip
Check-ExitCode
7z x nsisxtra.zip > $null
Check-ExitCode
cp FindProcDLL.dll "C:\ProgramData\chocolatey\lib\nsis.portable\tools\nsis-3.0b1\Plugins\x86-ansi"
}
2016-05-04 21:48:07 +02:00
}
2016-08-26 00:38:48 +02:00
else
{
# Don't build the NSIS installer for non-uploaded builds
${env:NO_NSIS} = "true"
}