From b56ac80ff776bcf8c4bb70af115f3847d5a334a9 Mon Sep 17 00:00:00 2001 From: Don HO Date: Sun, 10 Aug 2025 13:08:47 +0200 Subject: [PATCH] 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 --- PowerEditor/installer/packageAll.bat | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/PowerEditor/installer/packageAll.bat b/PowerEditor/installer/packageAll.bat index 635d83f57..997047330 100644 --- a/PowerEditor/installer/packageAll.bat +++ b/PowerEditor/installer/packageAll.bat @@ -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