Skip to content

Commit

Permalink
OpenSSL 1.0.2 to proper foder and simplify script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Finkelshteyn committed Jun 21, 2019
1 parent f8557cf commit ca88915
Showing 1 changed file with 34 additions and 57 deletions.
91 changes: 34 additions & 57 deletions scripts/Windows/install_openssl.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function GetUninstallString($productName) {
$110Letter = "k"
$111Letter = "c"
$102Letter = "s"

function GetUninstallString($productName) {
$x64items = @(Get-ChildItem "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
($x64items + @(Get-ChildItem "HKLM:SOFTWARE\wow6432node\Microsoft\Windows\CurrentVersion\Uninstall") `
| ForEach-object { Get-ItemProperty Microsoft.PowerShell.Core\Registry::$_ } `
Expand All @@ -9,22 +13,19 @@
function UninstallOpenSSL($productName) {
$uninstaller = GetUninstallString $productName
if($uninstaller) {
$uninstaller | % {
Write-Host "Uninstalling $productName..." -NoNewline
"$uninstaller /silent" | out-file "$env:temp\uninstall.cmd" -Encoding ASCII
"$_ /silent" | out-file "$env:temp\uninstall.cmd" -Encoding ASCII
& "$env:temp\uninstall.cmd"
del "$env:temp\uninstall.cmd"
Write-Host "OK"
}
}
}

UninstallOpenSSL "OpenSSL 1.0.2L (32-bit)"
UninstallOpenSSL "OpenSSL 1.0.2L (64-bit)"
UninstallOpenSSL "OpenSSL 1.0.2p (32-bit)"
UninstallOpenSSL "OpenSSL 1.0.2p (64-bit)"
UninstallOpenSSL "OpenSSL 1.1.0i (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.0i (64-bit)"
UninstallOpenSSL "OpenSSL 1.1.1 (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.1 (64-bit)"
UninstallOpenSSL "OpenSSL 1.0.2"
UninstallOpenSSL "OpenSSL 1.1.0"
UninstallOpenSSL "OpenSSL 1.1.1"

Remove-Item C:\OpenSSL-Win32 -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item C:\OpenSSL-Win64 -Recurse -Force -ErrorAction SilentlyContinue
Expand All @@ -33,86 +34,62 @@ Remove-Item C:\OpenSSL-v11-Win64 -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item C:\OpenSSL-v111-Win32 -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item C:\OpenSSL-v111-Win64 -Recurse -Force -ErrorAction SilentlyContinue



Write-Host "Installing OpenSSL 1.1.0 32-bit ..." -ForegroundColor Cyan
Write-Host "Installing OpenSSL 1.1.0$110Letter 32-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win32OpenSSL-1_1_0k.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win32OpenSSL-1_1_0k.exe', $exePath)
$exePath = "$env:temp\Win32OpenSSL-1_1_0$110Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win32OpenSSL-1_1_0$110Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-v11-Win32-temp
Write-Host "Installed" -ForegroundColor Green
Copy-Item C:\OpenSSL-v11-Win32-temp -Destination C:\OpenSSL-v11-Win32 -Recurse




Write-Host "Installing OpenSSL 1.1.0 64-bit ..." -ForegroundColor Cyan
Write-Host "Installing OpenSSL 1.1.0$110Letter 64-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win64OpenSSL-1_1_0k.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_1_0k.exe', $exePath)
$exePath = "$env:temp\Win64OpenSSL-1_1_0$110Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win64OpenSSL-1_1_0$110Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-v11-Win64-temp
Write-Host "Installed" -ForegroundColor Green
Copy-Item C:\OpenSSL-v11-Win64-temp -Destination C:\OpenSSL-v11-Win64 -Recurse

UninstallOpenSSL "OpenSSL 1.1.0$110Letter (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.0$110Letter (64-bit)"

UninstallOpenSSL "OpenSSL 1.1.0j (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.0j (64-bit)"




Write-Host "Installing OpenSSL 1.1.1 32-bit ..." -ForegroundColor Cyan
Write-Host "Installing OpenSSL 1.1.1$111Letter 32-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win32OpenSSL-1_1_1c.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win32OpenSSL-1_1_1c.exe', $exePath)
$exePath = "$env:temp\Win32OpenSSL-1_1_1$111Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win32OpenSSL-1_1_1$111Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-v111-Win32-temp
Write-Host "Installed" -ForegroundColor Green
Copy-Item C:\OpenSSL-v111-Win32-temp -Destination C:\OpenSSL-v111-Win32 -Recurse




Write-Host "Installing OpenSSL 1.1.1 64-bit ..." -ForegroundColor Cyan
Write-Host "Installing OpenSSL 1.1.1$111Letter 64-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win64OpenSSL-1_1_1c.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_1_1c.exe', $exePath)
$exePath = "$env:temp\Win64OpenSSL-1_1_1$111Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win64OpenSSL-1_1_1$111Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-v111-Win64-temp
Write-Host "Installed" -ForegroundColor Green
Copy-Item C:\OpenSSL-v111-Win64-temp -Destination C:\OpenSSL-v111-Win64 -Recurse

UninstallOpenSSL "OpenSSL 1.1.1$111Letter (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.1$111Letter (64-bit)"

UninstallOpenSSL "OpenSSL 1.1.1b (32-bit)"
UninstallOpenSSL "OpenSSL 1.1.1b (64-bit)"



Write-Host "Installing OpenSSL 1.0.x 32-bit ..." -ForegroundColor Cyan

Write-Host "Installing OpenSSL 1.0.2$102Letter 32-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win32OpenSSL-1_0_2s.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win32OpenSSL-1_0_2s.exe', $exePath)

$exePath = "$env:temp\Win32OpenSSL-1_0_2$102Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win32OpenSSL-1_0_2$102Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes
del $exePath

Write-Host "Installed" -ForegroundColor Green




Write-Host "Installing OpenSSL 1.0.x 64-bit ..." -ForegroundColor Cyan

Write-Host "Installing OpenSSL 1.0.2$102Letter 64-bit ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:temp\Win64OpenSSL-1_0_2s.exe"
(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2s.exe', $exePath)

$exePath = "$env:temp\Win64OpenSSL-1_0_2$102Letter.exe"
(New-Object Net.WebClient).DownloadFile("https://slproweb.com/download/Win64OpenSSL-1_0_2$102Letter.exe", $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent /verysilent /sp- /suppressmsgboxes
del $exePath

Write-Host "Installed" -ForegroundColor Green
Write-Host "Installed" -ForegroundColor Green

0 comments on commit ca88915

Please sign in to comment.