Trying a different way for the password / certificate.

This commit is contained in:
Robin 2016-08-15 21:00:25 +02:00
commit 00532fb052
2 changed files with 4 additions and 13 deletions

View file

@ -36,6 +36,7 @@ $gitcommit=$env:APPVEYOR_REPO_COMMIT
if ( !$gitcommit ) {
$gitcommit = "abcdefghijklmnopqrstuvwxy"
}
$gitcommit=$gitcommit.SubString(0, [math]::Min($gitcommit.Length, 7))
$detailversion=$version + '-' + $gitcommit + " " + $buildType
$release=(([version]$version).build) % 2 -eq 1
@ -51,16 +52,6 @@ Function MD5($filename) {
return [System.BitConverter]::ToString($hash) -replace "-", ""
}
# Write the certificate to the file system, so signtool can use it
Function PrepareCertificate() {
$decodedContentBytes = [System.Convert]::FromBase64String($env:Certificate)
$decodedContentBytes | set-content "greenshot.pfx" -encoding byte
#$certutilArguments = @('-p', $env:CertificatePassword, '-importpfx', "greenshot.pfx")
#Start-Process -wait certutil -ArgumentList $certutilArguments -NoNewWindow
$secureString = ConvertTo-SecureString $env:CertificatePassword -AsPlainText -Force
Import-PfxCertificate -FilePath .\Greenshot.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $secureString
}
# Sign the specify file
Function SignWithCertificate($filename) {
Write-Host "Signing $filename"
@ -325,9 +316,6 @@ FillTemplates
echo "Generating MD5"
MD5Checksums | Set-Content "$(get-location)\Greenshot\bin\Release\checksum.MD5" -encoding UTF8
echo "Preparing certificate"
PrepareCertificate
echo "Signing executables"
SignBinaryFilesBeforeBuildingInstaller