-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (58 loc) · 2.69 KB
/
Copy pathtest-powershell.yml
File metadata and controls
63 lines (58 loc) · 2.69 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Test PowerShell Setup
on:
workflow_dispatch: # Manual trigger only
jobs:
test-installer-steps:
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: Test PowerShell availability
shell: cmd
run: |
echo Testing PowerShell versions...
powershell -Command "Write-Host 'Windows PowerShell works'"
where pwsh 2>nul && echo pwsh found || (echo pwsh not found - will use Windows PowerShell & exit /b 0)
- name: check INNO Setup installation
shell: powershell -ExecutionPolicy Bypass -File {0}
run: |
$innoPath = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
if (-not (Test-Path $innoPath)) {
Write-Host "INNO Setup 6 not found at $innoPath"
Write-Host "Downloading INNO Setup 6..."
$innoUrl = "https://files.jrsoftware.org/is/6/innosetup-6.3.3.exe"
$innoInstaller = "$env:TEMP\innosetup-6.3.3.exe"
Invoke-WebRequest -Uri $innoUrl -OutFile $innoInstaller
Write-Host "Installing INNO Setup 6..."
Start-Process -FilePath $innoInstaller -Args "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait
Write-Host "INNO Setup 6 installed successfully"
} else {
Write-Host "INNO Setup 6 found at $innoPath"
}
- name: Download VC++ Redistributable
shell: powershell -ExecutionPolicy Bypass -File {0}
run: |
$redistPath = "$env:TEMP\test-redist"
$redistFile = "$redistPath\vc_redist.x64.exe"
if (-not (Test-Path $redistFile)) {
Write-Host "VC++ Redistributable not found, downloading..."
New-Item -ItemType Directory -Force -Path $redistPath | Out-Null
$url = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
Invoke-WebRequest -Uri $url -OutFile $redistFile
Write-Host "Downloaded VC++ Redistributable to $redistFile"
} else {
Write-Host "VC++ Redistributable already exists at $redistFile"
}
- name: Verify VC++ Redistributable downloaded correctly
shell: powershell -ExecutionPolicy Bypass -File {0}
run: |
$redistFile = "$env:TEMP\test-redist\vc_redist.x64.exe"
if (Test-Path $redistFile) {
$fileInfo = Get-Item $redistFile
Write-Host "VC++ Redistributable found:"
Write-Host " Path: $($fileInfo.FullName)"
Write-Host " Size: $([math]::Round($fileInfo.Length / 1MB, 2)) MB"
Write-Host " Created: $($fileInfo.CreationTime)"
} else {
Write-Host "ERROR: VC++ Redistributable not found at $redistFile"
exit 1
}