From 304388a44f6fcb468f98f2c7179bb39cb4ecd294 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 30 Jul 2014 09:33:43 -0700 Subject: Install our Qt DLL directories recursively. Qwindows.dll at least needs to be in the "platforms" subdirectory. Use a PowerShell script to convert the output of windeployqt to its equivalent NSIS instructions. Give the Qt DLL manifest a .nsh extension. Make sure we uninstall known Qt DLL directories. DLLs now load correctly according to Dependency Walker. Install and uninstall our .qm files while we're here. Change-Id: I06ed279809e6fce0e008c5f278a56b1ae34c8f21 Reviewed-on: https://code.wireshark.org/review/3267 Reviewed-by: Gerald Combs --- packaging/nsis/Makefile.nmake | 12 +++++----- packaging/nsis/uninstall.nsi | 34 +++++++++++++++++------------ packaging/nsis/windeployqt-to-nsis.ps1 | 40 ++++++++++++++++++++++++++++++++++ packaging/nsis/wireshark.nsi | 3 ++- 4 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 packaging/nsis/windeployqt-to-nsis.ps1 (limited to 'packaging') diff --git a/packaging/nsis/Makefile.nmake b/packaging/nsis/Makefile.nmake index 7d9c19ae2b..95ee895636 100644 --- a/packaging/nsis/Makefile.nmake +++ b/packaging/nsis/Makefile.nmake @@ -230,15 +230,13 @@ NSIS_FLAGS=\ /DQT_DIR="..\..\wireshark-qt-release" \ !ENDIF -wireshark.nsi: qt-dll-manifest.txt -qt-dll-manifest.txt: +wireshark.nsi: qt-dll-manifest.nsh +qt-dll-manifest.nsh: windeployqt-to-nsis.ps1 !IF EXIST("$(QT5_BASE_DIR)\bin\windeployqt.exe") + powershell -executionpolicy bypass -File windeployqt-to-nsis.ps1 \ "$(QT5_BASE_DIR)\bin\windeployqt.exe" \ - --release \ - --no-compiler-runtime \ - --list source ..\..\wireshark-qt-release\qtshark.exe \ + ..\..\wireshark-qt-release\qtshark.exe \ > $@ - sed -i -e 's/^/File "/' -e 's/$$/"/' $@ !ELSE IF EXIST("..\..\wireshark-qt-release\Qt5Core.dll") type << > $@ File "..\..\wireshark-qt-release\Qt5Core.dll" @@ -272,7 +270,7 @@ clean: rm -f $(UNINSTALL_INSTALLER) rm -f NEWS.txt rm -f user-guide.chm - rm -f qt-dll-manifest.txt + rm -f qt-dll-manifest.nsh distclean: clean rm -f wireshark-$(WIRESHARK_TARGET_PLATFORM)-*.exe diff --git a/packaging/nsis/uninstall.nsi b/packaging/nsis/uninstall.nsi index 3b9086f25e..751367570a 100755 --- a/packaging/nsis/uninstall.nsi +++ b/packaging/nsis/uninstall.nsi @@ -134,37 +134,43 @@ DeleteRegKey HKCR ${WIRESHARK_ASSOC} DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command" DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon" +Delete "$INSTDIR\*.dll" +Delete "$INSTDIR\*.exe" +Delete "$INSTDIR\*.html" +Delete "$INSTDIR\*.qm" +Delete "$INSTDIR\accessible\*.*" +Delete "$INSTDIR\AUTHORS-SHORT" +Delete "$INSTDIR\COPYING*" +Delete "$INSTDIR\diameter\*.*" Delete "$INSTDIR\etc\gtk-2.0\*.*" Delete "$INSTDIR\etc\gtk-3.0\*.*" Delete "$INSTDIR\etc\pango\*.*" +Delete "$INSTDIR\help\*.*" +Delete "$INSTDIR\iconengines\*.*" +Delete "$INSTDIR\imageformats\*.*" +Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*" +Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*" +Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*" Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*" -Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*" Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*" +Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*" Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*" -Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*" Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*" -Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*" -Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*" -Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*" +Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*" Delete "$INSTDIR\lib\gtk-2.0\modules\*.*" Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*" Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*" Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*" -Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*" +Delete "$INSTDIR\platforms\*.*" +Delete "$INSTDIR\printsupport\*.*" Delete "$INSTDIR\share\glib-2.0\schemas\*.*" -Delete "$INSTDIR\help\*.*" -Delete "$INSTDIR\diameter\*.*" -Delete "$INSTDIR\snmp\mibs\*.*" +Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*" Delete "$INSTDIR\snmp\*.*" +Delete "$INSTDIR\snmp\mibs\*.*" Delete "$INSTDIR\tpncp\*.*" Delete "$INSTDIR\ui\*.*" Delete "$INSTDIR\wimaxasncp\*.*" -Delete "$INSTDIR\*.exe" -Delete "$INSTDIR\*.dll" -Delete "$INSTDIR\*.html" Delete "$INSTDIR\ws.css" -Delete "$INSTDIR\COPYING*" -Delete "$INSTDIR\AUTHORS-SHORT" ; previous versions installed these files Delete "$INSTDIR\*.manifest" ; previous versions installed this file diff --git a/packaging/nsis/windeployqt-to-nsis.ps1 b/packaging/nsis/windeployqt-to-nsis.ps1 new file mode 100644 index 0000000000..a47d00e363 --- /dev/null +++ b/packaging/nsis/windeployqt-to-nsis.ps1 @@ -0,0 +1,40 @@ +# windeployqt-to-nsh +# +# Convert the output of windeployqt to an equivalent set of NSIS "File" +# function calls. + +Param( + [string[]] $Windeployqt, + [string[]] $Executable +) + +$wdqtList = & $Windeployqt ` + --release ` + --no-compiler-runtime ` + --list relative ` + $Executable + +$dllPath = Split-Path -Parent $Executable + +$dllList = @() +$dirList = @() + +foreach ($entry in $wdqtList) { + $dir = Split-Path -Parent $entry + if ($dir) { + $dirList += $dir + } else { + $dllList += $entry + } +} + +$dirList = $dirList | Sort-Object | Get-Unique + +foreach ($entry in $dllList) { + write-output "File `"$dllPath\$entry`"" +} + +foreach ($entry in $dirList) { + write-output "File /r `"$dllPath\$entry`"" +} + diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index fe3665dc87..8f9b5f0ec4 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -880,7 +880,8 @@ Section "${PROGRAM_NAME} 2 Preview" SecWiresharkQt ; by default, QtShark is installed but file is always associate with Wireshark GTK+ SetOutPath $INSTDIR File "${QT_DIR}\${PROGRAM_NAME_PATH_QT}" -!include qt-dll-manifest.txt +!include qt-dll-manifest.nsh +File "${QT_DIR}\*.qm" Push $0 ;SectionGetFlags ${SecWiresharkQt} $0 -- cgit v1.2.1