From 1685c02a544220f1444fc0561776bfee3ab9562d Mon Sep 17 00:00:00 2001 From: cjee21 <77721854+cjee21@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:24:01 +0800 Subject: [PATCH] Windows GUI: Implement signing of uninstaller --- Source/Install/MediaInfo_GUI_Windows.nsi | 4 ++++ Source/Install/MediaInfo_GUI_Windows_i386.nsi | 4 ++++ Source/Install/MediaInfo_GUI_Windows_x64.nsi | 4 ++++ Source/Install/sign.cmd | 5 +++++ 4 files changed, 17 insertions(+) create mode 100644 Source/Install/sign.cmd diff --git a/Source/Install/MediaInfo_GUI_Windows.nsi b/Source/Install/MediaInfo_GUI_Windows.nsi index 8e9ba447b..d94afb372 100644 --- a/Source/Install/MediaInfo_GUI_Windows.nsi +++ b/Source/Install/MediaInfo_GUI_Windows.nsi @@ -37,6 +37,10 @@ SetCompressor /FINAL /SOLID lzma !include "MUI2.nsh" !define MUI_ABORTWARNING !define MUI_ICON "..\..\Source\Resource\Image\MediaInfo.ico" +!define MUI_UNICON "..\..\Source\Resource\Image\MediaInfo.ico" + +; Uninstaller signing +!uninstfinalize 'sign.cmd "%1" "MediaInfo Uninstaller"' ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" diff --git a/Source/Install/MediaInfo_GUI_Windows_i386.nsi b/Source/Install/MediaInfo_GUI_Windows_i386.nsi index 68108de87..0df4b2825 100644 --- a/Source/Install/MediaInfo_GUI_Windows_i386.nsi +++ b/Source/Install/MediaInfo_GUI_Windows_i386.nsi @@ -34,6 +34,10 @@ SetCompressor /FINAL /SOLID lzma !include "MUI2.nsh" !define MUI_ABORTWARNING !define MUI_ICON "..\..\Source\Resource\Image\MediaInfo.ico" +!define MUI_UNICON "..\..\Source\Resource\Image\MediaInfo.ico" + +; Uninstaller signing +!uninstfinalize 'sign.cmd "%1" "MediaInfo Uninstaller"' ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" diff --git a/Source/Install/MediaInfo_GUI_Windows_x64.nsi b/Source/Install/MediaInfo_GUI_Windows_x64.nsi index e3520eeda..795217fd8 100644 --- a/Source/Install/MediaInfo_GUI_Windows_x64.nsi +++ b/Source/Install/MediaInfo_GUI_Windows_x64.nsi @@ -37,6 +37,10 @@ SetCompressor /FINAL /SOLID lzma !include "MUI2.nsh" !define MUI_ABORTWARNING !define MUI_ICON "..\..\Source\Resource\Image\MediaInfo.ico" +!define MUI_UNICON "..\..\Source\Resource\Image\MediaInfo.ico" + +; Uninstaller signing +!uninstfinalize 'sign.cmd "%1" "MediaInfo Uninstaller"' ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" diff --git a/Source/Install/sign.cmd b/Source/Install/sign.cmd new file mode 100644 index 000000000..5c7ae6b68 --- /dev/null +++ b/Source/Install/sign.cmd @@ -0,0 +1,5 @@ +set /P CodeSigningCertificatePass= < %USERPROFILE%\CodeSigningCertificate.pass +if "%NOSIGN%"=="" ( + signtool.exe sign /f %USERPROFILE%\CodeSigningCertificate.p12 /p %CodeSigningCertificatePass% /fd sha256 /v /tr http://ts.ssl.com /td sha256 /d %2 /du http://mediaarea.net %1 +) +set CodeSigningCertificatePass=