Files
ChocolateyPackages/OpenSSL.Light/tools/chocolateyInstall.ps1
2014-11-13 07:52:04 -08:00

38 lines
1019 B
PowerShell

$package = 'OpenSSL.Light'
try {
#default is to plop in c:\ -- yuck!
$installDir = Join-Path $Env:ProgramFiles 'OpenSSL'
$params = @{
packageName = $package;
fileType = 'exe';
#InnoSetup - http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
silentArgs = '/silent', '/verysilent', '/sp-', '/suppressmsgboxes',
"/DIR=`"$installDir`"";
url = 'https://slproweb.com/download/Win32OpenSSL_Light-1_0_1j.exe'
url64bit = 'https://slproweb.com/download/Win64OpenSSL_Light-1_0_1j.exe'
}
Install-ChocolateyPackage @params
if (!$Env:OPENSSL_CONF)
{
$configPath = Join-Path $installDir 'bin\openssl.cfg'
if (Test-Path $configPath)
{
[Environment]::SetEnvironmentVariable(
'OPENSSL_CONF', $configPath, 'User')
Write-Host "Configured OPENSSL_CONF variable as $configPath"
}
}
Write-ChocolateySuccess $package
} catch {
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}