Skip to content

Commit b2c5a51

Browse files
committed
Support SQL Server 2025
1 parent a1ba032 commit b2c5a51

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
version:
2727
- 2019
2828
- 2022
29+
- 2025
2930

3031
runs-on: ${{ matrix.os }}
3132
steps:

install.ps1

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ param (
33
[string[]]$Components,
44
[bool]$ForceEncryption,
55
[string]$SaPassword,
6-
[ValidateSet("2019", "2022")]
6+
[ValidateSet("2019", "2022", "2025")]
77
[string]$Version
88
)
99

@@ -74,10 +74,13 @@ forceencryption = 1
7474

7575
switch ($Version) {
7676
"2019" {
77-
$Tag = "CU30-ubuntu-20.04"
77+
$Tag = "CU32-GDR3-ubuntu-20.04"
7878
}
7979
"2022" {
80-
$Tag = "CU17-ubuntu-22.04"
80+
$Tag = "CU21-ubuntu-22.04"
81+
}
82+
"2025" {
83+
$Tag = "RC1-ubuntu-24.04"
8184
}
8285
}
8386

@@ -99,17 +102,27 @@ forceencryption = 1
99102
$DownloadUrl = "https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLEXPR_x64_ENU.exe"
100103
$MajorVersion = 16
101104
}
105+
"2025" {
106+
$DownloadUrl = "https://download.microsoft.com/download/7ab8f535-7eb8-4b16-82eb-eca0fa2d38f3/SQL2025-SSEI-Expr.exe"
107+
$MajorVersion = 17
108+
}
102109
}
103110

104111
Invoke-WebRequest $DownloadUrl -OutFile "C:\Downloads\mssql.exe"
105-
Start-Process -Wait -FilePath "C:\Downloads\mssql.exe" -ArgumentList /qs, /x:"C:\Downloads\setup"
106-
C:\Downloads\setup\setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\System' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS
112+
113+
if ($MajorVersion -eq 17) {
114+
Start-Process -Wait -FilePath "C:\Downloads\mssql.exe" -ArgumentList /IACCEPTSQLSERVERLICENSETERMS,/ENU,/ACTION=Install,/quiet
115+
} else {
116+
Start-Process -Wait -FilePath "C:\Downloads\mssql.exe" -ArgumentList /qs, /x:"C:\Downloads\setup"
117+
C:\Downloads\setup\setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\System' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS
118+
}
107119

108120
Write-Host "Configuring SQL Express ..."
109121
stop-service MSSQL`$SQLEXPRESS
110122

111123
$InstancePath = "HKLM:\software\microsoft\microsoft sql server\mssql$MajorVersion.SQLEXPRESS\mssqlserver"
112124
$SuperSocketNetLibPath = "$InstancePath\supersocketnetlib"
125+
set-itemproperty -path "$SuperSocketNetLibPath\tcp" -name Enabled -value 1
113126
set-itemproperty -path "$SuperSocketNetLibPath\tcp\ipall" -name tcpdynamicports -value ''
114127
set-itemproperty -path "$SuperSocketNetLibPath\tcp\ipall" -name tcpport -value 1433
115128
set-itemproperty -path $InstancePath -name LoginMode -value 2
@@ -128,6 +141,13 @@ forceencryption = 1
128141
Set-ItemProperty $SuperSocketNetLibPath -Name "ForceEncryption" -Value 1
129142
}
130143

144+
# SQL Server 2025 no longer offers an option during installation to change the service account
145+
# when forcing encryption, the default service account is not allowed to read the certificate out of the certificate store
146+
# changing the service account to LocalSystem aligns it with the other two installation options
147+
if ($MajorVersion -eq 17) {
148+
sc.exe config "MSSQL`$SQLEXPRESS" obj="LocalSystem"
149+
}
150+
131151
Write-Host "Starting SQL Express ..."
132152
start-service MSSQL`$SQLEXPRESS
133153
& sqlcmd -Q "ALTER LOGIN sa with password='$SaPassword'; ALTER LOGIN sa ENABLE;"

0 commit comments

Comments
 (0)