1name: "Install exe"
2description: "Download and install exe"
3inputs:
4 url:
5 description: "URL of the exe installer"
6 required: true
7 args:
8 description: "Installer arguments"
9 required: true
10 timeout:
11 description: "Timeout (in ms)"
12 required: false
13 default: "600000"
14
15runs:
16 using: "composite"
17 steps:
18 - name: Install EXE
19 shell: pwsh
20 run: |
21 $ErrorActionPreference = "Stop"
22 write-host "Downloading Installer EXE"
23 Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\temp-install.exe"
24 write-host "Installing"
25 $proc = Start-Process "${env:RUNNER_TEMP}\temp-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru
26 $completed = $proc.WaitForExit(${{ inputs.timeout }})
27 if (-not $completed) {
28 Write-Error "Installer timed out. Killing the process"
29 $proc.Kill()
30 exit 1
31 }
32 if ($proc.ExitCode -ne 0) {
33 Write-Error "Installer failed with exit code $($proc.ExitCode)"
34 exit 1
35 }
36 write-host "Completed installation"