diff --git a/chocolatey/signcode.install/sources/signcode.install/chocolateyInstall.ps1 b/chocolatey/signcode.install/sources/signcode.install/chocolateyInstall.ps1 index 9868752..8165582 100644 --- a/chocolatey/signcode.install/sources/signcode.install/chocolateyInstall.ps1 +++ b/chocolatey/signcode.install/sources/signcode.install/chocolateyInstall.ps1 @@ -6,16 +6,32 @@ $toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition); $DSigUrl = 'http://download.microsoft.com/download/4/7/e/47e8e7fb-9441-4887-988f-e259a443052d/Dsig.EXE'; $signcodePwdUrl = 'http://www.stephan-brenner.com/downloads/signcode-pwd/signcode-pwd_1_02.zip'; +$chocTempDir = $env:TEMP; +$tempDir = Join-Path -Path $chocTempDir -ChildPath $env:chocolateyPackageName; +if ( $env:chocolateyPackageVersion -ne $null ) { + $tempDir = Join-Path -Path $tempDir -ChildPath $env:chocolateyPackageVersion; +}; +if ( ![System.IO.Directory]::Exists($tempDir) ) { [System.IO.Directory]::CreateDirectory($tempDir) | Out-Null; }; +$filePath = Join-Path -Path $tempDir -ChildPath 'Dsig.zip'; + +$filePath = Get-ChocolateyWebFile ` + -packageName $packageName ` + -fileFullPath $filePath ` + -url $DSigUrl ` +; +Get-ChocolateyUnzip ` + -packageName $packageName ` + -fileFullPath "$filePath" ` + -destination $toolsDir ` +; + $packageArgs = @{ packageName = $packageName; unzipLocation = $toolsDir; - url = $DSigUrl; + url = $signcodePwdUrl; } Install-ChocolateyZipPackage @packageArgs; -$packageArgs.url = $signcodePwdUrl; -Install-ChocolateyZipPackage @packageArgs; - $exitCode = Start-ChocolateyProcessAsAdmin ` -statements @" `$DsigDllInstallFolder = [Environment]::GetFolderPath([Environment+SpecialFolder]::SystemX86);