summaryrefslogtreecommitdiffstats
path: root/packaging/windows/package.ps1
blob: 15ee29a122105e0abbc14d48ad336ab6044cd72f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Package the build

#Requires -Version 4.0

$ErrorActionPreference = "Stop"

. "$PSScriptRoot\functions.ps1"

$msysbash = Get-MSYS2Bash "$msysprefix"
$env:CHERE_INVOKING = 'yes'

& $msysbash -l "$PSScriptRoot\package-windows.sh"

if ($LastExitcode -ne 0) {
    exit 1
}

if ($null -eq $env:BUILD_DIR) {
    $builddir = & $msysbash -l "$PSScriptRoot\get-win-build-path.sh"

    if ($LastExitcode -ne 0) {
        exit 1
    }
} else {
    $builddir = $env:BUILD_DIR
}

Push-Location "$builddir"

$wixarch = "x64"

wix build -arch $wixarch -ext WixToolset.Util.wixext -ext WixToolset.UI.wixext -out "$PSScriptRoot\netdata-$wixarch.msi" netdata.wxs

if ($LastExitcode -ne 0) {
    Pop-Location
    exit 1
}

Pop-Location