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 <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2014-07-30 09:33:43 -07:00
parent 8d05e85c17
commit 304388a44f
5 changed files with 70 additions and 24 deletions

1
.gitignore vendored
View File

@ -207,6 +207,7 @@ packaging/macosx/COPYING.txt
packaging/macosx/Info.plist
packaging/macosx/osx-dmg.sh
packaging/macosx/Wireshark_package.pmdoc/index.xml
packaging/nsis/qt-dll-manifest.nsh
packaging/portableapps/win32/Files/
packaging/portableapps/win32/WiresharkPortable.ini
packaging/portableapps/win32/appinfo.ini

View File

@ -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

View File

@ -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\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.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\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\loaders\*.*"
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\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\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

View File

@ -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`""
}

View File

@ -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