| 1 | #Requires -Version 4.0 |
| 2 | |
| 3 | $ErrorActionPreference = "Stop" |
| 4 | |
| 5 | $ndPath = "C:\Program Files\Netdata\usr\bin\netdata.exe" |
| 6 | $lddPath = "C:\Program Files\Netdata\usr\bin\ldd.exe" |
| 7 | |
| 8 | if (Test-Path -Path $ndPath) { |
| 9 | Write-Output "$ndPath found, attempting to check linking" |
| 10 | |
| 11 | if (Test-Path -Path $lddPath) { |
| 12 | & $lddPath $ndPath | Tee-Object -Variable lddResult |
| 13 | |
| 14 | if ($LastExitCode -ne 0) { |
| 15 | Write-Output "Exit Code: $LastExitCode" |
| 16 | exit 1 |
| 17 | } |
| 18 | |
| 19 | if ($lddResult -match 'missing|not found') { |
| 20 | Write-Output "Libraries missing from install" |
| 21 | exit 1 |
| 22 | } else { |
| 23 | Write-Output "Linking OK" |
| 24 | } |
| 25 | } else { |
| 26 | Write-Output "$lddPath not found, unable to check linking" |
| 27 | exit 2 |
| 28 | } |
| 29 | } else { |
| 30 | Write-Output "$ndPath does not exist" |
| 31 | exit 1 |
| 32 | } |