From e95bd57e68993d379ab17120f30ce360d84720b8 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Mon, 14 Dec 2015 21:17:54 +0000 Subject: [PATCH] add installer creation in publish script --- distribution/windows/install.nsi | 4 ++-- scripts/ps/publish.ps1 | 40 ++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/distribution/windows/install.nsi b/distribution/windows/install.nsi index ab98ba78d1..36ee42ca72 100644 --- a/distribution/windows/install.nsi +++ b/distribution/windows/install.nsi @@ -1,8 +1,8 @@ # Version numbers to update !define /ifndef APPV_MAJOR 0 !define /ifndef APPV_MINOR 0 -!define /ifndef APPV_MAINT 3 -!define /ifndef APPV_BUILD 1 +!define /ifndef APPV_MAINT 4 +!define /ifndef APPV_BUILD 0 !define /ifndef APPV_EXTRA "-beta" !define APPNAME "OpenRCT2" ; Define application name diff --git a/scripts/ps/publish.ps1 b/scripts/ps/publish.ps1 index 956e35287b..0cb8f90179 100644 --- a/scripts/ps/publish.ps1 +++ b/scripts/ps/publish.ps1 @@ -7,7 +7,8 @@ param ( [string]$Server = "", [string]$BuildNumber = "", - [string]$GitBranch = "" + [string]$GitBranch = "", + [switch]$Installer = $false ) # Setup @@ -97,6 +98,41 @@ function do-package() Remove-Item -Force -Recurse $tempDir -ErrorAction SilentlyContinue } +# Installer +function do-installer() +{ + Write-Host "Publishing OpenRCT2..." -ForegroundColor Cyan + $artifactsDir = "$rootPath\artifacts" + $installerDir = "$rootPath\distribution\windows" + + # Create artifacts directory + New-Item -Force -ItemType Directory $artifactsDir > $null + + # Create installer + & "$installerDir\build.ps1" + if ($LASTEXITCODE -ne 0) + { + Write-Host "Failed to create installer." -ForegroundColor Red + exit 1 + } + + $binaries = (Get-ChildItem "$installerDir\*.exe" | Sort-Object -Property LastWriteTime -Descending) + if ($binaries -eq 0) + { + Write-Host "Unable to find created installer." -ForegroundColor Red + exit 1 + } + + Copy-Item $binaries[0].FullName $artifactsDir +} + do-prepareSource do-build -do-package +if ($Installer) +{ + do-installer +} +else +{ + do-package +}