Fix MSIX singing issue

"error 0x8007000B: The signature hash method specified (SHA512) must match the hash method used in the app package block map (SHA256)."
"The hashAlgorithm specified in the /fd parameter is incorrect. Rerun SignTool using hashAlgorithm that matches the app package block map (used to create the app package)"

Ref: https://learn.microsoft.com/en-us/windows/msix/package/signing-known-issues

Fix https://github.com/notepad-plus-plus/nppShell/issues/70
This commit is contained in:
Don HO 2025-08-10 13:08:47 +02:00
parent 5542066816
commit b56ac80ff7

View File

@ -22,6 +22,10 @@ if %SIGN% == 0 goto NoSign
set signtoolWin11="C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe"
set signBinary=%signtoolWin11% sign /fd SHA512 /tr http://timestamp.acs.microsoft.com /td sha512 /a /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/
REM macro is used to sign NppShell.dll & NppShell.msix with hash algorithm SHA256, due to signtool.exe bug:
REM https://learn.microsoft.com/en-us/windows/msix/package/signing-known-issues
set signBinarySha256=%signtoolWin11% sign /fd SHA256 /tr http://timestamp.acs.microsoft.com /td sha512 /a /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/
%signBinary% ..\bin\notepad++.exe
If ErrorLevel 1 goto End
@ -30,15 +34,17 @@ If ErrorLevel 1 goto End
%signBinary% ..\binarm64\notepad++.exe
If ErrorLevel 1 goto End
%signBinary% ..\bin\NppShell.x86.dll
%signBinarySha256% ..\bin\NppShell.x86.dll
If ErrorLevel 1 goto End
rem %signBinary% ..\bin64\NppShell.msix
%signBinarySha256% ..\bin64\NppShell.msix
If ErrorLevel 1 goto End
%signBinary% ..\bin64\NppShell.x64.dll
%signBinarySha256% ..\bin64\NppShell.x64.dll
If ErrorLevel 1 goto End
rem %signBinary% ..\binarm64\NppShell.msix
%signBinarySha256% ..\binarm64\NppShell.msix
If ErrorLevel 1 goto End
%signBinary% ..\binarm64\NppShell.arm64.dll
%signBinarySha256% ..\binarm64\NppShell.arm64.dll
If ErrorLevel 1 goto End
%signBinary% ..\bin\plugins\Config\nppPluginList.dll