Skip to content

Commit

Permalink
Sign the release files
Browse files Browse the repository at this point in the history
  • Loading branch information
flagbug committed Feb 21, 2015
1 parent 19af0ab commit 692326f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.pfx

# Releases folder for Squirrel.Windows and ClickOnce
/ClickOnceReleases
/SquirrelReleases
Expand Down
22 changes: 20 additions & 2 deletions Create-Release.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
param (
[switch]$includeUpdater = $false,
[switch]$noSync = $false
[switch]$noSync = $false,
[switch]$noSign = $false
)

Set-StrictMode -version Latest
Expand Down Expand Up @@ -96,7 +97,11 @@ If(Test-Path -Path $OutputSetupExe) {
Remove-Item -Confirm:$false $OutputSetupExe
}

&($Squirrel) --releasify $NuPkgPath -r $ReleasesFolder
$Pass = Read-Host 'Certificate Password:' -AsSecureString
$CertificatePath = "$PSScriptRoot\Espera.pfx"
$RealPass = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))

&($Squirrel) --releasify $NuPkgPath -r $ReleasesFolder -n "/a /f $CertificatePath /p $RealPass"

$SquirrelSetupExe = "$ReleasesFolder\EsperaSetup.exe"
If(Test-Path -Path $SquirrelSetupExe) {
Expand Down Expand Up @@ -146,6 +151,19 @@ $Shortcut.TargetPath = "$PortableAppPath\Espera.cmd"
$Shortcut.IconLocation = "$PortableAppPath\Icon.ico"
$Shortcut.Save()

if(!$noSign) {
# Get the executables we want to sign
$Executables = Get-ChildItem $PortableFolder -Filter *.exe -Recurse
$SignTool = Join-Path $SquirrelPackagePath "tools\Signtool.exe"

for ($i=0; $i -lt $Executables.Count; $i++) {
$FileName = $Executables[$i].FullName
Write-Host "Signing $FileName"

&($SignTool) sign -a -f $CertificatePath -p $RealPass $FileName
}
}

ZipFiles $ReleaseZip $PortableFolder

# ==================================== Cleanup
Expand Down

0 comments on commit 692326f

Please sign in to comment.