2024-09-13 22:06:49 +00:00
|
|
|
# Learn more about .exe install scripts:
|
|
|
|
|
# http://fleetdm.com/learn-more-about/exe-install-scripts
|
2024-05-01 17:15:59 +00:00
|
|
|
|
2024-09-04 17:01:34 +00:00
|
|
|
$exeFilePath = "${env:INSTALLER_PATH}"
|
2024-05-01 17:15:59 +00:00
|
|
|
|
2024-09-17 22:32:14 +00:00
|
|
|
try {
|
|
|
|
|
|
2024-09-04 17:01:34 +00:00
|
|
|
# Add argument to install silently
|
|
|
|
|
# Argument to make install silent depends on installer,
|
|
|
|
|
# each installer might use different argument (usually it's "/S" or "/s")
|
|
|
|
|
$processOptions = @{
|
|
|
|
|
FilePath = "$exeFilePath"
|
|
|
|
|
ArgumentList = "/S"
|
|
|
|
|
PassThru = $true
|
|
|
|
|
Wait = $true
|
2024-05-01 17:15:59 +00:00
|
|
|
}
|
2024-09-07 13:07:22 +00:00
|
|
|
|
|
|
|
|
# Start process and track exit code
|
|
|
|
|
$process = Start-Process @processOptions
|
|
|
|
|
$exitCode = $process.ExitCode
|
2024-05-01 17:15:59 +00:00
|
|
|
|
2024-09-04 17:01:34 +00:00
|
|
|
# Prints the exit code
|
|
|
|
|
Write-Host "Install exit code: $exitCode"
|
2024-09-13 22:06:49 +00:00
|
|
|
Exit $exitCode
|
2024-09-17 22:32:14 +00:00
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
Write-Host "Error: $_"
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|