Skip to content

Commit 556a71d

Browse files
committed
Export uninstaller for signing
Signed-off-by: Maxime Gervais <gervais.maxime@gmail.com>
1 parent 812821c commit 556a71d

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

Source/Install/MediaInfo_DLL_Windows_ARM64.nsi

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ SetCompressor /FINAL /SOLID lzma
2828
!define MUI_ABORTWARNING
2929
!define MUI_ICON "..\Resource\Image\MediaInfo.ico"
3030

31+
; Uninstaller signing
32+
!ifdef EXPORT_UNINST
33+
!uninstfinalize 'copy /Y "%1" "../../Release/${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_ARM64-uninst.exe"'
34+
!endif
35+
3136
; Language Selection Dialog Settings
3237
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
3338
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
@@ -88,7 +93,7 @@ BrandingText " "
8893
; Modern UI end
8994

9095
Name "${PRODUCT_NAME}.dll ${PRODUCT_VERSION}"
91-
OutFile "..\..\Release\MediaInfo_DLL_${PRODUCT_VERSION}_Windows_ARM64.exe"
96+
OutFile "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_ARM64.exe"
9297
InstallDir "$PROGRAMFILES64\MediaInfo.dll"
9398
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
9499
ShowInstDetails nevershow
@@ -115,7 +120,11 @@ Section "SectionPrincipale" SEC01
115120
SectionEnd
116121

117122
Section -Post
118-
WriteUninstaller "$INSTDIR\MediaInfo_uninst.exe"
123+
!if /FileExists "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_ARM64-uninst.exe"
124+
File "/oname=$INSTDIR\MediaInfo_uninst.exe" "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_ARM64-uninst.exe"
125+
!else
126+
WriteUninstaller "$INSTDIR\MediaInfo_uninst.exe"
127+
!endif
119128
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\MediaInfo.dll"
120129
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
121130
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"

Source/Install/MediaInfo_DLL_Windows_i386.nsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ SetCompressor /FINAL /SOLID lzma
2828
!define MUI_ABORTWARNING
2929
!define MUI_ICON "..\Resource\Image\MediaInfo.ico"
3030

31+
; Uninstaller signing
32+
!ifdef EXPORT_UNINST
33+
!uninstfinalize 'copy /Y "%1" "../../Release/${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_i386-uninst.exe"'
34+
!endif
35+
3136
; Language Selection Dialog Settings
3237
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
3338
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"

Source/Install/MediaInfo_DLL_Windows_x64.nsi

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ SetCompressor /FINAL /SOLID lzma
2828
!define MUI_ABORTWARNING
2929
!define MUI_ICON "..\Resource\Image\MediaInfo.ico"
3030

31+
; Uninstaller signing
32+
!ifdef EXPORT_UNINST
33+
!uninstfinalize 'copy /Y "%1" "../../Release/${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_x64-uninst.exe"'
34+
!endif
35+
3136
; Language Selection Dialog Settings
3237
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
3338
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
@@ -88,7 +93,7 @@ BrandingText " "
8893
; Modern UI end
8994

9095
Name "${PRODUCT_NAME}.dll ${PRODUCT_VERSION}"
91-
OutFile "..\..\Release\MediaInfo_DLL_${PRODUCT_VERSION}_Windows_x64.exe"
96+
OutFile "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_x64.exe"
9297
InstallDir "$PROGRAMFILES64\MediaInfo.dll"
9398
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
9499
ShowInstDetails nevershow
@@ -115,7 +120,11 @@ Section "SectionPrincipale" SEC01
115120
SectionEnd
116121

117122
Section -Post
118-
WriteUninstaller "$INSTDIR\MediaInfo_uninst.exe"
123+
!if /FileExists "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_x64-uninst.exe"
124+
File "/oname=$INSTDIR\MediaInfo_uninst.exe" "..\..\Release\${PRODUCT_NAME}_DLL_${PRODUCT_VERSION}_Windows_x64-uninst.exe"
125+
!else
126+
WriteUninstaller "$INSTDIR\MediaInfo_uninst.exe"
127+
!endif
119128
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\MediaInfo.dll"
120129
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
121130
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"

0 commit comments

Comments
 (0)