From e3c263c01236e7c31ec23f6c3d8750d7e92fb5a3 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 6 Mar 2018 15:29:34 -0800 Subject: [PATCH] NSIS, WiX: Handle the presence or absence of mmdbresolve. Only install mmdbresolve if MAXMINDDB_FOUND is true. Fixup the Qt about box and WiX GTK defines while we're here. Change-Id: I7ac3c21ddb4aebc1dae1c3d8cfd2bcafc4139d2e Reviewed-on: https://code.wireshark.org/review/26299 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- packaging/nsis/config.nsh.in | 4 ++-- packaging/nsis/uninstall.nsi | 5 ++++- packaging/nsis/wireshark.nsi | 2 ++ packaging/wix/CMakeLists.txt | 13 +++++++++---- packaging/wix/ComponentGroups.wxi | 4 +++- packaging/wix/Features.wxi | 2 ++ packaging/wix/WiresharkOptionsDlg.wxs | 2 ++ ui/qt/about_dialog.cpp | 16 +++++++--------- 8 files changed, 31 insertions(+), 17 deletions(-) diff --git a/packaging/nsis/config.nsh.in b/packaging/nsis/config.nsh.in index b4dfff4b70..c35371dcc1 100644 --- a/packaging/nsis/config.nsh.in +++ b/packaging/nsis/config.nsh.in @@ -23,14 +23,14 @@ !endif !define PRODUCT_VERSION @PRODUCT_VERSION@ +!define MMDBRESOLVE_EXE @MAXMINDDB_FOUND@ + !define VCREDIST_EXE "@VCREDIST_EXE@" !define USER_GUIDE_DIR "@USER_GUIDE_DIR@" !define SMI_DIR "@SMI_DIR@" -# Qt !define QT_DIR "@QT_DIR@" -# GTK+ !define GTK_DIR "@GTK_DIR@" diff --git a/packaging/nsis/uninstall.nsi b/packaging/nsis/uninstall.nsi index 74d2e28eae..193162d218 100644 --- a/packaging/nsis/uninstall.nsi +++ b/packaging/nsis/uninstall.nsi @@ -133,7 +133,6 @@ Push "dftest" Push "dumpcap" Push "editcap" Push "mergecap" -Push "mmdbresolve" Push "randpktdump" Push "rawshark" Push "reordercap" @@ -142,6 +141,10 @@ Push "text2pcap" Push "tshark" Push "udpdump" +!ifdef MMDBRESOLVE_EXE +Push "mmdbresolve" +!endif + Pop $EXECUTABLE ${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER} diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index 404c6a326d..5af8ad5dc4 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -1117,6 +1117,7 @@ File "${STAGING_DIR}\rawshark.exe" File "${STAGING_DIR}\rawshark.html" SectionEnd +!ifdef MMDBRESOLVE_EXE Section /o "MMDBResolve" SecMMDBResolve ;------------------------------------------- SetOutPath $INSTDIR @@ -1124,6 +1125,7 @@ File "${STAGING_DIR}\mmdbresolve.html" SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.exe" SectionEnd +!endif Section /o "Androiddump" SecAndroiddumpinfos ;------------------------------------------- diff --git a/packaging/wix/CMakeLists.txt b/packaging/wix/CMakeLists.txt index 352e53f854..881f8610c4 100644 --- a/packaging/wix/CMakeLists.txt +++ b/packaging/wix/CMakeLists.txt @@ -300,11 +300,15 @@ endif() file(APPEND "${_gtk_dll_manifest_wix}" "\n\n") if(BUILD_wireshark_gtk AND GTK_FOUND) - set(use_gtk "-dGTK_DIR") + set(d_gtk_dir "-dGTK_DIR") endif() if(SMI_DIR) - set(use_smi "-dSMI_DIR") + set(d_smi_dir "-dSMI_DIR") +endif() + +if (MAXMINDDB_FOUND) + set(d_mmdbresolve_exe "-dMMDBRESOLVE_EXE") endif() set(WIX_CANDLE_DEFINES @@ -323,8 +327,9 @@ set(WIX_CANDLE_DEFINES -dSnmpMibDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/snmp/mibs -dVCRedistVersion=${MSVC_CRT_VERSION} -dVCRedistDir=${MERGE_MODULE_DIR} - ${use_gtk} - ${use_smi} + ${d_gtk_dir} + ${d_smi_dir} + ${d_mmdbresolve_exe} -arch ${TARGET_MACHINE} -ext WixUIExtension -I${CMAKE_SOURCE_DIR}/packaging/wix diff --git a/packaging/wix/ComponentGroups.wxi b/packaging/wix/ComponentGroups.wxi index 8631c805d2..f6c70433c2 100644 --- a/packaging/wix/ComponentGroups.wxi +++ b/packaging/wix/ComponentGroups.wxi @@ -434,13 +434,14 @@ + - + @@ -450,6 +451,7 @@ + diff --git a/packaging/wix/Features.wxi b/packaging/wix/Features.wxi index 277a713a14..918da3bb66 100644 --- a/packaging/wix/Features.wxi +++ b/packaging/wix/Features.wxi @@ -81,9 +81,11 @@ + + diff --git a/packaging/wix/WiresharkOptionsDlg.wxs b/packaging/wix/WiresharkOptionsDlg.wxs index d37f74c32b..9b1cd3aacb 100644 --- a/packaging/wix/WiresharkOptionsDlg.wxs +++ b/packaging/wix/WiresharkOptionsDlg.wxs @@ -22,6 +22,7 @@ 3]]> + 3]]> @@ -34,6 +35,7 @@ 3]]> + diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp index 21449b9698..f36931f835 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp @@ -21,9 +21,9 @@ #ifdef HAVE_LIBSMI #include #endif -#ifdef HAVE_GEOIP -#include -#endif + +#include + #ifdef HAVE_LUA #include #endif @@ -248,12 +248,10 @@ FolderListModel::FolderListModel(QObject * parent): foreach(QString path, extPaths) appendRow( QStringList() << tr("Extcap path") << path.trimmed() << tr("Extcap Plugins search path")); -#ifdef HAVE_GEOIP - /* GeoIP */ - QStringList geoIpPaths = QString(geoip_db_get_paths()).split(G_SEARCHPATH_SEPARATOR_S); - foreach(QString path, geoIpPaths) - appendRow( QStringList() << tr("GeoIP path") << path.trimmed() << tr("GeoIP database search path")); -#endif + /* MaxMind DB */ + QStringList maxMindDbPaths = QString(maxmind_db_get_paths()).split(G_SEARCHPATH_SEPARATOR_S); + foreach(QString path, maxMindDbPaths) + appendRow( QStringList() << tr("MaxMind DB path") << path.trimmed() << tr("MaxMind DB database search path")); #ifdef HAVE_LIBSMI /* SMI MIBs/PIBs */