Skip to content

Commit

Permalink
fix(inno): sign installer with signtool
Browse files Browse the repository at this point in the history
this effectively disables signing the uninstaller
as somehow inno setup doesn't forward environment
variables to the subshell used to run signtool. As
we can't authenticate using environment variables
that way, we also can't sign with our new
certificate. Future thought will need to be given.
  • Loading branch information
JanDeDobbeleer committed Nov 16, 2024
1 parent bf8732c commit 02e819f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion packages/inno/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ $content = $content.Replace('<VERSION>', $Version)
$ISSName = ".oh-my-posh-$Architecture-$Version.iss"
$content | Out-File -Encoding 'UTF8' $ISSName

# clean paths
$signtool = $signtool -Replace '\\', '/'
$signtoolDlib = $signtoolDlib -Replace '\\', '/'

# package content
$installer = "install-$Architecture"
ISCC.exe /F$installer "/Ssigntool=$signtool sign /v /debug /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib $signtoolDlib /dmdf ./metadata.json `$f" $ISSName
ISCC.exe /F$installer $ISSName

# sign installer
& "$signtool" sign /v /debug /fd SHA256 /tr 'http://timestamp.acs.microsoft.com' /td SHA256 /dlib "$signtoolDlib" /dmdf ../../src/metadata.json "./Output/$installer.exe"

# get hash
$zipHash = Get-FileHash "Output/$installer.exe" -Algorithm SHA256
$zipHash.Hash | Out-File -Encoding 'UTF8' "Output/$installer.exe.sha256"
2 changes: 0 additions & 2 deletions packages/inno/oh-my-posh.iss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ UninstallDisplayIcon={app}\bin\oh-my-posh.exe
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
ChangesEnvironment=yes
SignTool=signtool
SignedUninstaller=yes
CloseApplications=no

[Files]
Expand Down

0 comments on commit 02e819f

Please sign in to comment.