Skip to content

Commit

Permalink
Merge pull request #989 from cjee21/NSIS
Browse files Browse the repository at this point in the history
Windows GUI: Update installers
  • Loading branch information
JeromeMartinez authored Dec 7, 2024
2 parents 70015ea + 0617b95 commit 946b9a8
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 65 deletions.
76 changes: 54 additions & 22 deletions Source/Install/MediaInfo_GUI_Windows.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ SetCompressor /FINAL /SOLID lzma
; x64 stuff
!include "x64.nsh"

; Logic stuff
!include LogicLib.nsh

; Library macros for handling install/uninstall of exe/dll
; https://nsis.sourceforge.io/Docs/AppendixB.html
!include "Library.nsh"
Expand Down Expand Up @@ -120,7 +123,11 @@ ShowInstDetails nevershow
ShowUnInstDetails nevershow

Function .onInit
${If} ${RunningX64}
${If} ${IsNativeARM64}
${AndIf} ${AtLeastWin11}
SetRegView 64
${EndIf}
${If} ${IsNativeAMD64}
SetRegView 64
${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY
Expand All @@ -136,30 +143,50 @@ Section "SectionPrincipale" SEC01
SetOutPath "$SMPROGRAMS"
CreateShortCut "$SMPROGRAMS\MediaInfo.lnk" "$INSTDIR\MediaInfo.exe" "" "" "" "" "" "Convenient unified display of the most relevant technical and tag data for video and audio files"
SetOutPath "$INSTDIR"

; Architecture neutral files
File "/oname=History.txt" "..\..\History_GUI.txt"
File "..\..\License.html"
File "/oname=ReadMe.txt" "..\..\Release\ReadMe_GUI_Windows.txt"
${If} ${RunningX64}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo.dll"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_WindowsShellExtension.dll"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
${EndIf}

; Architecture specific files
${If} ${IsNativeARM64}
${AndIf} ${AtLeastWin11}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64EC\Release\MediaInfo.dll"
File "..\..\Project\MSVC2022\ARM64\Release\MediaInfo_WindowsShellExtension.dll"
${Else}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win32\Release\MediaInfo_GUI.exe"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo.dll"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win32\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\Win32\Release\LIBCURL.DLL"
${If} ${IsNativeAMD64}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo.dll"
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_WindowsShellExtension.dll"
${EndIf}
${Else}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win32\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win32\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\Win32\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo.dll"
${EndIf}
${EndIf}

; Windows 11 sparse package files
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
${EndIf}

; Plugin files
SetOverwrite try
SetOutPath "$INSTDIR\Plugin\Custom"
File "..\Resource\Plugin\Custom\*.csv"
Expand Down Expand Up @@ -212,7 +239,13 @@ SectionEnd


Section Uninstall
SetRegView 64
${If} ${IsNativeARM64}
${AndIf} ${AtLeastWin11}
SetRegView 64
${EndIf}
${If} ${IsNativeAMD64}
SetRegView 64
${EndIf}
!insertmacro MediaInfo_Extensions_Uninstall
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'

Expand Down Expand Up @@ -267,7 +300,6 @@ Section Uninstall
RMDir /r "$INSTDIR\WebView2"
RMDir "$INSTDIR"

SetRegView 64
DeleteRegKey HKLM "${PRODUCT_REGISTRY}"
DeleteRegKey /ifempty HKLM "${COMPANY_REGISTRY}"
DeleteRegKey HKCU "${PRODUCT_REGISTRY}"
Expand Down
46 changes: 30 additions & 16 deletions Source/Install/MediaInfo_GUI_Windows_ARM64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ VIAddVersionKey /LANG=0 "ProductVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "FileDescription" "All about your audio and video files"
VIAddVersionKey /LANG=0 "FileVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows.exe"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_ARM64.exe"
BrandingText " "

; Modern UI end
Expand Down Expand Up @@ -143,24 +143,39 @@ Section "SectionPrincipale" SEC01
SetOutPath "$SMPROGRAMS"
CreateShortCut "$SMPROGRAMS\MediaInfo.lnk" "$INSTDIR\MediaInfo.exe" "" "" "" "" "" "Convenient unified display of the most relevant technical and tag data for video and audio files"
SetOutPath "$INSTDIR"

; Architecture neutral files
File "/oname=History.txt" "..\..\History_GUI.txt"
File "..\..\License.html"
File "/oname=ReadMe.txt" "..\..\Release\ReadMe_GUI_Windows.txt"
; ${If} ${RunningX64}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64EC\Release\MediaInfo.dll"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
; ${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"

; Architecture specific files
;${If} ${IsNativeARM64}
; ${AndIf} ${AtLeastWin11}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\ARM64EC\Release\MediaInfo.dll"
File "..\..\Project\MSVC2022\ARM64\Release\MediaInfo_WindowsShellExtension.dll"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
; ${EndIf}
; ${EndIf}
;${Else}
; ${If} ${IsNativeAMD64}
; ${If} ${AtLeastWin11}
; ${EndIf}
; ${Else}
; ${EndIf}
;${EndIf}

; Windows 11 sparse package files
;${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
;${EndIf}

; Plugin files
SetOverwrite try
SetOutPath "$INSTDIR\Plugin\Custom"
File "..\Resource\Plugin\Custom\*.csv"
Expand Down Expand Up @@ -268,7 +283,6 @@ Section Uninstall
RMDir /r "$INSTDIR\WebView2"
RMDir "$INSTDIR"

SetRegView 64
DeleteRegKey HKLM "${PRODUCT_REGISTRY}"
DeleteRegKey /ifempty HKLM "${COMPANY_REGISTRY}"
DeleteRegKey HKCU "${PRODUCT_REGISTRY}"
Expand Down
2 changes: 1 addition & 1 deletion Source/Install/MediaInfo_GUI_Windows_Stub.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VIAddVersionKey /LANG=0 "ProductVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "FileDescription" "All about your audio and video files"
VIAddVersionKey /LANG=0 "FileVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows.exe"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_Online.exe"
BrandingText " "

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
Expand Down
39 changes: 30 additions & 9 deletions Source/Install/MediaInfo_GUI_Windows_i386.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ VIAddVersionKey /LANG=0 "ProductVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "FileDescription" "All about your audio and video files"
VIAddVersionKey /LANG=0 "FileVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows.exe"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_i386.exe"
BrandingText " "

; Modern UI end
Expand Down Expand Up @@ -141,17 +141,38 @@ Section "SectionPrincipale" SEC01
SetOutPath "$SMPROGRAMS"
CreateShortCut "$SMPROGRAMS\MediaInfo.lnk" "$INSTDIR\MediaInfo.exe" "" "" "" "" "" "Convenient unified display of the most relevant technical and tag data for video and audio files"
SetOutPath "$INSTDIR"

; Architecture neutral files
File "/oname=History.txt" "..\..\History_GUI.txt"
File "..\..\License.html"
File "/oname=ReadMe.txt" "..\..\Release\ReadMe_GUI_Windows.txt"
; ${If} ${RunningX64}
; ${Else}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win32\Release\MediaInfo_GUI.exe"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo.dll"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win32\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\Win32\Release\LIBCURL.DLL"
; ${EndIf}

; Architecture specific files
;${If} ${IsNativeARM64}
; ${AndIf} ${AtLeastWin11}
;${Else}
; ${If} ${IsNativeAMD64}
; ${If} ${AtLeastWin11}
; ${EndIf}
; ${Else}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win32\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win32\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\Win32\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\Win32\Release\MediaInfo.dll"
; ${EndIf}
;${EndIf}

; Windows 11 sparse package files
;${If} ${AtLeastWin11}
; File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
; File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
; File "..\WindowsSparsePackage\Resources\resources.pri"
; SetOutPath "$INSTDIR\Assets"
; File "..\WindowsSparsePackage\Resources\Assets\*.png"
;${EndIf}

; Plugin files
SetOverwrite try
SetOutPath "$INSTDIR\Plugin\Custom"
File "..\Resource\Plugin\Custom\*.csv"
Expand Down
48 changes: 31 additions & 17 deletions Source/Install/MediaInfo_GUI_Windows_x64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ VIAddVersionKey /LANG=0 "ProductVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "FileDescription" "All about your audio and video files"
VIAddVersionKey /LANG=0 "FileVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows.exe"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64.exe"
BrandingText " "

; Modern UI end
Expand Down Expand Up @@ -139,24 +139,39 @@ Section "SectionPrincipale" SEC01
SetOutPath "$SMPROGRAMS"
CreateShortCut "$SMPROGRAMS\MediaInfo.lnk" "$INSTDIR\MediaInfo.exe" "" "" "" "" "" "Convenient unified display of the most relevant technical and tag data for video and audio files"
SetOutPath "$INSTDIR"

; Architecture neutral files
File "/oname=History.txt" "..\..\History_GUI.txt"
File "..\..\License.html"
File "/oname=ReadMe.txt" "..\..\Release\ReadMe_GUI_Windows.txt"
; ${If} ${IsNativeAMD64}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo.dll"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_WindowsShellExtension.dll"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
${EndIf}
; ${EndIf}

; Architecture specific files
;${If} ${IsNativeARM64}
; ${AndIf} ${AtLeastWin11}
;${Else}
; ${If} ${IsNativeAMD64}
File "/oname=MediaInfo.exe" "..\..\Project\BCB\GUI\Win64\Release\MediaInfo_GUI.exe"
File "C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64\WebView2Loader.dll"
File "$%BPATH%\Windows\libcurl\x64\Release\LIBCURL.DLL"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo_InfoTip.dll"
File "..\..\..\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo.dll"
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_WindowsShellExtension.dll"
${EndIf}
; ${Else}
; ${EndIf}
;${EndIf}

; Windows 11 sparse package files
${If} ${AtLeastWin11}
File "..\..\Project\MSVC2022\x64\Release\MediaInfo_SparsePackage.msix"
File "..\..\Project\MSVC2022\win32\Release\MediaInfo_PackageHelper.dll"
File "..\WindowsSparsePackage\Resources\resources.pri"
SetOutPath "$INSTDIR\Assets"
File "..\WindowsSparsePackage\Resources\Assets\*.png"
${EndIf}

; Plugin files
SetOverwrite try
SetOutPath "$INSTDIR\Plugin\Custom"
File "..\Resource\Plugin\Custom\*.csv"
Expand Down Expand Up @@ -264,7 +279,6 @@ Section Uninstall
RMDir /r "$INSTDIR\WebView2"
RMDir "$INSTDIR"

SetRegView 64
DeleteRegKey HKLM "${PRODUCT_REGISTRY}"
DeleteRegKey /ifempty HKLM "${COMPANY_REGISTRY}"
DeleteRegKey HKCU "${PRODUCT_REGISTRY}"
Expand Down

0 comments on commit 946b9a8

Please sign in to comment.