Skip to content

Commit febcdc6

Browse files
[Windows] Rework MySQL installation script (#8398)
1 parent 0b7b414 commit febcdc6

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

images/win/scripts/Installers/Install-MysqlCli.ps1

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
$InstallerName = "vcredist_x64.exe"
88
$InstallerURI = "https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/${InstallerName}"
99
$ArgumentList = ("/install", "/quiet", "/norestart")
10+
$InstallerSignatureThumbrint = "3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
1011

11-
Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
12+
Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList -ExpectedSignature $InstallerSignatureThumbrint
1213

13-
## Downloading mysql
14+
# Downloading mysql
1415
[version]$MysqlVersion = (Get-ToolsetContent).mysql.version
1516
$MysqlVersionMajorMinor = $MysqlVersion.ToString(2)
1617

@@ -20,20 +21,13 @@ if ($MysqlVersion.Build -lt 0) {
2021
}
2122

2223
$MysqlVersionFull = $MysqlVersion.ToString()
23-
$MysqlVersionUrl = "https://cdn.mysql.com/Downloads/MySQL-${MysqlVersionMajorMinor}/mysql-${MysqlVersionFull}-winx64.zip"
24+
$MysqlVersionUrl = "https://cdn.mysql.com/Downloads/MySQL-${MysqlVersionMajorMinor}/mysql-${MysqlVersionFull}-winx64.msi"
2425

25-
$MysqlArchPath = Start-DownloadWithRetry -Url $MysqlVersionUrl -Name "mysql.zip"
26-
27-
# Expand the zip
28-
Extract-7Zip -Path $MysqlArchPath -DestinationPath "C:\"
29-
30-
# Rename mysql-version to mysql folder
31-
$MysqlPath = "C:\mysql"
32-
Invoke-SBWithRetry -Command {
33-
Rename-Item -Path "C:\mysql-${MysqlVersionFull}-winx64" -NewName $MysqlPath -ErrorAction Stop
34-
}
26+
Install-Binary -Url $MysqlVersionUrl -Name "mysql-${MysqlVersionFull}-winx64.msi" -ExpectedSignature (Get-ToolsetContent).mysql.signature
3527

3628
# Adding mysql in system environment path
29+
$MysqlPath = $(Get-ChildItem -Path "C:\PROGRA~1\MySQL" -Directory)[0].FullName
30+
3731
Add-MachinePathItem "${MysqlPath}\bin"
3832

3933
Invoke-PesterTests -TestFile "Databases" -TestName "MySQL"

images/win/toolsets/toolset-2019.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@
460460
"version": "3.8"
461461
},
462462
"mysql": {
463-
"version": "5.7"
463+
"version": "5.7",
464+
"signature": "DD34D7C71F160972DE0CE25B695A0D6A9C95BD91"
464465
},
465466
"mongodb": {
466467
"version": "5.0",

images/win/toolsets/toolset-2022.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@
396396
"version": "3.8"
397397
},
398398
"mysql": {
399-
"version": "8.0"
399+
"version": "8.0",
400+
"signature": "DD34D7C71F160972DE0CE25B695A0D6A9C95BD91"
400401
},
401402
"mongodb": {
402403
"version": "5.0",

0 commit comments

Comments
 (0)