| 1 | # Package the build |
| 2 | |
| 3 | #Requires -Version 4.0 |
| 4 | |
| 5 | $ErrorActionPreference = "Stop" |
| 6 | |
| 7 | . "$PSScriptRoot\functions.ps1" |
| 8 | |
| 9 | $msysbash = Get-MSYS2Bash "$msysprefix" |
| 10 | $env:CHERE_INVOKING = 'yes' |
| 11 | |
| 12 | & $msysbash -l "$PSScriptRoot\package-windows.sh" |
| 13 | |
| 14 | if ($LastExitcode -ne 0) { |
| 15 | exit 1 |
| 16 | } |
| 17 | |
| 18 | if ($null -eq $env:BUILD_DIR) { |
| 19 | $builddir = & $msysbash -l "$PSScriptRoot\get-win-build-path.sh" |
| 20 | |
| 21 | if ($LastExitcode -ne 0) { |
| 22 | exit 1 |
| 23 | } |
| 24 | } else { |
| 25 | $builddir = $env:BUILD_DIR |
| 26 | } |
| 27 | |
| 28 | Push-Location "$builddir" |
| 29 | |
| 30 | $wixarch = "x64" |
| 31 | |
| 32 | wix build -arch $wixarch -ext WixToolset.Util.wixext -ext WixToolset.UI.wixext -out "$PSScriptRoot\netdata-$wixarch.msi" netdata.wxs |
| 33 | |
| 34 | if ($LastExitcode -ne 0) { |
| 35 | Pop-Location |
| 36 | exit 1 |
| 37 | } |
| 38 | |
| 39 | Pop-Location |