Skip to content

Commit 1f979b1

Browse files
committed
2025 SSEI
1 parent 4892957 commit 1f979b1

1 file changed

Lines changed: 42 additions & 31 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -82,56 +82,67 @@ jobs:
8282
echo "::add-mask::${SA_PASSWORD}"
8383
echo "SA_PASSWORD=${SA_PASSWORD}" >> "$GITHUB_ENV"
8484
85-
- name: Download SQL Server 2022 Express installer (Windows)
85+
- name: Download SQL Server 2025 Express installer (Windows)
8686
if: runner.os == 'Windows'
8787
shell: pwsh
8888
run: |
89-
$ssei = Join-Path $env:RUNNER_TEMP 'SQL2022-SSEI-Expr.exe'
89+
$ssei = Join-Path $env:RUNNER_TEMP 'SQL2025-SSEI-Expr.exe'
9090
$media = Join-Path $env:RUNNER_TEMP 'sql-media'
91-
# Stable Microsoft fwlink for the SQL Server 2022 Express bootstrapper (SSEI)
91+
# Stable Microsoft fwlink redirecting to the SQL Server 2025 Express bootstrapper (SSEI)
9292
Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?linkid=2216019' -OutFile $ssei
93-
# Tell the bootstrapper to download (not install) the full installer package
94-
& $ssei /Quiet /Action=Download /Language=en-US /MediaPath=$media /MediaType=Core /HideProgressBar
95-
if ($LASTEXITCODE -ne 0) { throw "SSEI download failed with exit code $LASTEXITCODE" }
93+
Write-Host "Downloaded SSEI: $((Get-Item $ssei).Length) bytes"
94+
95+
# Run SSEI in download-only mode. Use Start-Process -Wait so we get a real exit code
96+
# (PowerShell's `&` returns asynchronously for installer-class executables).
97+
$p = Start-Process -FilePath $ssei -Wait -PassThru -ArgumentList @(
98+
'/Quiet',
99+
'/Action=Download',
100+
'/Language=en-US',
101+
"/MediaPath=$media",
102+
'/MediaType=Core',
103+
'/HideProgressBar'
104+
)
105+
if ($p.ExitCode -ne 0) { throw "SSEI download failed with exit code $($p.ExitCode)" }
106+
107+
Write-Host "=== Media directory contents ==="
96108
Get-ChildItem $media
97109
98110
- name: Install SQL Server Express with SA auth (Windows)
99111
if: runner.os == 'Windows'
100112
shell: pwsh
101113
run: |
102114
$media = Join-Path $env:RUNNER_TEMP 'sql-media'
103-
# SSEI produces a self-extracting installer (SQLEXPR*.exe). Extract its contents first.
104115
$selfExtract = Get-ChildItem $media -Filter 'SQLEXPR*.exe' | Select-Object -First 1
105116
if (-not $selfExtract) { throw "Installer EXE not found in $media" }
117+
106118
$extracted = Join-Path $env:RUNNER_TEMP 'sql-extracted'
107119
Write-Host "Extracting $($selfExtract.FullName) -> $extracted"
108-
& $selfExtract.FullName /Q /X:"$extracted" | Out-Null
109-
# Self-extraction is async; wait for setup.exe to appear
110-
$deadline = (Get-Date).AddMinutes(2)
111-
while (-not (Test-Path (Join-Path $extracted 'setup.exe'))) {
112-
if ((Get-Date) -gt $deadline) { throw "Extraction did not complete in time" }
113-
Start-Sleep -Seconds 2
114-
}
120+
$extract = Start-Process -FilePath $selfExtract.FullName -Wait -PassThru `
121+
-ArgumentList '/Q', "/X:$extracted"
122+
if ($extract.ExitCode -ne 0) { throw "Extraction failed with exit code $($extract.ExitCode)" }
115123
116124
$setup = Join-Path $extracted 'setup.exe'
125+
if (-not (Test-Path $setup)) { throw "setup.exe not found at $setup" }
126+
117127
Write-Host "Running $setup with SECURITYMODE=SQL"
118-
& $setup `
119-
/Q `
120-
/ACTION=Install `
121-
/FEATURES=SQLEngine `
122-
/INSTANCENAME=SQLEXPRESS `
123-
/SECURITYMODE=SQL `
124-
/SAPWD="$env:SA_PASSWORD" `
125-
/TCPENABLED=1 `
126-
/IACCEPTSQLSERVERLICENSETERMS `
127-
/UPDATEENABLED=False `
128-
/SQLSYSADMINACCOUNTS="BUILTIN\Administrators"
129-
if ($LASTEXITCODE -ne 0) {
130-
Write-Host "Setup failed with exit code $LASTEXITCODE"
131-
# Surface the most recent setup logs to make failures diagnosable
132-
$logDir = 'C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log'
133-
if (Test-Path $logDir) {
134-
Get-ChildItem $logDir -Recurse -Filter 'Summary*.txt' |
128+
$install = Start-Process -FilePath $setup -Wait -PassThru -ArgumentList @(
129+
'/Q',
130+
'/ACTION=Install',
131+
'/FEATURES=SQLEngine',
132+
'/INSTANCENAME=SQLEXPRESS',
133+
'/SECURITYMODE=SQL',
134+
"/SAPWD=$env:SA_PASSWORD",
135+
'/TCPENABLED=1',
136+
'/IACCEPTSQLSERVERLICENSETERMS',
137+
'/UPDATEENABLED=False',
138+
'/SQLSYSADMINACCOUNTS=BUILTIN\Administrators'
139+
)
140+
141+
if ($install.ExitCode -ne 0) {
142+
Write-Host "Setup failed with exit code $($install.ExitCode)"
143+
$logRoot = 'C:\Program Files\Microsoft SQL Server'
144+
if (Test-Path $logRoot) {
145+
Get-ChildItem $logRoot -Recurse -Filter 'Summary*.txt' -ErrorAction SilentlyContinue |
135146
Sort-Object LastWriteTime -Descending | Select-Object -First 1 |
136147
ForEach-Object { Write-Host "=== $($_.FullName) ==="; Get-Content $_.FullName }
137148
}

0 commit comments

Comments
 (0)