summaryrefslogtreecommitdiffstats
path: root/packaging/nsis
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/nsis')
-rw-r--r--packaging/nsis/CMakeLists.txt400
-rw-r--r--packaging/nsis/DonatePage.ini19
-rw-r--r--packaging/nsis/GetWindowsVersion.nsh190
-rw-r--r--packaging/nsis/InstallMSYS2.cmake71
-rw-r--r--packaging/nsis/InstallMinGW.cmake55
-rw-r--r--packaging/nsis/NpcapPage.ini85
-rw-r--r--packaging/nsis/USBPcapPage.ini77
-rw-r--r--packaging/nsis/custom_diameter_xmls.txt3
-rw-r--r--packaging/nsis/custom_mibs.txt4
-rw-r--r--packaging/nsis/custom_plugins.txt3
-rw-r--r--packaging/nsis/custom_radius_dict.txt3
-rw-r--r--packaging/nsis/logray-additional-tasks.nsddef17
-rw-r--r--packaging/nsis/logray-additional-tasks.nsdinc75
-rw-r--r--packaging/nsis/logray-common.nsh126
-rw-r--r--packaging/nsis/logray-config.nsh.in30
-rw-r--r--packaging/nsis/logray.nsi1105
-rw-r--r--packaging/nsis/makeUninstall.ps147
-rw-r--r--packaging/nsis/mingw64-qt-mapping.txt30
-rw-r--r--packaging/nsis/servicelib.nsh344
-rw-r--r--packaging/nsis/uninstall-logray.nsi274
-rw-r--r--packaging/nsis/windeployqt-to-nsis.ps1108
-rw-r--r--packaging/nsis/windeployqt-to-nsis.py91
-rw-r--r--packaging/nsis/wireshark-additional-tasks.nsddef17
-rw-r--r--packaging/nsis/wireshark-additional-tasks.nsdinc70
-rw-r--r--packaging/nsis/wireshark-common.nsh154
-rw-r--r--packaging/nsis/wireshark-config.nsh.in40
-rw-r--r--packaging/nsis/wireshark.nsi1657
27 files changed, 5095 insertions, 0 deletions
diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt
new file mode 100644
index 0000000..d0c4866
--- /dev/null
+++ b/packaging/nsis/CMakeLists.txt
@@ -0,0 +1,400 @@
+# CMakeLists.txt
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+
+# We should use CPack to generate the NSIS package. Even better,
+# we should use CPack to create a .msi using WiX.
+
+set(WIRESHARK_NSIS_GENERATED_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/wireshark-manifest.nsh
+ ${CMAKE_CURRENT_BINARY_DIR}/wireshark-config.nsh
+)
+if(NOT SKIP_NSIS_QT_DLLS)
+ list(APPEND WIRESHARK_NSIS_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/wireshark-qt-manifest.nsh)
+endif()
+set(WIRESHARK_NSIS_GENERATED_FILES ${WIRESHARK_NSIS_GENERATED_FILES} PARENT_SCOPE)
+
+set(WIRESHARK_NSIS_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/wireshark.nsi
+ ${CMAKE_CURRENT_SOURCE_DIR}/wireshark-common.nsh
+ ${CMAKE_CURRENT_SOURCE_DIR}/GetWindowsVersion.nsh
+ ${CMAKE_CURRENT_SOURCE_DIR}/servicelib.nsh
+ ${CMAKE_CURRENT_SOURCE_DIR}/NpcapPage.ini
+ ${CMAKE_CURRENT_SOURCE_DIR}/USBPcapPage.ini
+ ${WIRESHARK_NSIS_GENERATED_FILES}
+ PARENT_SCOPE
+)
+
+set(LOGRAY_NSIS_GENERATED_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/logray-manifest.nsh
+ ${CMAKE_CURRENT_BINARY_DIR}/logray-config.nsh
+ ${CMAKE_CURRENT_BINARY_DIR}/logray-qt-manifest.nsh
+)
+set(LOGRAY_NSIS_GENERATED_FILES ${LOGRAY_NSIS_GENERATED_FILES} PARENT_SCOPE)
+
+set(LOGRAY_NSIS_FILES
+ logray.nsi
+ uninstall-logray.nsi
+ logray-common.nsh
+ GetWindowsVersion.nsh
+ servicelib.nsh
+ NpcapPage.ini
+ USBPcapPage.ini
+ ${LOGRAY_NSIS_GENERATED_FILES}
+ PARENT_SCOPE
+)
+
+# Variables required for config.nsh
+set(PROGRAM_NAME ${CMAKE_PROJECT_NAME})
+set(LOG_PROGRAM_NAME ${LOG_PROJECT_NAME})
+file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}" TOP_SRC_DIR)
+# STAGING_DIR depends on the build configuration so we pass it
+# on the command line below.
+file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/docbook" DOCBOOK_DIR)
+set (MMDBRESOLVE_EXE ${MAXMINDDB_FOUND})
+
+# To do:
+# - Sync the various version names between CMake and NSIS.
+# - Set CMakeLists.txt version strings in tools/make-version.py
+# - Add a VERSION_EXTRA cmake option
+set (PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION})
+set (LOG_PRODUCT_VERSION ${LOG_PROJECT_MAJOR_VERSION}.${LOG_PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION})
+
+if((BUILD_wireshark OR BUILD_logray) AND QT_FOUND)
+ set (QT_DIR "\${STAGING_DIR}")
+endif()
+
+# Look for the Visual C++ Redistributable packages in the following locations:
+# - _PROJECT_LIB_DIR
+# - _PROJECT_LIB_DIR/vcredist_MSVCxx
+# - %VCINSTALLDIR%
+# - %VCINSTALLDIR%/redist/1033 (<= Visual Studio 2015)
+# - %VCINSTALLDIR%/Redist/MSVC/* (>= Visual Studio 2017)
+# MSVC_VERSION (_MSC_VER) = Visual Studio Version / MSVC Toolset Version
+# 1900 = VS2015 14.0 / 14.00
+# 1910 = VS2017 15.1, 15.2 / 14.10
+# 1911 = VS2017 15.3, 15.4 / 14.11
+# 1912 = VS2017 15.5 / 14.12
+# 1913 = VS2017 15.6 / 14.13
+# 1914 = VS2017 15.7 / 14.14
+if(MSVC_VERSION GREATER_EQUAL 1930)
+ set(_ws_vcredist_subdir "vcredist_MSVC2022")
+elseif(MSVC_VERSION GREATER_EQUAL 1920)
+ set(_ws_vcredist_subdir "vcredist_MSVC2019")
+ set(_msvs_version 15.0) # Doesn't appear to be set
+elseif(MSVC_VERSION GREATER_EQUAL 1910)
+ set(_ws_vcredist_subdir "vcredist_MSVC2017")
+ set(_msvs_version 15.0)
+elseif(MSVC_VERSION GREATER_EQUAL 1900)
+ set(_ws_vcredist_subdir "vcredist_MSVC2015")
+ set(_ms_vcredist_subdir "redist/1033")
+ set(_msvs_version 14.0)
+endif()
+
+# Try to find the Redist folder in VCINSTALLDIR which is set by vcvarsall.bat.
+# If it is not set, query it within the registry. VS2015 looks for the "VC7" key
+# in two locations (four if you count HKCU instead of HKLM). However, VS2017
+# does not use "VC7" (it sets a directory relative to vsdevcmd_start.bat). As
+# both versions do set "VS7", use that instead.
+find_path(VCINSTALLDIR Redist PATHS
+ "$ENV{VCINSTALLDIR}"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_msvs_version}]\\VC"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7;${_msvs_version}]\\VC"
+ NO_DEFAULT_PATH
+)
+file(TO_NATIVE_PATH "${VCINSTALLDIR}" VCINSTALLDIR_NATIVE)
+message(STATUS "Using VCINSTALLDIR: ${VCINSTALLDIR_NATIVE}")
+
+# Visual Studio Community 2017 version 15.7.5 uses VCRT 14.14.26405, but an
+# earlier version used 14.10.25008. Let's just glob for the right value.
+if(MSVC_VERSION GREATER_EQUAL 1910 AND VCINSTALLDIR)
+ file(GLOB _ms_vcredist_subdir RELATIVE "${VCINSTALLDIR}"
+ "${VCINSTALLDIR}/Redist/MSVC/14.*.*")
+endif()
+
+find_program(_vcredist
+ NAMES
+ "vc_redist.${WIRESHARK_TARGET_PLATFORM}.exe" # Visual Studio 2022 and later
+ "vcredist_${WIRESHARK_TARGET_PLATFORM}.exe" # Visual Studio 2019 and earlier
+ PATHS "${_PROJECT_LIB_DIR}" $ENV{VCToolsRedistDir} "${VCINSTALLDIR}"
+ PATH_SUFFIXES ${_ws_vcredist_subdir} ${_ms_vcredist_subdir}
+ NO_DEFAULT_PATH
+)
+if(_vcredist)
+ file(TO_NATIVE_PATH "${_vcredist}" _vcredist)
+ message(STATUS "Using ${_vcredist} for the NSIS installer.")
+ get_filename_component(VCREDIST_DIR ${_vcredist} DIRECTORY)
+ get_filename_component(VCREDIST_EXE ${_vcredist} NAME)
+endif()
+
+if (BUILD_wireshark)
+ # Ideally we would generate this at compile time using a separate cmake
+ # module, e.g. cmake/modules/configure_nsis_file.cmake. However we would
+ # have to figure out a clean way to pass in the variables above.
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/wireshark-config.nsh.in" _config_nsh_contents)
+ string(CONFIGURE "${_config_nsh_contents}" _config_nsh_contents)
+ string(REPLACE "#define" "!define" _config_nsh_contents "${_config_nsh_contents}")
+ string(REPLACE "#undef" "!undef" _config_nsh_contents "${_config_nsh_contents}")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/wireshark-config.nsh" "${_config_nsh_contents}")
+
+ # wireshark-manifest.nsh. Can be created at configure time.
+ set(_all_manifest "${CMAKE_CURRENT_BINARY_DIR}/wireshark-manifest.nsh")
+ set(_all_manifest_contents "# Files required for all sections. Generated by CMake.\n")
+ if(USE_REPOSITORY)
+ set(_all_manifest_contents "${_all_manifest_contents}!ifdef BUNDLE_DEBUG_DLLS\n")
+ foreach(_dll ${GLIB2_DLLS_DEBUG})
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ set(_all_manifest_contents "${_all_manifest_contents}!else\n")
+ foreach(_dll ${GLIB2_DLLS_RELEASE})
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ set(_all_manifest_contents "${_all_manifest_contents}!endif\n")
+ foreach(_dll ${CARES_DLL} ${PCRE2_RELEASE_DLL} ${GCRYPT_DLLS}
+ ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL}
+ ${LZ4_DLL} ${MINIZIP_DLL} ${NGHTTP2_DLL} ${NGHTTP3_DLL} ${SBC_DLL} ${SMI_DLL}
+ ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL}
+ ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL}
+ ${SPEEXDSP_DLL}
+ # Needed for mmdbresolve
+ ${MAXMINDDB_DLL}
+ )
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ elseif(USE_MSYSTEM)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/InstallMSYS2.cmake)
+ foreach(_dll ${MINGW_DLLS})
+ file(TO_NATIVE_PATH ${_dll} _path)
+ set(_all_manifest_contents "${_all_manifest_contents}File \"${_path}\"\n")
+ endforeach()
+ else()
+ include(${CMAKE_CURRENT_SOURCE_DIR}/InstallMinGW.cmake)
+ foreach(_dll ${MINGW_DLLS})
+ file(TO_NATIVE_PATH ${_dll} _path)
+ set(_all_manifest_contents "${_all_manifest_contents}File \"${_path}\"\n")
+ endforeach()
+ endif()
+ file(WRITE "${_all_manifest}" "${_all_manifest_contents}")
+endif()
+
+if (BUILD_logray)
+ # Ideally we would generate this at compile time using a separate cmake
+ # module, e.g. cmake/modules/configure_nsis_file.cmake. However we would
+ # have to figure out a clean way to pass in the variables above.
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/logray-config.nsh.in" _config_nsh_contents)
+ string(CONFIGURE "${_config_nsh_contents}" _config_nsh_contents)
+ string(REPLACE "#define" "!define" _config_nsh_contents "${_config_nsh_contents}")
+ string(REPLACE "#undef" "!undef" _config_nsh_contents "${_config_nsh_contents}")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/logray-config.nsh" "${_config_nsh_contents}")
+
+ # logray-manifest.nsh. Can be created at configure time.
+ set(_all_manifest "${CMAKE_CURRENT_BINARY_DIR}/logray-manifest.nsh")
+ set(_all_manifest_contents "# Files required for all sections. Generated by CMake.\n")
+ set(_all_manifest_contents "${_all_manifest_contents}!ifdef BUNDLE_DEBUG_DLLS\n")
+ foreach(_dll ${GLIB2_DLLS_DEBUG})
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ set(_all_manifest_contents "${_all_manifest_contents}!else\n")
+ foreach(_dll ${GLIB2_DLLS_RELEASE})
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ set(_all_manifest_contents "${_all_manifest_contents}!endif\n")
+ foreach(_dll ${CARES_DLL} ${PCRE2_RELEASE_DLL} ${GCRYPT_DLLS}
+ ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL}
+ ${LZ4_DLL} ${NGHTTP2_DLL} ${NGHTTP3_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL}
+ ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL}
+ ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL}
+ ${SPEEXDSP_DLL}
+ # Needed for mmdbresolve
+ ${MAXMINDDB_DLL}
+ )
+ set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
+ endforeach()
+ file(WRITE "${_all_manifest}" "${_all_manifest_contents}")
+endif()
+
+file(TO_NATIVE_PATH "${DATAFILE_DIR}" _staging_dir)
+file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" _outfile_dir)
+file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" _nsis_include_dir)
+
+# Variables we can't set via config.nsh.
+set(NSIS_OPTIONS
+ -DSTAGING_DIR=${_staging_dir}
+ -DOUTFILE_DIR=${_outfile_dir}
+ -DNSIS_INCLUDE_DIR=${_nsis_include_dir}
+ -V2
+ PARENT_SCOPE
+)
+
+# We want to sign all of the executables that we ship in the official
+# installers. This means that uninstall-wireshark.exe must be built
+# separately AND that building the installer itself won't overwrite
+# uninstall-wireshark.exe
+macro( ADD_NSIS_UNINSTALLER_TARGETS )
+ set (_nsis_source_dir ${CMAKE_SOURCE_DIR}/packaging/nsis )
+ set (_nsis_binary_dir ${CMAKE_BINARY_DIR}/packaging/nsis )
+
+ #
+ # XXX - if we're not building Wireshark, we can't build
+ # anything, so there's nothing to uninstall.
+ #
+ if(BUILD_logray)
+ add_custom_command(OUTPUT ${DATAFILE_DIR}/uninstall-logray.exe
+ DEPENDS ${_nsis_source_dir}/uninstall-logray.nsi
+ ${_nsis_source_dir}/logray-common.nsh
+ COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS}
+ uninstall-logray.nsi
+ COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/makeUninstall.ps1" ${DATAFILE_DIR}/uninstall_logray_installer.exe
+ COMMAND ${CMAKE_COMMAND} -E remove ${DATAFILE_DIR}/uninstall_logray_installer.exe
+ WORKING_DIRECTORY ${_nsis_source_dir}
+ )
+ endif()
+endmacro( ADD_NSIS_UNINSTALLER_TARGETS )
+
+macro( ADD_NSIS_PACKAGE_TARGETS )
+ set (_nsis_source_dir ${CMAKE_SOURCE_DIR}/packaging/nsis )
+ set (_nsis_binary_dir ${CMAKE_BINARY_DIR}/packaging/nsis )
+ #
+ # XXX - if we're not building Wireshark, we can't build the
+ # manifest below. On the other hand, if we're not building
+ # Wireshark, we have no need to include Qt in the installer,
+ # so it's not clear we need this manifest.
+ #
+ # This should probably be fixed, so that people can produce
+ # command-line-only installer packages.
+ if(BUILD_wireshark)
+ # wireshark-qt-manifest.nsh. Created using Wireshark.exe.
+ if(NOT SKIP_NSIS_QT_DLLS)
+ if (USE_REPOSITORY)
+ add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ COMMAND set "PATH=${QT_BIN_PATH};%PATH%"
+ COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/windeployqt-to-nsis.ps1"
+ -Executable $<TARGET_FILE:wireshark>
+ -FilePath ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ $<$<CONFIG:Debug>:-DebugConfig>
+ DEPENDS
+ "${_nsis_source_dir}/windeployqt-to-nsis.ps1"
+ $<TARGET_FILE:wireshark>
+ )
+ elseif(HAVE_MSYSTEM)
+ add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py"
+ --executable $<TARGET_FILE:wireshark>
+ ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ #$<$<CONFIG:Debug>:-DebugConfig>
+ DEPENDS
+ "${_nsis_source_dir}/windeployqt-to-nsis.py"
+ $<TARGET_FILE:wireshark>
+ )
+ elseif(MINGW AND CMAKE_CROSSCOMPILING)
+ add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py"
+ --sysroot "${MINGW_SYSROOT}"
+ --mapping "${_nsis_source_dir}/mingw64-qt-mapping.txt"
+ ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
+ #$<$<CONFIG:Debug>:-DebugConfig>
+ DEPENDS
+ "${_nsis_source_dir}/windeployqt-to-nsis.py"
+ "${_nsis_source_dir}/mingw64-qt-mapping.txt"
+ )
+ else()
+ message(FATAL_ERROR "Unknown Qt deployment method")
+ endif()
+ endif()
+
+ # Build NSIS package dependencies. We build the package in
+ # two stages so that wireshark_nsis below doesn't trigger
+ # any dependencies that might clobber any signed executables.
+ add_custom_target(wireshark_nsis_prep
+ DEPENDS
+ ${WIRESHARK_NSIS_FILES}
+ copy_data_files
+ user_guide_html
+ faq_html
+ )
+ set_target_properties(wireshark_nsis_prep PROPERTIES
+ FOLDER "Packaging"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ )
+
+ # Make sure required blobs are available
+ FetchContent_MakeAvailable(Npcap USBPcap)
+
+ # Dump the installer into
+ # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/nsis
+ # Note that executables and DLLs *must* be built separately
+ add_custom_target(wireshark_nsis
+ COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS}
+ $<$<CONFIG:Debug>:-DBUNDLE_DEBUG_DLLS>
+ $<$<BOOL:${MSVC}>:-DUSE_VCREDIST>
+ wireshark.nsi
+ WORKING_DIRECTORY ${_nsis_source_dir}
+ )
+ set_target_properties(wireshark_nsis PROPERTIES
+ FOLDER "Packaging"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ )
+ endif()
+
+ if(BUILD_logray)
+ # logray-qt-manifest.nsh. Created using Wireshark.exe.
+ add_custom_command(OUTPUT ${_nsis_binary_dir}/logray-qt-manifest.nsh
+ COMMAND set "PATH=${QT_BIN_PATH};%PATH%"
+ COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/windeployqt-to-nsis.ps1"
+ -Executable $<TARGET_FILE:logray>
+ -FilePath ${_nsis_binary_dir}/logray-qt-manifest.nsh
+ $<$<CONFIG:Debug>:-DebugConfig>
+ DEPENDS "${_nsis_source_dir}/windeployqt-to-nsis.ps1"
+ )
+
+ # Build NSIS package dependencies. We build the package in
+ # two stages so that logray_nsis below doesn't trigger
+ # any dependencies that might clobber any signed executables.
+ add_custom_target(logray_nsis_prep
+ DEPENDS
+ ${LOGRAY_NSIS_FILES}
+ copy_data_files
+ user_guide_html
+ faq_html
+ ${DATAFILE_DIR}/uninstall-logray.exe
+ )
+ set_target_properties(logray_nsis_prep PROPERTIES
+ FOLDER "Packaging"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ )
+
+ # Dump the installer into
+ # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/nsis
+ # Note that executables and DLLs *must* be built separately
+ add_custom_target(logray_nsis
+ COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS}
+ $<$<CONFIG:Debug>:-DBUNDLE_DEBUG_DLLS>
+ logray.nsi
+ WORKING_DIRECTORY ${_nsis_source_dir}
+ )
+ set_target_properties(logray_nsis PROPERTIES
+ FOLDER "Packaging"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ )
+ endif()
+endmacro( ADD_NSIS_PACKAGE_TARGETS )
+
+set(CLEAN_FILES
+ #NEWS.txt
+ #user-guide.chm
+ ${DATAFILE_DIR}/uninstall-wireshark.exe
+ wireshark-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe
+ wireshark-config.nsh
+ wireshark-manifest.nsh
+ wireshark-qt-manifest.nsh
+ ${DATAFILE_DIR}/uninstall-logray.exe
+ logray-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe
+ logray-config.nsh
+ logray-manifest.nsh
+ logray-qt-manifest.nsh
+)
diff --git a/packaging/nsis/DonatePage.ini b/packaging/nsis/DonatePage.ini
new file mode 100644
index 0000000..ccd9760
--- /dev/null
+++ b/packaging/nsis/DonatePage.ini
@@ -0,0 +1,19 @@
+[Settings]
+NumFields=2
+
+[Field 1]
+Type=Label
+Left=10
+Right=250
+Top=10
+Bottom=34
+Text=The Wireshark Foundation wants to help as many people as possible understand their networks as much as possible. Your donation helps to support Wireshark and host SharkFest.
+
+[Field 2]
+Type=Link
+Left=10
+Right=250
+Top=50
+Bottom=58
+Text=You can learn more and donate at https://wiresharkfoundation.org.
+State=https://wiresharkfoundation.org/
diff --git a/packaging/nsis/GetWindowsVersion.nsh b/packaging/nsis/GetWindowsVersion.nsh
new file mode 100644
index 0000000..d020129
--- /dev/null
+++ b/packaging/nsis/GetWindowsVersion.nsh
@@ -0,0 +1,190 @@
+; GetWindowsVersion 4.1.1 (2015-06-22) - alternate script with server versions
+;
+; https://nsis.sourceforge.io/Get_Windows_version
+;
+; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
+; Update by Joost Verburg
+; Update (Macro, Define, Windows 7 detection) - John T. Haller of PortableApps.com - 2008-01-07
+; Update (Windows 8 detection) - Marek Mizanin (Zanir) - 2013-02-07
+; Update (Windows 8.1 detection) - John T. Haller of PortableApps.com - 2014-04-04
+; Update (Windows 2008, 2008R2, 2012 and 2012R2 detection) - Francisco SimoƵes Filho franksimoes@gmail.com - 2014-08-25
+; Update (Windows 10 TP detection) - John T. Haller of PortableApps.com - 2014-10-01
+; Update (Windows 10 TP4 and 2016 detection, and added include guards) - Kairu - 2015-06-22
+;
+; Usage: ${GetWindowsVersion} $R0
+;
+; $R0 contains: 95, 98, ME, NT x.x, 2000, XP, 2003, Vista, 2008, 7, 2008R2,
+; 8, 2012, 8.1, 2012R2, 10.0, 2016 or '' (for unknown)
+
+!ifndef __GET_WINDOWS_VERSION_NSH
+!define __GET_WINDOWS_VERSION_NSH
+
+Function GetWindowsVersion
+
+ Push $R0
+ Push $R1
+ Push $R2
+
+ ClearErrors
+
+ ; check if Windows NT family
+ ReadRegStr $R0 HKLM \
+ "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+
+ IfErrors 0 lbl_winnt
+
+ ; we are not NT
+ ReadRegStr $R0 HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
+
+ StrCpy $R1 $R0 1
+ StrCmp $R1 '4' 0 lbl_error
+
+ StrCpy $R1 $R0 3
+
+ StrCmp $R1 '4.0' lbl_win32_95
+ StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
+
+ lbl_win32_95:
+ StrCpy $R0 '95'
+ Goto lbl_done
+
+ lbl_win32_98:
+ StrCpy $R0 '98'
+ Goto lbl_done
+
+ lbl_win32_ME:
+ StrCpy $R0 'ME'
+ Goto lbl_done
+
+ lbl_winnt:
+
+ ; check if Windows is Client or Server.
+ ReadRegStr $R2 HKLM \
+ "SOFTWARE\Microsoft\Windows NT\CurrentVersion" InstallationType
+
+ StrCpy $R1 $R0 1
+
+ StrCmp $R1 '3' lbl_winnt_x
+ StrCmp $R1 '4' lbl_winnt_x
+
+ StrCpy $R1 $R0 3
+
+ StrCmp $R1 '5.0' lbl_winnt_2000
+ StrCmp $R1 '5.1' lbl_winnt_XP
+ StrCmp $R1 '5.2' lbl_winnt_2003
+ StrCmp $R1 '6.0' lbl_winnt_vista_2008
+ StrCmp $R1 '6.1' lbl_winnt_7_2008R2
+ StrCmp $R1 '6.2' lbl_winnt_8_2012
+ StrCmp $R1 '6.3' lbl_winnt_81_2012R2
+ StrCmp $R1 '6.4' lbl_winnt_10_2016 ; the early Windows 10 tech previews used version 6.4
+
+ StrCpy $R1 $R0 4
+
+ StrCmp $R1 '10.0' lbl_winnt_10_2016
+ Goto lbl_error
+
+ lbl_winnt_x:
+ StrCpy $R0 "NT $R0" 6
+ Goto lbl_done
+
+ lbl_winnt_2000:
+ Strcpy $R0 '2000'
+ Goto lbl_done
+
+ lbl_winnt_XP:
+ Strcpy $R0 'XP'
+ Goto lbl_done
+
+ lbl_winnt_2003:
+ Strcpy $R0 '2003'
+ Goto lbl_done
+
+ ;----------------- Family - Vista / 2008 -------------
+ lbl_winnt_vista_2008:
+ StrCmp $R2 'Client' go_vista
+ StrCmp $R2 'Server' go_2008
+
+ go_vista:
+ Strcpy $R0 'Vista'
+ Goto lbl_done
+
+ go_2008:
+ Strcpy $R0 '2008'
+ Goto lbl_done
+ ;-----------------------------------------------------
+
+ ;----------------- Family - 7 / 2008R2 -------------
+ lbl_winnt_7_2008R2:
+ StrCmp $R2 'Client' go_7
+ StrCmp $R2 'Server' go_2008R2
+
+ go_7:
+ Strcpy $R0 '7'
+ Goto lbl_done
+
+ go_2008R2:
+ Strcpy $R0 '2008R2'
+ Goto lbl_done
+ ;-----------------------------------------------------
+
+ ;----------------- Family - 8 / 2012 -------------
+ lbl_winnt_8_2012:
+ StrCmp $R2 'Client' go_8
+ StrCmp $R2 'Server' go_2012
+
+ go_8:
+ Strcpy $R0 '8'
+ Goto lbl_done
+
+ go_2012:
+ Strcpy $R0 '2012'
+ Goto lbl_done
+ ;-----------------------------------------------------
+
+ ;----------------- Family - 8.1 / 2012R2 -------------
+ lbl_winnt_81_2012R2:
+ StrCmp $R2 'Client' go_81
+ StrCmp $R2 'Server' go_2012R2
+
+ go_81:
+ Strcpy $R0 '8.1'
+ Goto lbl_done
+
+ go_2012R2:
+ Strcpy $R0 '2012R2'
+ Goto lbl_done
+ ;-----------------------------------------------------
+
+ ;----------------- Family - 10 / 2016 -------------
+ lbl_winnt_10_2016:
+ StrCmp $R2 'Client' go_10
+ StrCmp $R2 'Server' go_2016
+
+ go_10:
+ Strcpy $R0 '10.0'
+ Goto lbl_done
+
+ go_2016:
+ Strcpy $R0 '2016'
+ Goto lbl_done
+ ;-----------------------------------------------------
+
+ lbl_error:
+ Strcpy $R0 ''
+ lbl_done:
+
+ Pop $R2
+ Pop $R1
+ Exch $R0
+
+FunctionEnd
+
+!macro GetWindowsVersion OUTPUT_VALUE
+ Call GetWindowsVersion
+ Pop `${OUTPUT_VALUE}`
+!macroend
+
+!define GetWindowsVersion '!insertmacro "GetWindowsVersion"'
+
+!endif
diff --git a/packaging/nsis/InstallMSYS2.cmake b/packaging/nsis/InstallMSYS2.cmake
new file mode 100644
index 0000000..a383e4c
--- /dev/null
+++ b/packaging/nsis/InstallMSYS2.cmake
@@ -0,0 +1,71 @@
+set(MINGW_BIN $ENV{MINGW_PREFIX}/bin)
+
+if(USE_MSYSTEM)
+ # mingw-w64 dlls
+ # (use msys2checkdeps.py to list required libraries / check for missing or unused libraries)
+ file(GLOB MINGW_DLLS
+ ${MINGW_BIN}/libLerc.dll
+ ${MINGW_BIN}/libb2-*.dll
+ ${MINGW_BIN}/libbrotlicommon.dll
+ ${MINGW_BIN}/libbrotlidec.dll
+ ${MINGW_BIN}/libbrotlienc.dll
+ ${MINGW_BIN}/libbz2-*.dll
+ ${MINGW_BIN}/libbcg729.dll
+ ${MINGW_BIN}/libcares-*.dll
+ ${MINGW_BIN}/libcrypto-*-x64.dll
+ ${MINGW_BIN}/libdeflate.dll
+ ${MINGW_BIN}/libdouble-conversion.dll
+ ${MINGW_BIN}/libexpat-*.dll
+ ${MINGW_BIN}/libffi-*.dll
+ ${MINGW_BIN}/libfreetype-*.dll
+ ${MINGW_BIN}/libgcc_s_seh-*.dll
+ ${MINGW_BIN}/libgcrypt-*.dll
+ ${MINGW_BIN}/libglib-2.0-*.dll
+ ${MINGW_BIN}/libgmodule-2.0-*.dll
+ ${MINGW_BIN}/libgmp-*.dll
+ ${MINGW_BIN}/libgnutls-*.dll
+ ${MINGW_BIN}/libgpg-error-*.dll
+ ${MINGW_BIN}/libgraphite2.dll
+ ${MINGW_BIN}/libharfbuzz-*.dll
+ ${MINGW_BIN}/libhogweed-*.dll
+ ${MINGW_BIN}/libiconv-*.dll
+ ${MINGW_BIN}/libicudt*.dll
+ ${MINGW_BIN}/libicuin*.dll
+ ${MINGW_BIN}/libicuuc*.dll
+ ${MINGW_BIN}/libilbc.dll
+ ${MINGW_BIN}/libidn2-*.dll
+ ${MINGW_BIN}/libintl-*.dll
+ ${MINGW_BIN}/libjbig-*.dll
+ ${MINGW_BIN}/libjpeg-*.dll
+ ${MINGW_BIN}/liblz4.dll
+ ${MINGW_BIN}/liblzma-*.dll
+ ${MINGW_BIN}/libmd4c.dll
+ ${MINGW_BIN}/libmaxminddb.dll
+ ${MINGW_BIN}/libminizip-*.dll
+ ${MINGW_BIN}/libnettle-*.dll
+ ${MINGW_BIN}/libnghttp2-*.dll
+ ${MINGW_BIN}/libopus-*.dll
+ ${MINGW_BIN}/libp11-kit-*.dll
+ ${MINGW_BIN}/libpcre2-16-*.dll
+ ${MINGW_BIN}/libpcre2-8-*.dll
+ ${MINGW_BIN}/libpng16-*.dll
+ ${MINGW_BIN}/libsbc-*.dll
+ ${MINGW_BIN}/libsharpyuv-*.dll
+ ${MINGW_BIN}/libsmi-*.dll
+ ${MINGW_BIN}/libsnappy.dll
+ ${MINGW_BIN}/libspandsp-*.dll
+ ${MINGW_BIN}/libspeexdsp-*.dll
+ ${MINGW_BIN}/libssh.dll
+ ${MINGW_BIN}/libstdc++-*.dll
+ ${MINGW_BIN}/libtasn1-*.dll
+ ${MINGW_BIN}/libtiff-*.dll
+ ${MINGW_BIN}/libunistring-*.dll
+ ${MINGW_BIN}/libwebp-*.dll
+ ${MINGW_BIN}/libunistring-*.dll
+ ${MINGW_BIN}/libwinpthread-*.dll
+ ${MINGW_BIN}/libxml2-*.dll
+ ${MINGW_BIN}/libzstd.dll
+ ${MINGW_BIN}/lua51.dll
+ ${MINGW_BIN}/zlib1.dll
+ )
+endif()
diff --git a/packaging/nsis/InstallMinGW.cmake b/packaging/nsis/InstallMinGW.cmake
new file mode 100644
index 0000000..effec0b
--- /dev/null
+++ b/packaging/nsis/InstallMinGW.cmake
@@ -0,0 +1,55 @@
+set(MINGW_SYSROOT "/usr/x86_64-w64-mingw32/sys-root/mingw" CACHE FILEPATH "Path to MinGW system root bindir")
+set(MINGW_BINDIR ${MINGW_SYSROOT}/bin)
+
+if(MINGW)
+ # mingw-w64 dlls
+ file(GLOB MINGW_DLLS
+ ${MINGW_BINDIR}/iconv.dll
+ ${MINGW_BINDIR}/icudata72.dll
+ ${MINGW_BINDIR}/icui18n72.dll
+ ${MINGW_BINDIR}/icuuc72.dll
+ ${MINGW_BINDIR}/libbrotlicommon.dll
+ ${MINGW_BINDIR}/libbrotlidec.dll
+ ${MINGW_BINDIR}/libbrotlienc.dll
+ ${MINGW_BINDIR}/libbz2-1.dll
+ ${MINGW_BINDIR}/libcares-*.dll
+ ${MINGW_BINDIR}/libcrypto-3-x64.dll
+ ${MINGW_BINDIR}/libexpat-1.dll
+ ${MINGW_BINDIR}/libffi-8.dll
+ ${MINGW_BINDIR}/libfontconfig-1.dll
+ ${MINGW_BINDIR}/libfreetype-6.dll
+ ${MINGW_BINDIR}/libgcc_s_seh-1.dll
+ ${MINGW_BINDIR}/libgcrypt-20.dll
+ ${MINGW_BINDIR}/libglib-2.0-0.dll
+ ${MINGW_BINDIR}/libgmodule-2.0-0.dll
+ ${MINGW_BINDIR}/libgmp-10.dll
+ ${MINGW_BINDIR}/libgnutls-30.dll
+ ${MINGW_BINDIR}/libgpg-error-0.dll
+ ${MINGW_BINDIR}/libgraphite2.dll
+ ${MINGW_BINDIR}/libharfbuzz-0.dll
+ ${MINGW_BINDIR}/libhogweed-6.dll
+ ${MINGW_BINDIR}/libiconv-*.dll
+ ${MINGW_BINDIR}/libidn2-*.dll
+ ${MINGW_BINDIR}/libintl-8.dll
+ ${MINGW_BINDIR}/liblz4.dll
+ ${MINGW_BINDIR}/liblzma-5.dll
+ ${MINGW_BINDIR}/libminizip-*.dll
+ ${MINGW_BINDIR}/libnettle-8.dll
+ ${MINGW_BINDIR}/libnghttp2-*.dll
+ ${MINGW_BINDIR}/libopus-0.dll
+ ${MINGW_BINDIR}/libp11-kit-0.dll
+ ${MINGW_BINDIR}/libpcre2-16-0.dll
+ ${MINGW_BINDIR}/libpcre2-8-0.dll
+ ${MINGW_BINDIR}/libpng16-16.dll
+ ${MINGW_BINDIR}/libsnappy.dll
+ ${MINGW_BINDIR}/libspeexdsp-1.dll
+ ${MINGW_BINDIR}/libssp-0.dll
+ ${MINGW_BINDIR}/libstdc++-6.dll
+ ${MINGW_BINDIR}/libtasn1-6.dll
+ ${MINGW_BINDIR}/libunistring-*.dll
+ ${MINGW_BINDIR}/libwinpthread-1.dll
+ ${MINGW_BINDIR}/libxml2-2.dll
+ ${MINGW_BINDIR}/libzstd.dll
+ ${MINGW_BINDIR}/zlib1.dll
+ )
+endif()
diff --git a/packaging/nsis/NpcapPage.ini b/packaging/nsis/NpcapPage.ini
new file mode 100644
index 0000000..1b523c7
--- /dev/null
+++ b/packaging/nsis/NpcapPage.ini
@@ -0,0 +1,85 @@
+[Settings]
+NumFields=10
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=25
+Text=Currently installed Npcap or WinPcap version
+
+[Field 2]
+Type=Label
+Left=10
+Right=250
+Top=10
+Bottom=18
+Text=This text will be replaced with current Npcap installer version
+
+[Field 3]
+Type=GroupBox
+Left=0
+Right=-1
+Top=30
+Bottom=65
+Text=Install
+
+[Field 4]
+Type=CheckBox
+Left=10
+Right=250
+Top=40
+Bottom=48
+Text=This text will be replaced, depending on current Npcap version in wireshark.nsi
+State=1
+
+[Field 5]
+Type=Label
+Left=20
+Right=290
+Top=50
+Bottom=58
+Text=This text will be replaced, depending on whether Npcap is already installed
+
+[Field 6]
+Type=GroupBox
+Left=0
+Right=-1
+Top=70
+Bottom=105
+Text=Important notice
+
+[Field 7]
+Type=Label
+Left=10
+Right=290
+Top=80
+Bottom=88
+Text=If your system has crashed during a Wireshark installation, you must run the command
+
+[Field 8]
+Type=Label
+Left=10
+Right=295
+Top=89
+Bottom=97
+Text='net stop npcap' as Administrator before upgrading Npcap, so that it doesn't crash again
+
+[Field 9]
+Type=Link
+Left=0
+Right=290
+Top=112
+Bottom=120
+Text=Get WinPcap
+State=https://www.winpcap.org/
+
+[Field 10]
+Type=Link
+Left=0
+Right=290
+Top=127
+Bottom=135
+Text=Learn more about Npcap and WinPcap
+State=https://gitlab.com/wireshark/wireshark/-/wikis/WinPcap
diff --git a/packaging/nsis/USBPcapPage.ini b/packaging/nsis/USBPcapPage.ini
new file mode 100644
index 0000000..b1097e0
--- /dev/null
+++ b/packaging/nsis/USBPcapPage.ini
@@ -0,0 +1,77 @@
+[Settings]
+NumFields=9
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=25
+Text=Currently installed USBPcap version
+
+[Field 2]
+Type=Label
+Left=10
+Right=250
+Top=10
+Bottom=18
+Text=This text will be replaced with current USBPcap installer version
+
+[Field 3]
+Type=GroupBox
+Left=0
+Right=-1
+Top=30
+Bottom=65
+Text=Install
+
+[Field 4]
+Type=CheckBox
+Left=10
+Right=250
+Top=40
+Bottom=48
+Text=This text will be replaced, depending on current USBPcap version in wireshark.nsi
+State=0
+
+[Field 5]
+Type=Label
+Left=20
+Right=290
+Top=50
+Bottom=58
+Text=This text will be replaced, depending if USBPcap is already installed
+
+[Field 6]
+Type=GroupBox
+Left=0
+Right=-1
+Top=70
+Bottom=105
+Text=Important notice
+
+[Field 7]
+Type=Label
+Left=10
+Right=290
+Top=80
+Bottom=88
+Text=In case of issue after installation, please use the system restore point created or read
+
+[Field 8]
+Type=Link
+Left=10
+Right=250
+Top=89
+Bottom=97
+Text=https://github.com/desowin/usbpcap/issues/3
+State=https://github.com/desowin/usbpcap/issues/3
+
+[Field 9]
+Type=Link
+Left=0
+Right=290
+Top=127
+Bottom=135
+Text=Learn more about USBPcap
+State=https://desowin.org/usbpcap/
diff --git a/packaging/nsis/custom_diameter_xmls.txt b/packaging/nsis/custom_diameter_xmls.txt
new file mode 100644
index 0000000..b89ce66
--- /dev/null
+++ b/packaging/nsis/custom_diameter_xmls.txt
@@ -0,0 +1,3 @@
+;Add your custom diameter dictionary here
+; Example:
+;File "${STAGING_DIR}\diameter\foo.xml"
diff --git a/packaging/nsis/custom_mibs.txt b/packaging/nsis/custom_mibs.txt
new file mode 100644
index 0000000..5b863a9
--- /dev/null
+++ b/packaging/nsis/custom_mibs.txt
@@ -0,0 +1,4 @@
+; Add your custom SNMP MIBS directives here
+; Example:
+; Point to the dir of the MIBS
+;File "mymibdirpath\mibs\*"
diff --git a/packaging/nsis/custom_plugins.txt b/packaging/nsis/custom_plugins.txt
new file mode 100644
index 0000000..1233805
--- /dev/null
+++ b/packaging/nsis/custom_plugins.txt
@@ -0,0 +1,3 @@
+;Add your custom plugins directives here
+; Example:
+;File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\foo.dll"
diff --git a/packaging/nsis/custom_radius_dict.txt b/packaging/nsis/custom_radius_dict.txt
new file mode 100644
index 0000000..48ecad6
--- /dev/null
+++ b/packaging/nsis/custom_radius_dict.txt
@@ -0,0 +1,3 @@
+;Add your custom radius dictionary here
+; Example:
+;File "..\..\radius\dictionary.foo" \ No newline at end of file
diff --git a/packaging/nsis/logray-additional-tasks.nsddef b/packaging/nsis/logray-additional-tasks.nsddef
new file mode 100644
index 0000000..853e958
--- /dev/null
+++ b/packaging/nsis/logray-additional-tasks.nsddef
@@ -0,0 +1,17 @@
+ļ»æ<?xml version="1.0" encoding="UTF-8"?>
+<!--
+This file was created by NSISDialogDesigner 1.5.0.0
+https://coolsoft.altervista.org/nsisdialogdesigner
+Do not edit manually!
+-->
+<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
+ <CreateFunctionCustomScript>; Defined in logray.nsi
+Call InitAdditionalTasksPage</CreateFunctionCustomScript>
+ <Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" />
+ <CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Logray" TabIndex="1" />
+ <CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Logray Quick Launch Icon" TabIndex="2" />
+ <CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Logray Desktop Icon" TabIndex="3" />
+ <CheckBox Name="StartMenuCheckBox" Location="22, 34" Size="406, 14" Text="Logray Start Menu Item" TabIndex="4" />
+ <Label Name="FileExtensionsLabel" Location="12, 101" Size="426, 14" Text="Associate File Extensions" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="5" />
+ <Label Name="CreateShortcutsLabel" Location="12, 9" Size="426, 14" Text="Create Shortcuts" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="6" />
+</Dialog>
diff --git a/packaging/nsis/logray-additional-tasks.nsdinc b/packaging/nsis/logray-additional-tasks.nsdinc
new file mode 100644
index 0000000..f35dee8
--- /dev/null
+++ b/packaging/nsis/logray-additional-tasks.nsdinc
@@ -0,0 +1,75 @@
+; =========================================================
+; This file was generated by NSISDialogDesigner 1.5.0.0
+; https://coolsoft.altervista.org/nsisdialogdesigner
+;
+; Do not edit it manually, use NSISDialogDesigner instead!
+; =========================================================
+
+; handle variables
+Var hCtl_AdditionalTasksPage
+Var hCtl_AdditionalTasksPage_ExtensionsLabel
+Var hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox
+Var hCtl_AdditionalTasksPage_QuickLaunchCheckBox
+Var hCtl_AdditionalTasksPage_DesktopIconCheckBox
+Var hCtl_AdditionalTasksPage_StartMenuCheckBox
+Var hCtl_AdditionalTasksPage_FileExtensionsLabel
+Var hCtl_AdditionalTasksPage_CreateShortcutsLabel
+Var hCtl_AdditionalTasksPage_Font1
+
+
+; dialog create function
+Function fnc_AdditionalTasksPage_Create
+
+ ; custom font definitions
+ CreateFont $hCtl_AdditionalTasksPage_Font1 "Microsoft Sans Serif" "8.25" "700"
+
+ ; === AdditionalTasksPage (type: Dialog) ===
+ nsDialogs::Create 1018
+ Pop $hCtl_AdditionalTasksPage
+ ${If} $hCtl_AdditionalTasksPage == error
+ Abort
+ ${EndIf}
+ !insertmacro MUI_HEADER_TEXT "Additional Tasks" "Create shortcuts and associate file extensions."
+
+ ; === ExtensionsLabel (type: Label) ===
+ ${NSD_CreateLabel} 14u 93u 245u 32u "Extensions include scap."
+ Pop $hCtl_AdditionalTasksPage_ExtensionsLabel
+
+ ; === AssociateExtensionsCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 78u 267u 9u "Associate log file extensions with Logray"
+ Pop $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox
+
+ ; === QuickLaunchCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 46u 267u 9u "Logray Quick Launch Icon"
+ Pop $hCtl_AdditionalTasksPage_QuickLaunchCheckBox
+
+ ; === DesktopIconCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 33u 267u 9u "Logray Desktop Icon"
+ Pop $hCtl_AdditionalTasksPage_DesktopIconCheckBox
+
+ ; === StartMenuCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 21u 267u 9u "Logray Start Menu Item"
+ Pop $hCtl_AdditionalTasksPage_StartMenuCheckBox
+
+ ; === FileExtensionsLabel (type: Label) ===
+ ${NSD_CreateLabel} 8u 62u 280u 9u "Associate File Extensions"
+ Pop $hCtl_AdditionalTasksPage_FileExtensionsLabel
+ SendMessage $hCtl_AdditionalTasksPage_FileExtensionsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0
+
+ ; === CreateShortcutsLabel (type: Label) ===
+ ${NSD_CreateLabel} 8u 6u 280u 9u "Create Shortcuts"
+ Pop $hCtl_AdditionalTasksPage_CreateShortcutsLabel
+ SendMessage $hCtl_AdditionalTasksPage_CreateShortcutsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0
+
+ ; CreateFunctionCustomScript
+ ; Defined in logray.nsi
+ Call InitAdditionalTasksPage
+
+
+FunctionEnd
+
+; dialog show function
+Function fnc_AdditionalTasksPage_Show
+ Call fnc_AdditionalTasksPage_Create
+ nsDialogs::Show
+FunctionEnd
diff --git a/packaging/nsis/logray-common.nsh b/packaging/nsis/logray-common.nsh
new file mode 100644
index 0000000..4eaacd5
--- /dev/null
+++ b/packaging/nsis/logray-common.nsh
@@ -0,0 +1,126 @@
+
+; ============================================================================
+; Name and version information
+; ============================================================================
+
+Unicode true
+; This improves the installer's appearance considerably here on a display scaled
+; to 225%, but checkboxes are comically small. We might be able to fix this
+; using the SysCompImg extension:
+; http://forums.winamp.com/showthread.php?t=443754
+ManifestDPIAware true
+; These might be correct in the future, but are currently undocumented:
+; http://forums.winamp.com/showthread.php?t=452632
+; ManifestDPIAware System
+; ManifestDPIAwareness "PerMonitorV2,System"
+
+!ifdef NSIS_INCLUDE_DIR
+!addincludedir ${NSIS_INCLUDE_DIR}
+!endif
+
+!include "logray-config.nsh"
+
+!define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} ${WIRESHARK_TARGET_PLATFORM}"
+Name "${DISPLAY_NAME}"
+
+!define PROGRAM_FULL_NAME "The ${PROGRAM_NAME} Log Analyzer"
+!define PROGRAM_NAME_PATH "${PROGRAM_NAME}.exe"
+
+!define UNINSTALLER_NAME "uninstall-logray.exe"
+
+VIAddVersionKey "ProductName" "${PROGRAM_NAME}"
+VIAddVersionKey "Comments" "My manta ray is all right."
+VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team"
+; NSIS handles U+00a9 but not a UTF-8 encoded copyright symbol.
+VIAddVersionKey "LegalCopyright" "${U+00a9} Gerald Combs and many others"
+VIAddVersionKey "LegalTrademarks" "Logray and the 'ray' logo are registered trademarks"
+VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for Windows on ${WIRESHARK_TARGET_PLATFORM}"
+VIAddVersionKey "Language" "English"
+VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
+VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
+VIProductVersion "${PRODUCT_VERSION}"
+
+XPStyle on
+
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+; Used to refresh the display of file association
+!define SHCNE_ASSOCCHANGED 0x08000000
+!define SHCNF_IDLIST 0
+
+!macro UpdateIcons
+ Push $R0
+ Push $R1
+ Push $R2
+
+ !define UPDATEICONS_UNIQUE ${__LINE__}
+
+ IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
+UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+ Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
+ MessageBox MB_OK|MB_ICONSTOP \
+ "Can't find 'shell32.dll' library. Impossible to update icons" \
+ /SD IDOK
+ Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
+ !undef UPDATEICONS_UNIQUE
+ Pop $R2
+ Pop $R1
+ Pop $R0
+
+; Force the icon cache to refresh
+; https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
+IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2
+Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
+
+!macroend
+
+; ============================================================================
+; Push our known file extensions onto the stack, prepended with a marker
+; Note that this is a subset of dump_open_table in wiretap/file_access.c. We
+; probably don't want to grab JPEG or MP3 files.
+; ============================================================================
+
+; Used to add associations between file extensions and Logray
+!define LOGRAY_ASSOC "logray-log-file"
+
+!define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER"
+
+!macro PushFileExtensions
+ Push "${FILE_EXTENSION_MARKER}"
+ Push ".scap"
+!macroend
+
+!macro IsLograyRunning
+; See if Logray is running
+; https://nsis.sourceforge.io/Check_whether_your_application_is_running
+${Do}
+
+ System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
+ IntCmp $R0 0 checkRunningSession
+ System::Call 'kernel32::CloseHandle(i $R0)'
+ Goto isRunning
+
+checkRunningSession:
+ System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
+ IntCmp $R0 0 notRunning
+ System::Call 'kernel32::CloseHandle(i $R0)'
+
+isRunning:
+ ; You'd better go catch it.
+ MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking
+ Quit
+
+notRunning:
+ ${ExitDo}
+
+continueChecking:
+${Loop}
+!macroend
diff --git a/packaging/nsis/logray-config.nsh.in b/packaging/nsis/logray-config.nsh.in
new file mode 100644
index 0000000..b083272
--- /dev/null
+++ b/packaging/nsis/logray-config.nsh.in
@@ -0,0 +1,30 @@
+# ============================================================================
+# NSIS configuration definitions. Generated from wireshark-config.nsh.in.
+# ============================================================================
+
+# Do not prefix comments with ";". They will be removed by CMake.
+
+# MUST match "<Product ... Name=" in wix/Wireshark.wxs.
+#define PROGRAM_NAME "@LOG_PROGRAM_NAME@"
+#define TOP_SRC_DIR "@TOP_SRC_DIR@"
+#define WIRESHARK_TARGET_PLATFORM @WIRESHARK_TARGET_PLATFORM@
+#define EXTRA_INSTALLER_DIR "@EXTRA_INSTALLER_DIR@"
+#define VERSION @LOG_PROJECT_VERSION@
+#define PRODUCT_VERSION @LOG_PRODUCT_VERSION@
+# Plugins
+#define MAJOR_VERSION @PROJECT_MAJOR_VERSION@
+#define MINOR_VERSION @PROJECT_MINOR_VERSION@
+
+#define VCREDIST_DIR "@VCREDIST_DIR@"
+#define VCREDIST_EXE "@VCREDIST_EXE@"
+
+# Optional components
+
+#cmakedefine MMDBRESOLVE_EXE @MMDBRESOLVE_EXE@
+
+# Skip the User's Guide until we have one of our own.
+#cmakeundefine DOCBOOK_DIR
+
+#cmakedefine SMI_DIR "@SMI_DIR@"
+
+#cmakedefine QT_DIR "@QT_DIR@"
diff --git a/packaging/nsis/logray.nsi b/packaging/nsis/logray.nsi
new file mode 100644
index 0000000..e87e3ca
--- /dev/null
+++ b/packaging/nsis/logray.nsi
@@ -0,0 +1,1105 @@
+;
+; logray.nsi
+;
+
+; Set the compression mechanism first.
+; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
+; is no longer the default, so use the /SOLID switch.
+; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
+; So if you get an error here, please update to at least NSIS 2.07!
+SetCompressor /SOLID lzma
+SetCompressorDictSize 64 ; MB
+
+!include "logray-common.nsh"
+!include 'LogicLib.nsh'
+!include "StrFunc.nsh"
+!include "WordFunc.nsh"
+
+; See https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time for documentation
+!macro !defineifexist _VAR_NAME _FILE_NAME
+ !tempfile _TEMPFILE
+ !ifdef NSIS_WIN32_MAKENSIS
+ ; Windows - cmd.exe
+ !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
+ !else
+ ; Posix - sh
+ !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
+ !endif
+ !include '${_TEMPFILE}'
+ !delfile '${_TEMPFILE}'
+ !undef _TEMPFILE
+!macroend
+!define !defineifexist "!insertmacro !defineifexist"
+
+; ============================================================================
+; Header configuration
+; ============================================================================
+
+; The file to write
+OutFile "${OUTFILE_DIR}\${PROGRAM_NAME}-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe"
+; Installer icon
+Icon "${TOP_SRC_DIR}\resources\icons\lograyinst.ico"
+
+; ============================================================================
+; Modern UI
+; ============================================================================
+; The modern user interface will look much better than the common one.
+; However, as the development of the modern UI is still going on, and the script
+; syntax changes, you will need exactly that NSIS version, which this script is
+; made for. This is the current (December 2003) latest version: V2.0b4
+; If you are using a different version, it's not predictable what will happen.
+
+!include "MUI2.nsh"
+!include "InstallOptions.nsh"
+;!addplugindir ".\Plugins"
+
+!define MUI_ICON "${TOP_SRC_DIR}\resources\icons\lograyinst.ico"
+BrandingText "Logray${U+00ae} Installer"
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue."
+
+; NSIS shows Readme files by opening the Readme file with the default application for
+; the file's extension. "README.win32" won't work in most cases, because extension "win32"
+; is usually not associated with an appropriate text editor. We should use extension "txt"
+; for a text file or "html" for an html README file.
+!define MUI_FINISHPAGE_TITLE_3LINES
+!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
+!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+; NSIS runs as Administrator and will run Logray as Administrator
+; if these are enabled.
+;!define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH}"
+;!define MUI_FINISHPAGE_RUN_NOTCHECKED
+
+; ============================================================================
+; MUI Pages
+; ============================================================================
+
+!insertmacro MUI_PAGE_WELCOME
+
+!define MUI_LICENSEPAGE_TEXT_TOP "Logray is distributed under the GNU General Public License."
+!define MUI_LICENSEPAGE_TEXT_BOTTOM "This is not an end user license agreement (EULA). It is provided here for informational purposes only."
+!define MUI_LICENSEPAGE_BUTTON "Noted"
+!insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt"
+
+!insertmacro MUI_PAGE_COMPONENTS
+!ifdef QT_DIR
+Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage
+!endif
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+
+; ============================================================================
+; MUI Languages
+; ============================================================================
+
+!insertmacro MUI_LANGUAGE "English"
+
+; ============================================================================
+; Reserve Files
+; ============================================================================
+
+ ;Things that need to be extracted on first (keep these lines before any File command!)
+ ;Only useful for BZIP2 compression
+
+ ; Old Modern 1 UI: https://nsis.sourceforge.io/Docs/Modern%20UI/Readme.html
+ ; To do: Upgrade to the Modern 2 UI:
+ ;ReserveFile "AdditionalTasksPage.ini"
+ ReserveFile /plugin InstallOptions.dll
+
+ ; Modern UI 2 / nsDialog pages.
+ ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html
+ ; https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html
+ !ifdef QT_DIR
+ !include "logray-additional-tasks.nsdinc"
+ !endif
+
+; ============================================================================
+; Section macros
+; ============================================================================
+!include "Sections.nsh"
+
+; ============================================================================
+; Command Line
+; ============================================================================
+!include "FileFunc.nsh"
+
+!insertmacro GetParameters
+!insertmacro GetOptions
+
+; ========= Install extcap binary and help file =========
+!macro InstallExtcap EXTCAP_NAME
+
+ SetOutPath $INSTDIR
+ File "${STAGING_DIR}\${EXTCAP_NAME}.html"
+ SetOutPath $INSTDIR\extcap
+ File "${STAGING_DIR}\extcap\${EXTCAP_NAME}.exe"
+
+!macroend
+
+; ========= Check if silent mode install of /EXTRACOMPONENTS =========
+!macro CheckExtrasFlag EXTRAS_NAME
+ !define EXTRAS_FLAG ${__LINE__}
+Section
+ IfSilent +1 skip_${EXTRAS_FLAG}
+ push $R0
+ push $R1
+ push $R2
+ ${GetParameters} $R0
+ ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1
+ IfErrors popreg_${EXTRAS_FLAG}
+ ${WordFind} $R1 "," "E+1" $R0
+
+; No delimiters found - check for single word match
+ ${If} $R0 = 1
+ StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG}
+ ${ENDIF}
+
+; Loop through all delimited words checking for match
+ IntOp $R2 0 + 1
+ ${While} $R0 != 2
+ StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0
+ IntOp $R2 $R2 + 1
+ ${WordFind} $R1 "," "E+$R2" $R0
+ ${EndWhile}
+ Goto popreg_${EXTRAS_FLAG}
+
+install_${EXTRAS_FLAG}:
+ !insertmacro InstallExtcap ${EXTRAS_NAME}
+popreg_${EXTRAS_FLAG}:
+ pop $R2
+ pop $R1
+ pop $R0
+skip_${EXTRAS_FLAG}:
+ !undef EXTRAS_FLAG
+SectionEnd
+!macroend
+
+; ============================================================================
+; Component page configuration
+; ============================================================================
+ComponentText "The following components are available for installation."
+
+; ============================================================================
+; Directory selection page configuration
+; ============================================================================
+; The text to prompt the user to enter a directory
+DirText "Choose a directory in which to install ${PROGRAM_NAME}."
+
+; The default installation directory
+InstallDir $PROGRAMFILES64\${PROGRAM_NAME}
+
+; See if this is an upgrade; if so, use the old InstallDir as default
+InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir
+
+
+; ============================================================================
+; Install page configuration
+; ============================================================================
+ShowInstDetails show
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+Var EXTENSION
+; https://docs.microsoft.com/en-us/windows/win32/shell/fa-file-types
+Function Associate
+ Push $R0
+ !insertmacro PushFileExtensions
+
+ Pop $EXTENSION
+
+ ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
+ ReadRegStr $R0 HKCR $EXTENSION ""
+ StrCmp $R0 "" Associate.doRegister
+ Goto Associate.end
+
+Associate.doRegister:
+ ;The extension is not associated to any program, we can do the link
+ WriteRegStr HKCR $EXTENSION "" ${LOGRAY_ASSOC}
+ DetailPrint "Registered file type: $EXTENSION"
+
+Associate.end:
+ Pop $EXTENSION
+ ${Loop}
+
+ Pop $R0
+FunctionEnd
+
+; Control states
+Var START_MENU_STATE
+Var DESKTOP_ICON_STATE
+Var FILE_ASSOCIATE_STATE
+
+; NSIS
+Var OLD_UNINSTALLER
+Var OLD_INSTDIR
+Var OLD_DISPLAYNAME
+Var TMP_UNINSTALLER
+
+; WiX
+Var REGISTRY_BITS
+Var TMP_PRODUCT_GUID
+Var WIX_DISPLAYNAME
+Var WIX_DISPLAYVERSION
+Var WIX_UNINSTALLSTRING
+
+; ============================================================================
+; 64-bit support
+; ============================================================================
+!include x64.nsh
+
+!include "GetWindowsVersion.nsh"
+!include WinMessages.nsh
+
+Function .onInit
+ !if ${WIRESHARK_TARGET_PLATFORM} == "x64"
+ ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
+ ${IfNot} ${RunningX64}
+ MessageBox MB_OK "Logray only runs on 64-bit machines." /SD IDOK
+ Abort
+ ${EndIf}
+ !endif
+
+ ; Get the Windows version
+ ${GetWindowsVersion} $R0
+
+ ; This should match the following:
+ ; - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in
+ ; - The <compatibility><application> section in image\wireshark.exe.manifest.in
+ ; - The VersionNT parts of packaging\wix\Prerequisites.wxi
+
+ ; Uncomment to test.
+ ; MessageBox MB_OK "You're running Windows $R0."
+
+ ; Check if we're able to run with this version
+ StrCmp $R0 '95' lbl_winversion_unsupported
+ StrCmp $R0 '98' lbl_winversion_unsupported
+ StrCmp $R0 'ME' lbl_winversion_unsupported
+ StrCmp $R0 'NT 4.0' lbl_winversion_unsupported
+ StrCmp $R0 '2000' lbl_winversion_unsupported
+ StrCmp $R0 'XP' lbl_winversion_unsupported
+ StrCmp $R0 '2003' lbl_winversion_unsupported
+ StrCmp $R0 'Vista' lbl_winversion_unsupported
+ StrCmp $R0 '2008' lbl_winversion_unsupported
+ Goto lbl_winversion_supported
+
+lbl_winversion_unsupported:
+ MessageBox MB_OK \
+ "Windows $R0 is not supported." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_supported:
+!insertmacro IsLograyRunning
+
+ ; Default control values.
+ StrCpy $START_MENU_STATE ${BST_CHECKED}
+ StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
+ StrCpy $FILE_ASSOCIATE_STATE ${BST_CHECKED}
+
+ ; Copied from https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new
+ ReadRegStr $OLD_UNINSTALLER HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+ "UninstallString"
+ StrCmp $OLD_UNINSTALLER "" check_wix
+
+ ReadRegStr $OLD_INSTDIR HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \
+ "Path"
+ StrCmp $OLD_INSTDIR "" check_wix
+
+ ReadRegStr $OLD_DISPLAYNAME HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+ "DisplayName"
+ StrCmp $OLD_DISPLAYNAME "" done
+
+ ; We're reinstalling. Flip our control states according to what the
+ ; user chose before.
+ ; (we use the "all users" start menu, so select it first)
+ SetShellVarContext all
+ ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 1 sm $START_MENU_STATE di $DESKTOP_ICON_STATE"
+ ${IfNot} ${FileExists} $SMPROGRAMS\${PROGRAM_NAME}.lnk
+ StrCpy $START_MENU_STATE ${BST_UNCHECKED}
+ ${Endif}
+ ${If} ${FileExists} $DESKTOP\${PROGRAM_NAME}.lnk
+ StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
+ ${Endif}
+ ; Leave FILE_ASSOCIATE_STATE checked.
+ ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 2 sm $START_MENU_STATE $SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk \
+ ; $\ndi $DESKTOP_ICON_STATE $DESKTOP\${PROGRAM_NAME}.lnk
+
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$OLD_DISPLAYNAME is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ /SD IDYES \
+ IDYES prep_nsis_uninstaller \
+ IDNO done
+ Abort
+
+; Copy the uninstaller to $TEMP and run it.
+; The uninstaller normally does this by itself, but doesn't wait around
+; for the executable to finish, which means ExecWait won't work correctly.
+prep_nsis_uninstaller:
+ ClearErrors
+ StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
+ ; ...because we surround UninstallString in quotes.
+ StrCpy $0 $OLD_UNINSTALLER -1 1
+ StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
+ StrCpy $2 1
+ System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
+ ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
+
+ Delete "$TMP_UNINSTALLER"
+
+; Look for a WiX-installed package.
+
+check_wix:
+ StrCpy $REGISTRY_BITS 64
+ SetRegView 64
+ check_wix_restart:
+ StrCpy $0 0
+ wix_reg_enum_loop:
+ EnumRegKey $TMP_PRODUCT_GUID HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
+ StrCmp $TMP_PRODUCT_GUID "" wix_enum_reg_done
+ IntOp $0 $0 + 1
+ ReadRegStr $WIX_DISPLAYNAME HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "DisplayName"
+ ; MessageBox MB_OK|MB_ICONINFORMATION "Reading HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1 DisplayName = $2"
+ ; Look for "Logray".
+ StrCmp $WIX_DISPLAYNAME "${PROGRAM_NAME}" wix_found wix_reg_enum_loop
+
+ wix_found:
+ ReadRegStr $WIX_DISPLAYVERSION HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "DisplayVersion"
+ ReadRegStr $WIX_UNINSTALLSTRING HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "UninstallString"
+ StrCmp $WIX_UNINSTALLSTRING "" done
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$WIX_DISPLAYNAME $WIX_DISPLAYVERSION (msi) is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ /SD IDYES \
+ IDYES prep_wix_uninstaller \
+ IDNO done
+ Abort
+
+ ; Run the WiX-provided UninstallString.
+ prep_wix_uninstaller:
+ ClearErrors
+ ExecWait "$WIX_UNINSTALLSTRING"
+
+ Goto done
+
+ wix_enum_reg_done:
+ ; MessageBox MB_OK|MB_ICONINFORMATION "Checked $0 $REGISTRY_BITS bit keys"
+ IntCmp $REGISTRY_BITS 32 done
+ StrCpy $REGISTRY_BITS 32
+ SetRegView 32
+ Goto check_wix_restart
+
+done:
+
+ ; Command line parameters
+ ${GetParameters} $R0
+
+ ${GetOptions} $R0 "/desktopicon=" $R1
+ ${If} $R1 == "yes"
+ StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
+ ${ElseIf} $R1 == "no"
+ StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
+ ${Endif}
+
+ ;Extract InstallOptions INI files
+ ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
+FunctionEnd
+
+!ifdef QT_DIR
+Function DisplayAdditionalTasksPage
+ Call fnc_AdditionalTasksPage_Show
+FunctionEnd
+!endif
+
+; ============================================================================
+; Installation execution commands
+; ============================================================================
+
+Section "-Required"
+;-------------------------------------------
+
+;
+; Install for every user
+;
+SetShellVarContext all
+
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\${UNINSTALLER_NAME}"
+File "${STAGING_DIR}\libwiretap.dll"
+File "${STAGING_DIR}\libwireshark.dll"
+File "${STAGING_DIR}\libwsutil.dll"
+
+!include logray-manifest.nsh
+
+File "${STAGING_DIR}\COPYING.txt"
+File "${STAGING_DIR}\NEWS.txt"
+File "${STAGING_DIR}\README.txt"
+File "${STAGING_DIR}\README.windows.txt"
+File "${STAGING_DIR}\wka"
+File "${STAGING_DIR}\pdml2html.xsl"
+File "${STAGING_DIR}\ws.css"
+;File "${STAGING_DIR}\logray.html"
+File "${STAGING_DIR}\wireshark-filter.html"
+File "${STAGING_DIR}\dumpcap.exe"
+File "${STAGING_DIR}\dumpcap.html"
+File "${STAGING_DIR}\extcap.html"
+File "${STAGING_DIR}\ipmap.html"
+
+; C-runtime redistributable
+; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer
+File "${VCREDIST_DIR}\${VCREDIST_EXE}"
+; If the user already has the redistributable installed they will see a
+; Big Ugly Dialog by default, asking if they want to uninstall or repair.
+; Ideally we should add a checkbox for this somewhere. In the meantime,
+; just do a "quiet" install.
+
+; http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html
+ExecWait '"$INSTDIR\${VCREDIST_EXE}" /install /quiet /norestart' $0
+DetailPrint "${VCREDIST_EXE} returned $0"
+
+; https://docs.microsoft.com/en-us/windows/desktop/Msi/error-codes
+!define ERROR_SUCCESS 0
+!define ERROR_SUCCESS_REBOOT_INITIATED 1641
+!define ERROR_PRODUCT_VERSION 1638
+!define ERROR_SUCCESS_REBOOT_REQUIRED 3010
+${Switch} $0
+ ${Case} ${ERROR_SUCCESS}
+ ${Case} ${ERROR_PRODUCT_VERSION}
+ ${Break}
+ ${Case} ${ERROR_SUCCESS_REBOOT_INITIATED} ; Shouldn't happen.
+ ${Case} ${ERROR_SUCCESS_REBOOT_REQUIRED}
+ SetRebootFlag true
+ ${Break}
+ ${Default}
+ MessageBox MB_OK "The Visual C++ Redistributable installer failed with error $0.$\nUnable to continue installation." /SD IDOK
+ Abort
+ ${Break}
+${EndSwitch}
+
+Delete "$INSTDIR\${VCREDIST_EXE}"
+
+
+; global config files - don't overwrite if already existing
+;IfFileExists cfilters dont_overwrite_cfilters
+File "${STAGING_DIR}\cfilters"
+;dont_overwrite_cfilters:
+;IfFileExists colorfilters dont_overwrite_colorfilters
+File "${STAGING_DIR}\colorfilters"
+;dont_overwrite_colorfilters:
+;IfFileExists dfilters dont_overwrite_dfilters
+File "${STAGING_DIR}\dfilters"
+;dont_overwrite_dfilters:
+;IfFileExists smi_modules dont_overwrite_smi_modules
+File "${STAGING_DIR}\smi_modules"
+;dont_overwrite_smi_modules:
+
+
+;
+; Install the Diameter DTD and XML files in the "diameter" subdirectory
+; of the installation directory.
+;
+SetOutPath $INSTDIR\diameter
+File "${STAGING_DIR}\diameter\AlcatelLucent.xml"
+File "${STAGING_DIR}\diameter\chargecontrol.xml"
+File "${STAGING_DIR}\diameter\Cisco.xml"
+File "${STAGING_DIR}\diameter\CiscoSystems.xml"
+File "${STAGING_DIR}\diameter\Custom.xml"
+File "${STAGING_DIR}\diameter\dictionary.dtd"
+File "${STAGING_DIR}\diameter\dictionary.xml"
+File "${STAGING_DIR}\diameter\eap.xml"
+File "${STAGING_DIR}\diameter\Ericsson.xml"
+File "${STAGING_DIR}\diameter\etsie2e4.xml"
+File "${STAGING_DIR}\diameter\HP.xml"
+File "${STAGING_DIR}\diameter\Huawei.xml"
+File "${STAGING_DIR}\diameter\Inovar.xml"
+File "${STAGING_DIR}\diameter\Juniper.xml"
+File "${STAGING_DIR}\diameter\Metaswitch.xml"
+File "${STAGING_DIR}\diameter\Microsoft.xml"
+File "${STAGING_DIR}\diameter\mobileipv4.xml"
+File "${STAGING_DIR}\diameter\mobileipv6.xml"
+File "${STAGING_DIR}\diameter\nasreq.xml"
+File "${STAGING_DIR}\diameter\Nokia.xml"
+File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml"
+File "${STAGING_DIR}\diameter\Oracle.xml"
+File "${STAGING_DIR}\diameter\Siemens.xml"
+File "${STAGING_DIR}\diameter\sip.xml"
+File "${STAGING_DIR}\diameter\Starent.xml"
+File "${STAGING_DIR}\diameter\sunping.xml"
+File "${STAGING_DIR}\diameter\Telefonica.xml"
+File "${STAGING_DIR}\diameter\TGPP.xml"
+File "${STAGING_DIR}\diameter\TGPP2.xml"
+File "${STAGING_DIR}\diameter\Vodafone.xml"
+File "${STAGING_DIR}\diameter\VerizonWireless.xml"
+!include "custom_diameter_xmls.txt"
+SetOutPath $INSTDIR
+
+;
+; Install the RADIUS directory files in the "radius" subdirectory
+; of the installation directory.
+;
+SetOutPath $INSTDIR\radius
+File "${STAGING_DIR}\radius\README.radius_dictionary"
+File "${STAGING_DIR}\radius\custom.includes"
+File "${STAGING_DIR}\radius\dictionary"
+File "${STAGING_DIR}\radius\dictionary.3com"
+File "${STAGING_DIR}\radius\dictionary.3gpp"
+File "${STAGING_DIR}\radius\dictionary.3gpp2"
+File "${STAGING_DIR}\radius\dictionary.5x9"
+File "${STAGING_DIR}\radius\dictionary.acc"
+File "${STAGING_DIR}\radius\dictionary.acme"
+File "${STAGING_DIR}\radius\dictionary.actelis"
+File "${STAGING_DIR}\radius\dictionary.aerohive"
+File "${STAGING_DIR}\radius\dictionary.airespace"
+File "${STAGING_DIR}\radius\dictionary.alcatel"
+File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa"
+File "${STAGING_DIR}\radius\dictionary.alcatel.esam"
+File "${STAGING_DIR}\radius\dictionary.alcatel.sr"
+File "${STAGING_DIR}\radius\dictionary.alteon"
+File "${STAGING_DIR}\radius\dictionary.altiga"
+File "${STAGING_DIR}\radius\dictionary.alvarion"
+File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2"
+File "${STAGING_DIR}\radius\dictionary.apc"
+File "${STAGING_DIR}\radius\dictionary.aptilo"
+File "${STAGING_DIR}\radius\dictionary.aptis"
+File "${STAGING_DIR}\radius\dictionary.arbor"
+File "${STAGING_DIR}\radius\dictionary.aruba"
+File "${STAGING_DIR}\radius\dictionary.ascend"
+File "${STAGING_DIR}\radius\dictionary.asn"
+File "${STAGING_DIR}\radius\dictionary.audiocodes"
+File "${STAGING_DIR}\radius\dictionary.avaya"
+File "${STAGING_DIR}\radius\dictionary.azaire"
+File "${STAGING_DIR}\radius\dictionary.bay"
+File "${STAGING_DIR}\radius\dictionary.bintec"
+File "${STAGING_DIR}\radius\dictionary.bluecoat"
+File "${STAGING_DIR}\radius\dictionary.bristol"
+File "${STAGING_DIR}\radius\dictionary.broadsoft"
+File "${STAGING_DIR}\radius\dictionary.brocade"
+File "${STAGING_DIR}\radius\dictionary.bskyb"
+File "${STAGING_DIR}\radius\dictionary.bt"
+File "${STAGING_DIR}\radius\dictionary.cablelabs"
+File "${STAGING_DIR}\radius\dictionary.cabletron"
+File "${STAGING_DIR}\radius\dictionary.camiant"
+File "${STAGING_DIR}\radius\dictionary.chillispot"
+File "${STAGING_DIR}\radius\dictionary.cisco"
+File "${STAGING_DIR}\radius\dictionary.cisco.asa"
+File "${STAGING_DIR}\radius\dictionary.cisco.bbsm"
+File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000"
+File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000"
+File "${STAGING_DIR}\radius\dictionary.citrix"
+File "${STAGING_DIR}\radius\dictionary.clavister"
+File "${STAGING_DIR}\radius\dictionary.cnergee"
+File "${STAGING_DIR}\radius\dictionary.colubris"
+File "${STAGING_DIR}\radius\dictionary.columbia_university"
+File "${STAGING_DIR}\radius\dictionary.compat"
+File "${STAGING_DIR}\radius\dictionary.compatible"
+File "${STAGING_DIR}\radius\dictionary.cosine"
+File "${STAGING_DIR}\radius\dictionary.dante"
+File "${STAGING_DIR}\radius\dictionary.dellemc"
+File "${STAGING_DIR}\radius\dictionary.dhcp"
+File "${STAGING_DIR}\radius\dictionary.digium"
+File "${STAGING_DIR}\radius\dictionary.dlink"
+File "${STAGING_DIR}\radius\dictionary.dragonwave"
+File "${STAGING_DIR}\radius\dictionary.efficientip"
+File "${STAGING_DIR}\radius\dictionary.eltex"
+File "${STAGING_DIR}\radius\dictionary.enterasys"
+File "${STAGING_DIR}\radius\dictionary.epygi"
+File "${STAGING_DIR}\radius\dictionary.equallogic"
+File "${STAGING_DIR}\radius\dictionary.ericsson"
+File "${STAGING_DIR}\radius\dictionary.ericsson.ab"
+File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks"
+File "${STAGING_DIR}\radius\dictionary.extreme"
+File "${STAGING_DIR}\radius\dictionary.f5"
+File "${STAGING_DIR}\radius\dictionary.fdxtended"
+File "${STAGING_DIR}\radius\dictionary.fortinet"
+File "${STAGING_DIR}\radius\dictionary.foundry"
+File "${STAGING_DIR}\radius\dictionary.freedhcp"
+File "${STAGING_DIR}\radius\dictionary.freeradius"
+File "${STAGING_DIR}\radius\dictionary.freeradius.internal"
+File "${STAGING_DIR}\radius\dictionary.freeswitch"
+File "${STAGING_DIR}\radius\dictionary.gandalf"
+File "${STAGING_DIR}\radius\dictionary.garderos"
+File "${STAGING_DIR}\radius\dictionary.gemtek"
+File "${STAGING_DIR}\radius\dictionary.h3c"
+File "${STAGING_DIR}\radius\dictionary.hp"
+File "${STAGING_DIR}\radius\dictionary.huawei"
+File "${STAGING_DIR}\radius\dictionary.iana"
+File "${STAGING_DIR}\radius\dictionary.identity_engines"
+File "${STAGING_DIR}\radius\dictionary.iea"
+File "${STAGING_DIR}\radius\dictionary.infoblox"
+File "${STAGING_DIR}\radius\dictionary.infonet"
+File "${STAGING_DIR}\radius\dictionary.ipunplugged"
+File "${STAGING_DIR}\radius\dictionary.issanni"
+File "${STAGING_DIR}\radius\dictionary.itk"
+File "${STAGING_DIR}\radius\dictionary.jradius"
+File "${STAGING_DIR}\radius\dictionary.juniper"
+File "${STAGING_DIR}\radius\dictionary.karlnet"
+File "${STAGING_DIR}\radius\dictionary.kineto"
+File "${STAGING_DIR}\radius\dictionary.lancom"
+File "${STAGING_DIR}\radius\dictionary.livingston"
+File "${STAGING_DIR}\radius\dictionary.localweb"
+File "${STAGING_DIR}\radius\dictionary.lucent"
+File "${STAGING_DIR}\radius\dictionary.manzara"
+File "${STAGING_DIR}\radius\dictionary.meinberg"
+File "${STAGING_DIR}\radius\dictionary.meraki"
+File "${STAGING_DIR}\radius\dictionary.merit"
+File "${STAGING_DIR}\radius\dictionary.meru"
+File "${STAGING_DIR}\radius\dictionary.microsemi"
+File "${STAGING_DIR}\radius\dictionary.microsoft"
+File "${STAGING_DIR}\radius\dictionary.mikrotik"
+File "${STAGING_DIR}\radius\dictionary.motorola"
+File "${STAGING_DIR}\radius\dictionary.motorola.wimax"
+File "${STAGING_DIR}\radius\dictionary.navini"
+File "${STAGING_DIR}\radius\dictionary.netscreen"
+File "${STAGING_DIR}\radius\dictionary.networkphysics"
+File "${STAGING_DIR}\radius\dictionary.nexans"
+File "${STAGING_DIR}\radius\dictionary.nokia"
+File "${STAGING_DIR}\radius\dictionary.nokia.conflict"
+File "${STAGING_DIR}\radius\dictionary.nomadix"
+File "${STAGING_DIR}\radius\dictionary.nortel"
+File "${STAGING_DIR}\radius\dictionary.ntua"
+File "${STAGING_DIR}\radius\dictionary.openser"
+File "${STAGING_DIR}\radius\dictionary.packeteer"
+File "${STAGING_DIR}\radius\dictionary.paloalto"
+File "${STAGING_DIR}\radius\dictionary.patton"
+File "${STAGING_DIR}\radius\dictionary.perle"
+File "${STAGING_DIR}\radius\dictionary.propel"
+File "${STAGING_DIR}\radius\dictionary.prosoft"
+File "${STAGING_DIR}\radius\dictionary.proxim"
+File "${STAGING_DIR}\radius\dictionary.purewave"
+File "${STAGING_DIR}\radius\dictionary.quiconnect"
+File "${STAGING_DIR}\radius\dictionary.quintum"
+File "${STAGING_DIR}\radius\dictionary.redcreek"
+File "${STAGING_DIR}\radius\dictionary.rfc2865"
+File "${STAGING_DIR}\radius\dictionary.rfc2866"
+File "${STAGING_DIR}\radius\dictionary.rfc2867"
+File "${STAGING_DIR}\radius\dictionary.rfc2868"
+File "${STAGING_DIR}\radius\dictionary.rfc2869"
+File "${STAGING_DIR}\radius\dictionary.rfc3162"
+File "${STAGING_DIR}\radius\dictionary.rfc3576"
+File "${STAGING_DIR}\radius\dictionary.rfc3580"
+File "${STAGING_DIR}\radius\dictionary.rfc4072"
+File "${STAGING_DIR}\radius\dictionary.rfc4372"
+File "${STAGING_DIR}\radius\dictionary.rfc4603"
+File "${STAGING_DIR}\radius\dictionary.rfc4675"
+File "${STAGING_DIR}\radius\dictionary.rfc4679"
+File "${STAGING_DIR}\radius\dictionary.rfc4818"
+File "${STAGING_DIR}\radius\dictionary.rfc4849"
+File "${STAGING_DIR}\radius\dictionary.rfc5090"
+File "${STAGING_DIR}\radius\dictionary.rfc5176"
+File "${STAGING_DIR}\radius\dictionary.rfc5447"
+File "${STAGING_DIR}\radius\dictionary.rfc5580"
+File "${STAGING_DIR}\radius\dictionary.rfc5607"
+File "${STAGING_DIR}\radius\dictionary.rfc5904"
+File "${STAGING_DIR}\radius\dictionary.rfc6519"
+File "${STAGING_DIR}\radius\dictionary.rfc6572"
+File "${STAGING_DIR}\radius\dictionary.rfc6677"
+File "${STAGING_DIR}\radius\dictionary.rfc6911"
+File "${STAGING_DIR}\radius\dictionary.rfc6929"
+File "${STAGING_DIR}\radius\dictionary.rfc6930"
+File "${STAGING_DIR}\radius\dictionary.rfc7055"
+File "${STAGING_DIR}\radius\dictionary.rfc7155"
+File "${STAGING_DIR}\radius\dictionary.rfc7268"
+File "${STAGING_DIR}\radius\dictionary.rfc7499"
+File "${STAGING_DIR}\radius\dictionary.rfc7930"
+File "${STAGING_DIR}\radius\dictionary.riverbed"
+File "${STAGING_DIR}\radius\dictionary.riverstone"
+File "${STAGING_DIR}\radius\dictionary.roaringpenguin"
+File "${STAGING_DIR}\radius\dictionary.ruckus"
+File "${STAGING_DIR}\radius\dictionary.ruggedcom"
+File "${STAGING_DIR}\radius\dictionary.sangoma"
+File "${STAGING_DIR}\radius\dictionary.sg"
+File "${STAGING_DIR}\radius\dictionary.shasta"
+File "${STAGING_DIR}\radius\dictionary.shiva"
+File "${STAGING_DIR}\radius\dictionary.siemens"
+File "${STAGING_DIR}\radius\dictionary.slipstream"
+File "${STAGING_DIR}\radius\dictionary.sofaware"
+File "${STAGING_DIR}\radius\dictionary.sonicwall"
+File "${STAGING_DIR}\radius\dictionary.springtide"
+File "${STAGING_DIR}\radius\dictionary.starent"
+File "${STAGING_DIR}\radius\dictionary.starent.vsa1"
+File "${STAGING_DIR}\radius\dictionary.surfnet"
+File "${STAGING_DIR}\radius\dictionary.symbol"
+File "${STAGING_DIR}\radius\dictionary.t_systems_nova"
+File "${STAGING_DIR}\radius\dictionary.telebit"
+File "${STAGING_DIR}\radius\dictionary.telkom"
+File "${STAGING_DIR}\radius\dictionary.terena"
+File "${STAGING_DIR}\radius\dictionary.trapeze"
+File "${STAGING_DIR}\radius\dictionary.travelping"
+File "${STAGING_DIR}\radius\dictionary.tropos"
+File "${STAGING_DIR}\radius\dictionary.ukerna"
+File "${STAGING_DIR}\radius\dictionary.unisphere"
+File "${STAGING_DIR}\radius\dictionary.unix"
+File "${STAGING_DIR}\radius\dictionary.usr"
+File "${STAGING_DIR}\radius\dictionary.utstarcom"
+File "${STAGING_DIR}\radius\dictionary.valemount"
+File "${STAGING_DIR}\radius\dictionary.versanet"
+File "${STAGING_DIR}\radius\dictionary.verizon"
+File "${STAGING_DIR}\radius\dictionary.vqp"
+File "${STAGING_DIR}\radius\dictionary.walabi"
+File "${STAGING_DIR}\radius\dictionary.waverider"
+File "${STAGING_DIR}\radius\dictionary.wichorus"
+File "${STAGING_DIR}\radius\dictionary.wimax"
+File "${STAGING_DIR}\radius\dictionary.wimax.alvarion"
+File "${STAGING_DIR}\radius\dictionary.wimax.wichorus"
+File "${STAGING_DIR}\radius\dictionary.wispr"
+File "${STAGING_DIR}\radius\dictionary.xedia"
+File "${STAGING_DIR}\radius\dictionary.xylan"
+File "${STAGING_DIR}\radius\dictionary.yubico"
+File "${STAGING_DIR}\radius\dictionary.zeus"
+File "${STAGING_DIR}\radius\dictionary.zte"
+File "${STAGING_DIR}\radius\dictionary.zyxel"
+!include "custom_radius_dict.txt"
+SetOutPath $INSTDIR
+
+;
+; install the dtds in the dtds subdirectory
+;
+SetOutPath $INSTDIR\dtds
+File "${STAGING_DIR}\dtds\dc.dtd"
+File "${STAGING_DIR}\dtds\itunes.dtd"
+File "${STAGING_DIR}\dtds\mscml.dtd"
+File "${STAGING_DIR}\dtds\pocsettings.dtd"
+File "${STAGING_DIR}\dtds\presence.dtd"
+File "${STAGING_DIR}\dtds\reginfo.dtd"
+File "${STAGING_DIR}\dtds\rlmi.dtd"
+File "${STAGING_DIR}\dtds\rss.dtd"
+File "${STAGING_DIR}\dtds\smil.dtd"
+File "${STAGING_DIR}\dtds\xcap-caps.dtd"
+File "${STAGING_DIR}\dtds\xcap-error.dtd"
+File "${STAGING_DIR}\dtds\watcherinfo.dtd"
+SetOutPath $INSTDIR
+
+; Create the extcap directory
+CreateDirectory $INSTDIR\extcap
+
+;
+; install the protobuf .proto definitions in the protobuf subdirectory
+;
+SetOutPath $INSTDIR\protobuf
+File "${STAGING_DIR}\protobuf\*.proto"
+
+; Install the TPNCP DAT file in the "tpncp" subdirectory
+; of the installation directory.
+SetOutPath $INSTDIR\tpncp
+File "${STAGING_DIR}\tpncp\tpncp.dat"
+
+; Write the installation path into the registry for InstallDirRegKey
+WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir "$INSTDIR"
+
+; Write the uninstall keys for Windows
+; https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs
+; https://docs.microsoft.com/en-us/previous-versions/ms954376(v=msdn.10)
+; https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
+!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
+
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}"
+!ifdef QT_DIR
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH},0"
+!endif
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Logray developer community, https://www.wireshark.org"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html"
+
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${MAJOR_VERSION}
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${MINOR_VERSION}
+
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"'
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S'
+
+; To quote https://web.archive.org/web/20150911221413/http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf:
+; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
+Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk"
+
+; Create file extensions if the Associated Tasks page check box
+; is checked.
+${If} $FILE_ASSOCIATE_STATE == ${BST_CHECKED}
+WriteRegStr HKCR ${LOGRAY_ASSOC} "" "Logray log file"
+WriteRegStr HKCR "${LOGRAY_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH}" "%1"'
+WriteRegStr HKCR "${LOGRAY_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH}",1'
+; We refresh the icon cache down in -Finally.
+Call Associate
+; If you add something here be sure to sync it with the uninstall section and the
+; AdditionalTasks page
+${Endif}
+
+SectionEnd ; "Required"
+
+!ifdef QT_DIR
+Section "${PROGRAM_NAME}" SecLograyQt
+;-------------------------------------------
+; by default, Logray.exe is installed
+SetOutPath $INSTDIR
+File "${QT_DIR}\${PROGRAM_NAME_PATH}"
+; Write an entry for ShellExecute
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "" '$INSTDIR\${PROGRAM_NAME_PATH}'
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "Path" '$INSTDIR'
+!include logray-qt-manifest.nsh
+
+${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations"
+SetOutPath $INSTDIR
+!ifdef TRANSLATIONS_FOLDER
+ ; Starting from Qt 5.5, *.qm files are put in a translations subfolder
+ File /r "${QT_DIR}\translations"
+!else
+ File "${QT_DIR}\*.qm"
+!endif
+
+; Is the Start Menu check box checked?
+${If} $START_MENU_STATE == ${BST_CHECKED}
+ CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
+${Endif}
+
+${If} $DESKTOP_ICON_STATE == ${BST_CHECKED}
+ CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
+${Endif}
+
+SectionEnd ; "SecLograyQt"
+!endif
+
+
+Section "TShark" SecTShark
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\tshark.exe"
+File "${STAGING_DIR}\tshark.html"
+SectionEnd
+
+SectionGroup "Plugins & Extensions" SecPluginsGroup
+
+Section "Dissector Plugins" SecPlugins
+;-------------------------------------------
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\falco-bridge.dll"
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\falco'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\falco\cloudtrail.dll"
+!include "custom_plugins.txt"
+SectionEnd
+
+Section "Tree Statistics Plugin" SecStatsTree
+;-------------------------------------------
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\stats_tree.dll"
+SectionEnd
+
+Section "Mate - Meta Analysis and Tracing Engine" SecMate
+;-------------------------------------------
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\mate.dll"
+SectionEnd
+
+Section "Configuration Profiles" SecProfiles
+;-------------------------------------------
+; This should be a function or macro
+SetOutPath '$INSTDIR\profiles\Bluetooth'
+File "${STAGING_DIR}\profiles\Bluetooth\colorfilters"
+File "${STAGING_DIR}\profiles\Bluetooth\preferences"
+SetOutPath '$INSTDIR\profiles\Classic'
+File "${STAGING_DIR}\profiles\Classic\colorfilters"
+SetOutPath '$INSTDIR\profiles\No Reassembly'
+File "${STAGING_DIR}\profiles\No Reassembly\preferences"
+SectionEnd
+
+!ifdef SMI_DIR
+Section "SNMP MIBs" SecMIBs
+;-------------------------------------------
+SetOutPath '$INSTDIR\snmp\mibs'
+File "${SMI_DIR}\share\mibs\iana\*"
+File "${SMI_DIR}\share\mibs\ietf\*"
+File "${SMI_DIR}\share\mibs\irtf\*"
+File "${SMI_DIR}\share\mibs\tubs\*"
+File "${SMI_DIR}\share\pibs\*"
+File "${SMI_DIR}\share\yang\*.yang"
+!include "custom_mibs.txt"
+SectionEnd
+!endif
+
+SectionGroupEnd ; "Plugins / Extensions"
+
+
+SectionGroup "Tools" SecToolsGroup
+
+Section "Editcap" SecEditcap
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\editcap.exe"
+File "${STAGING_DIR}\editcap.html"
+SectionEnd
+
+Section "Text2Pcap" SecText2Pcap
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\text2pcap.exe"
+File "${STAGING_DIR}\text2pcap.html"
+SectionEnd
+
+Section "Mergecap" SecMergecap
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\mergecap.exe"
+File "${STAGING_DIR}\mergecap.html"
+SectionEnd
+
+Section "Reordercap" SecReordercap
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\reordercap.exe"
+File "${STAGING_DIR}\reordercap.html"
+SectionEnd
+
+Section "Capinfos" SecCapinfos
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\capinfos.exe"
+File "${STAGING_DIR}\capinfos.html"
+SectionEnd
+
+Section "Captype" SecCaptype
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\captype.exe"
+File "${STAGING_DIR}\captype.html"
+SectionEnd
+
+Section /o "Randpkt" SecRandpkt
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\randpkt.exe"
+File "${STAGING_DIR}\randpkt.html"
+SectionEnd
+
+!ifdef MMDBRESOLVE_EXE
+Section "MMDBResolve" SecMMDBResolve
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\mmdbresolve.html"
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\mmdbresolve.exe"
+SectionEnd
+!endif
+
+Section /o "Etwdump" SecEtwdump
+;-------------------------------------------
+ !insertmacro InstallExtcap "Etwdump"
+SectionEnd
+!insertmacro CheckExtrasFlag "Etwdump"
+
+SectionGroupEnd ; "Tools"
+
+!ifdef DOCBOOK_DIR
+Section "Documentation" SecDocumentation
+;-------------------------------------------
+SetOutPath "$INSTDIR\Wireshark User's Guide"
+File /r "${DOCBOOK_DIR}\wsug_html_chunked\*.*"
+
+SetOutPath $INSTDIR
+File "${DOCBOOK_DIR}\faq.html"
+SectionEnd
+!endif
+
+Section "-Finally"
+
+!insertmacro UpdateIcons
+
+; Compute and write the installation directory size
+${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
+IntFmt $0 "0x%08X" $0
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0"
+
+SectionEnd
+
+; ============================================================================
+; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
+; ============================================================================
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+!ifdef QT_DIR
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecLograyQt} "The main network protocol analyzer application."
+!endif
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer."
+
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Plugins and extensions for both ${PROGRAM_NAME} and TShark."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Additional protocol dissectors."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Extended statistics."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiles} "Configuration profiles"
+
+!ifdef SMI_DIR
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
+!endif
+
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEtwdump} "Provide ETW reader"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Copy packets to a new file, optionally trimming packets, omitting them, or saving to a different format."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Read an ASCII hex dump and write the data into a libpcap-style capture file."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Combine multiple saved capture files into a single output file"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecReordercap} "Copy packets to a new file, sorted by time."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Print information about capture files."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecCaptype} "Print the types capture files."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpkt} "Random packet generator."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMMDBResolve} "MaxMind Database resolution tool"
+
+!ifdef DOCBOOK_DIR
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "Install an offline copy of the User's Guide and FAQ."
+!endif
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+; ============================================================================
+; Callback functions
+; ============================================================================
+!ifdef QT_DIR
+
+Var QT_SELECTED
+
+; Called from fnc_AdditionalTasksPage_Create via DisplayAdditionalTasksPage.
+Function InitAdditionalTasksPage
+ ; We've created the Additional tasks page. Update our control states
+ ; before they are shown.
+ ; We set XXX_STATE -> XxxCheckBox here and go the other direction below.
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
+
+ StrCpy $QT_SELECTED 0
+ ${If} ${SectionIsSelected} ${SecLograyQt}
+ StrCpy $QT_SELECTED 1
+ ${Endif}
+ EnableWindow $hCtl_AdditionalTasksPage_CreateShortcutsLabel $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_StartMenuCheckBox $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_DesktopIconCheckBox $QT_SELECTED
+
+ EnableWindow $hCtl_AdditionalTasksPage_ExtensionsLabel $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_FileExtensionsLabel $QT_SELECTED
+FunctionEnd
+
+Function LeaveAdditionalTasksPage
+ ; We're leaving the Additional tasks page. Get our control states
+ ; before they're destroyed.
+ ; We set XxxCheckBox -> XXX_STATE here and go the other direction above.
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
+FunctionEnd
+
+!endif ; QT_DIR
diff --git a/packaging/nsis/makeUninstall.ps1 b/packaging/nsis/makeUninstall.ps1
new file mode 100644
index 0000000..601b3ff
--- /dev/null
+++ b/packaging/nsis/makeUninstall.ps1
@@ -0,0 +1,47 @@
+# MakeUninstall.ps1
+#
+# Runs the uninstall_installer to create the uninstall.exe that can be signed
+# Uses set __COMPAT_LAYER=RunAsInvoker to not request elevation
+#
+# Copyright 2020 Graham Bloice <graham.bloice@trihedral.com>
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+#requires -version 2
+
+<#
+.SYNOPSIS
+Runs the uninstall_<application>_installer without invoking UAC.
+
+.DESCRIPTION
+This script runs the uninstall_<application>_installer that creates an
+uninstall exe but without invoking a UAC elevation prompt that is required
+by the uninstaller
+
+.PARAMETER Executable
+The path to the uninstall_<application>_installer.exe
+
+.INPUTS
+-Executable Path to the uninstaller installer.
+
+.OUTPUTS
+An unsigned uninstall-<application>.exe for signing
+
+.EXAMPLE
+C:\PS> .\makeUninstall.ps1 run\RelWithDebInfo\uninstall_wireshark_installer.exe
+#>
+
+Param(
+ [Parameter(Mandatory=$true, Position=0)]
+ [String] $Executable
+)
+
+# Stop the process requesting elevation, runs as the user
+$env:__COMPAT_LAYER = "RunAsInvoker"
+
+# And run the process
+Start-Process $Executable -Wait -NoNewWindow
diff --git a/packaging/nsis/mingw64-qt-mapping.txt b/packaging/nsis/mingw64-qt-mapping.txt
new file mode 100644
index 0000000..40ca2ef
--- /dev/null
+++ b/packaging/nsis/mingw64-qt-mapping.txt
@@ -0,0 +1,30 @@
+#
+# Generated by running
+# "windeployqt6.exe --no-compiler-runtime --no-translations --list mapping /path/to/Wireshark.exe"
+# on a Windows machine and editing by hand.
+#
+
+"bin/Qt6Core.dll" "Qt6Core.dll"
+"bin/Qt6Core5Compat.dll" "Qt6Core5Compat.dll"
+"bin/Qt6Gui.dll" "Qt6Gui.dll"
+"bin/Qt6Multimedia.dll" "Qt6Multimedia.dll"
+"bin/Qt6Network.dll" "Qt6Network.dll"
+"bin/Qt6PrintSupport.dll" "Qt6PrintSupport.dll"
+#"bin/Qt6Svg.dll" "Qt6Svg.dll"
+"bin/Qt6Widgets.dll" "Qt6Widgets.dll"
+#"bin/opengl32sw.dll" "opengl32sw.dll"
+#"bin/D3Dcompiler_47.dll" "D3Dcompiler_47.dll"
+"lib/qt6/plugins/generic/qtuiotouchplugin.dll" "generic/qtuiotouchplugin.dll"
+#"lib/qt6/plugins/iconengines/qsvgicon.dll" "iconengines/qsvgicon.dll"
+"lib/qt6/plugins/imageformats/qgif.dll" "imageformats/qgif.dll"
+"lib/qt6/plugins/imageformats/qico.dll" "imageformats/qico.dll"
+"lib/qt6/plugins/imageformats/qjpeg.dll" "imageformats/qjpeg.dll"
+#"lib/qt6/plugins/imageformats/qsvg.dll" "imageformats/qsvg.dll"
+#"lib/qt6/plugins/multimedia/ffmpegmediaplugin.dll" "multimedia/ffmpegmediaplugin.dll"
+"lib/qt6/plugins/multimedia/windowsmediaplugin.dll" "multimedia/windowsmediaplugin.dll"
+"lib/qt6/plugins/networkinformation/qnetworklistmanager.dll" "networkinformation/qnetworklistmanager.dll"
+"lib/qt6/plugins/platforms/qwindows.dll" "platforms/qwindows.dll"
+"lib/qt6/plugins/styles/qwindowsvistastyle.dll" "styles/qwindowsvistastyle.dll"
+"lib/qt6/plugins/tls/qcertonlybackend.dll" "tls/qcertonlybackend.dll"
+"lib/qt6/plugins/tls/qopensslbackend.dll" "tls/qopensslbackend.dll"
+"lib/qt6/plugins/tls/qschannelbackend.dll" "tls/qschannelbackend.dll"
diff --git a/packaging/nsis/servicelib.nsh b/packaging/nsis/servicelib.nsh
new file mode 100644
index 0000000..55f5116
--- /dev/null
+++ b/packaging/nsis/servicelib.nsh
@@ -0,0 +1,344 @@
+; from https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Service_Lib&oldid=4726
+; un. functions disabled to prevent a NSIS warning
+;
+; NSIS SERVICE LIBRARY - servicelib.nsh
+; Version 1.2 - 02/29/2004
+; Questions/Comments - dselkirk@hotmail.com
+;
+; Description:
+; Provides an interface to window services
+;
+; Inputs:
+; action - systemlib action ie. create, delete, start, stop, pause,
+; continue, installed, running, status
+; name - name of service to manipulate
+; param - action parameters; usage: var1=value1;var2=value2;...etc.
+;
+; Actions:
+; create - creates a new windows service
+; Parameters:
+; path - path to service executable
+; autostart - automatically start with system ie. 1|0
+; interact - interact with the desktop ie. 1|0
+; machine - machine name where to install service
+; user - user that runs the service
+; password - password of the above user
+;
+; delete - deletes a windows service
+; start - start a stopped windows service
+; stop - stops a running windows service
+; pause - pauses a running windows service
+; continue - continues a paused windows service
+; installed - is the provided service installed
+; Parameters:
+; action - if true then invokes the specified action
+; running - is the provided service running
+; Parameters:
+; action - if true then invokes the specified action
+; status - check the status of the provided service
+;
+; If run from uninstall define "UN" as "un." gefore running.
+;
+; Usage:
+; Method 1:
+; Push "action"
+; Push "name"
+; Push "param"
+; Call Service
+; Pop $0 ;response
+;
+; Method 2:
+; !insertmacro SERVICE "action" "name" "param"
+;
+; History:
+; 1.0 - 09/15/2003 - Initial release
+; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker
+; 1.2 - 02/29/2004 - Fixed documentation.
+
+!ifndef SERVICELIB
+ !define SERVICELIB
+
+ !define SC_MANAGER_ALL_ACCESS 0x3F
+ !define SERVICE_ALL_ACCESS 0xF01FF
+
+ !define SERVICE_CONTROL_STOP 1
+ !define SERVICE_CONTROL_PAUSE 2
+ !define SERVICE_CONTROL_CONTINUE 3
+
+ !define SERVICE_STOPPED 0x1
+ !define SERVICE_START_PENDING 0x2
+ !define SERVICE_STOP_PENDING 0x3
+ !define SERVICE_RUNNING 0x4
+ !define SERVICE_CONTINUE_PENDING 0x5
+ !define SERVICE_PAUSE_PENDING 0x6
+ !define SERVICE_PAUSED 0x7
+
+ !ifndef UN
+ !define UN ""
+ !endif
+
+ !macro SERVICE ACTION NAME PARAM
+ Push '${ACTION}'
+ Push '${NAME}'
+ Push '${PARAM}'
+ Call ${UN}Service
+ !macroend
+
+ !macro FUNC_GETPARAM
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Exch 8
+ Pop $1 ;name
+ Exch 8
+ Pop $2 ;source
+ StrCpy $0 ""
+ StrLen $7 $2
+ StrCpy $3 0
+ lbl_loop:
+ IntCmp $3 $7 0 0 lbl_done
+ StrLen $4 "$1="
+ StrCpy $5 $2 $4 $3
+ StrCmp $5 "$1=" 0 lbl_next
+ IntOp $5 $3 + $4
+ StrCpy $3 $5
+ lbl_loop2:
+ IntCmp $3 $7 0 0 lbl_done
+ StrCpy $6 $2 1 $3
+ StrCmp $6 ";" 0 lbl_next2
+ IntOp $6 $3 - $5
+ StrCpy $0 $2 $6 $5
+ Goto lbl_done
+ lbl_next2:
+ IntOp $3 $3 + 1
+ Goto lbl_loop2
+ lbl_next:
+ IntOp $3 $3 + 1
+ Goto lbl_loop
+ lbl_done:
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch 2
+ Pop $6
+ Pop $7
+ Exch $0
+ !macroend
+
+ !macro CALL_GETPARAM VAR NAME DEFAULT LABEL
+ Push $1
+ Push ${NAME}
+ Call ${UN}GETPARAM
+ Pop $6
+ StrCpy ${VAR} "${DEFAULT}"
+ StrCmp $6 "" "${LABEL}" 0
+ StrCpy ${VAR} $6
+ !macroend
+
+ !macro FUNC_SERVICE UN
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Exch 8
+ Pop $1 ;param
+ Exch 8
+ Pop $2 ;name
+ Exch 8
+ Pop $3 ;action
+ ;$0 return
+ ;$4 OpenSCManager
+ ;$5 OpenService
+
+
+ StrCpy $0 "false"
+ System::Call 'advapi32::OpenSCManagerA(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4'
+ IntCmp $4 0 lbl_done
+ StrCmp $3 "create" lbl_create
+ System::Call 'advapi32::OpenServiceA(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5'
+ IntCmp $5 0 lbl_done
+
+ lbl_select:
+ StrCmp $3 "delete" lbl_delete
+ StrCmp $3 "start" lbl_start
+ StrCmp $3 "stop" lbl_stop
+ StrCmp $3 "pause" lbl_pause
+ StrCmp $3 "continue" lbl_continue
+ StrCmp $3 "installed" lbl_installed
+ StrCmp $3 "running" lbl_running
+ StrCmp $3 "status" lbl_status
+ Goto lbl_done
+
+ ; create service
+ lbl_create:
+ Push $R1 ;machine
+ Push $R2 ;user
+ Push $R3 ;password
+ Push $R4 ;interact
+ Push $R5 ;autostart
+ Push $R6 ;path
+
+ !insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine"
+ lbl_machine:
+
+ !insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user"
+ lbl_user:
+
+ !insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password"
+ lbl_password:
+
+ !insertmacro CALL_GETPARAM $R4 "interact" "0x10" "lbl_interact"
+ StrCpy $6 0x10
+ IntCmp $R4 0 +2
+ IntOp $R4 $6 | 0x100
+ StrCpy $R4 $6
+ lbl_interact:
+
+ !insertmacro CALL_GETPARAM $R5 "autostart" "0x3" "lbl_autostart"
+ StrCpy $6 0x3
+ IntCmp $R5 0 +2
+ StrCpy $6 0x2
+ StrCpy $R5 $6
+ lbl_autostart:
+
+ !insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path"
+ lbl_path:
+
+ System::Call 'advapi32::CreateServiceA(i r4, t r2, t r2, i ${SERVICE_ALL_ACCESS}, i R4, i R5, i 0, t R6, n, n, R1, R2, R3) i.r6'
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; delete service
+ lbl_delete:
+ System::Call 'advapi32::DeleteService(i r5) i.r6'
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; start service
+ lbl_start:
+ System::Call 'advapi32::StartServiceA(i r5, i 0, i 0) i.r6'
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; stop service
+ lbl_stop:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; pause service
+ lbl_pause:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; continue service
+ lbl_continue:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; is installed
+ lbl_installed:
+ !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
+ StrCpy $3 $7
+ Goto lbl_select
+
+ ; is service running
+ lbl_running:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
+ System::Call '*$R1(i, i.r6)'
+ System::Free $R1
+ Pop $R1
+ IntFmt $6 "0x%X" $6
+ StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done
+ !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
+ StrCpy $3 $7
+ Goto lbl_select
+
+ lbl_status:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
+ System::Call '*$R1(i, i .r6)'
+ System::Free $R1
+ Pop $R1
+ IntFmt $6 "0x%X" $6
+ StrCpy $0 "running"
+ IntCmp $6 ${SERVICE_RUNNING} lbl_done
+ StrCpy $0 "stopped"
+ IntCmp $6 ${SERVICE_STOPPED} lbl_done
+ StrCpy $0 "start_pending"
+ IntCmp $6 ${SERVICE_START_PENDING} lbl_done
+ StrCpy $0 "stop_pending"
+ IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done
+ StrCpy $0 "running"
+ IntCmp $6 ${SERVICE_RUNNING} lbl_done
+ StrCpy $0 "continue_pending"
+ IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done
+ StrCpy $0 "pause_pending"
+ IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done
+ StrCpy $0 "paused"
+ IntCmp $6 ${SERVICE_PAUSED} lbl_done
+ StrCpy $0 "unknown"
+
+ lbl_good:
+ StrCpy $0 "true"
+ lbl_done:
+ IntCmp $5 0 +2
+ System::Call 'advapi32::CloseServiceHandle(i r5) n'
+ IntCmp $4 0 +2
+ System::Call 'advapi32::CloseServiceHandle(i r4) n'
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch 3
+ Pop $5
+ Pop $6
+ Pop $7
+ Exch $0
+ !macroend
+
+ Function Service
+ !insertmacro FUNC_SERVICE ""
+ FunctionEnd
+
+; Function un.Service
+; !insertmacro FUNC_SERVICE "un."
+; FunctionEnd
+
+ Function GetParam
+ !insertmacro FUNC_GETPARAM
+ FunctionEnd
+
+; Function un.GetParam
+; !insertmacro FUNC_GETPARAM
+; FunctionEnd
+
+!endif
diff --git a/packaging/nsis/uninstall-logray.nsi b/packaging/nsis/uninstall-logray.nsi
new file mode 100644
index 0000000..5a8d440
--- /dev/null
+++ b/packaging/nsis/uninstall-logray.nsi
@@ -0,0 +1,274 @@
+;
+; uninstall-logray.nsi
+;
+
+; Create an installer that only writes an uninstaller.
+; https://nsis.sourceforge.io/Signing_an_Uninstaller
+
+!include "logray-common.nsh"
+!include 'LogicLib.nsh'
+!include x64.nsh
+!include "StrFunc.nsh"
+
+SetCompress off
+OutFile "${STAGING_DIR}\uninstall_logray_installer.exe"
+
+; InstType "un.Default (keep Personal Settings and Npcap)"
+InstType "un.All (remove all)"
+
+; Uninstaller icon
+UninstallIcon "..\..\resources\icons\lograyinst.ico"
+
+!include "MUI.nsh"
+
+!define MUI_UNICON "..\..\resources\icons\lograyinst.ico"
+
+; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
+!define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue."
+; Uninstall stuff (this text isn't used with the MODERN_UI!)
+;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue."
+
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_FINISHPAGE_TITLE_3LINES
+
+!insertmacro MUI_UNPAGE_WELCOME
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_COMPONENTS
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+
+!insertmacro MUI_LANGUAGE "English"
+
+; ============================================================================
+; Section macros
+; ============================================================================
+!include "Sections.nsh"
+
+; ============================================================================
+; Uninstall page configuration
+; ============================================================================
+ShowUninstDetails show
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+Function .onInit
+ ; MUST be the absolute path to our staging directory.
+ WriteUninstaller "${STAGING_DIR}\${UNINSTALLER_NAME}"
+ SetErrorLevel 0
+ Quit
+FunctionEnd
+
+Var EXTENSION
+Function un.Disassociate
+ Push $R0
+!insertmacro PushFileExtensions
+
+ Pop $EXTENSION
+ ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
+ ReadRegStr $R0 HKCR $EXTENSION ""
+ StrCmp $R0 ${LOGRAY_ASSOC} un.Disassociate.doDeregister
+ Goto un.Disassociate.end
+un.Disassociate.doDeregister:
+ ; The extension is associated with Logray so, we must destroy this!
+ DeleteRegKey HKCR $EXTENSION
+ DetailPrint "Deregistered file type: $EXTENSION"
+un.Disassociate.end:
+ Pop $EXTENSION
+ ${Loop}
+
+ Pop $R0
+FunctionEnd
+
+Section "-Required"
+SectionEnd
+
+!define EXECUTABLE_MARKER "EXECUTABLE_MARKER"
+Var EXECUTABLE
+
+Section "Uninstall" un.SecUinstall
+;-------------------------------------------
+;
+; UnInstall for every user
+;
+SectionIn 1 2
+SetShellVarContext all
+
+!insertmacro IsLograyRunning
+
+Push "${EXECUTABLE_MARKER}"
+Push "${PROGRAM_NAME}"
+Push "capinfos"
+Push "captype"
+Push "dftest"
+Push "dumpcap"
+Push "editcap"
+Push "mergecap"
+Push "reordercap"
+Push "text2pcap"
+
+!ifdef MMDBRESOLVE_EXE
+Push "mmdbresolve"
+!endif
+
+Pop $EXECUTABLE
+${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER}
+
+ ; IsLograyRunning should make sure everything is closed down so we *shouldn't* run
+ ; into any problems here.
+ Delete "$INSTDIR\$EXECUTABLE.exe"
+ IfErrors 0 deletionSuccess
+ MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0
+ Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process."
+
+deletionSuccess:
+ Pop $EXECUTABLE
+
+${Loop}
+
+
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe"
+
+Call un.Disassociate
+
+DeleteRegKey HKCR ${LOGRAY_ASSOC}
+DeleteRegKey HKCR "${LOGRAY_ASSOC}\Shell\open\command"
+DeleteRegKey HKCR "${LOGRAY_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\audio\*.*"
+Delete "$INSTDIR\bearer\*.*"
+Delete "$INSTDIR\diameter\*.*"
+Delete "$INSTDIR\gpl-2.0-standalone.html"
+Delete "$INSTDIR\Acknowledgements.md"
+Delete "$INSTDIR\help\*.*"
+Delete "$INSTDIR\iconengines\*.*"
+Delete "$INSTDIR\imageformats\*.*"
+Delete "$INSTDIR\mediaservice\*.*"
+Delete "$INSTDIR\networkinformation\*.*"
+Delete "$INSTDIR\platforms\*.*"
+Delete "$INSTDIR\playlistformats\*.*"
+Delete "$INSTDIR\printsupport\*.*"
+Delete "$INSTDIR\share\glib-2.0\schemas\*.*"
+Delete "$INSTDIR\snmp\*.*"
+Delete "$INSTDIR\snmp\mibs\*.*"
+Delete "$INSTDIR\styles\translations\*.*"
+Delete "$INSTDIR\styles\*.*"
+Delete "$INSTDIR\protobuf\*.*"
+Delete "$INSTDIR\tls\*.*"
+Delete "$INSTDIR\tpncp\*.*"
+Delete "$INSTDIR\translations\*.*"
+Delete "$INSTDIR\ui\*.*"
+Delete "$INSTDIR\wimaxasncp\*.*"
+Delete "$INSTDIR\ws.css"
+Delete "$INSTDIR\README*"
+Delete "$INSTDIR\NEWS.txt"
+Delete "$INSTDIR\manuf"
+Delete "$INSTDIR\wka"
+Delete "$INSTDIR\services"
+Delete "$INSTDIR\pdml2html.xsl"
+Delete "$INSTDIR\pcrepattern.3.txt"
+Delete "$INSTDIR\example_snmp_users_file"
+Delete "$INSTDIR\ipmap.html"
+Delete "$INSTDIR\radius\*.*"
+Delete "$INSTDIR\dtds\*.*"
+
+RMDir "$INSTDIR\accessible"
+RMDir "$INSTDIR\audio"
+RMDir "$INSTDIR\bearer"
+RMDir "$INSTDIR\extcap"
+RMDir "$INSTDIR\iconengines"
+RMDir "$INSTDIR\imageformats"
+RMDir "$INSTDIR\mediaservice"
+RMDir "$INSTDIR\networkinformation"
+RMDir "$INSTDIR\platforms"
+RMDir "$INSTDIR\playlistformats"
+RMDir "$INSTDIR\printsupport"
+RMDir "$INSTDIR\styles\translations"
+RMDir "$INSTDIR\styles"
+RMDir "$SMPROGRAMS\${PROGRAM_NAME}"
+RMDir "$INSTDIR\help"
+;RMDir /r "$INSTDIR\Wireshark User's Guide"
+RMDir "$INSTDIR\diameter"
+RMDir "$INSTDIR\snmp\mibs"
+RMDir "$INSTDIR\snmp"
+RMDir "$INSTDIR\radius"
+RMDir "$INSTDIR\dtds"
+RMDir "$INSTDIR\protobuf"
+RMDir "$INSTDIR\tpncp"
+RMDir "$INSTDIR\tls"
+RMDir "$INSTDIR\translations"
+RMDir "$INSTDIR\ui"
+RMDir "$INSTDIR\wimaxasncp"
+RMDir "$INSTDIR"
+
+SectionEnd ; "Uinstall"
+
+Section "Un.Plugins" un.SecPlugins
+;-------------------------------------------
+SectionIn 1 2
+;Delete "$INSTDIR\plugins\${VERSION}\*.*"
+;Delete "$INSTDIR\plugins\*.*"
+;RMDir "$INSTDIR\plugins\${VERSION}"
+;RMDir "$INSTDIR\plugins"
+RMDir /r "$INSTDIR\plugins"
+SectionEnd
+
+Section "Un.Global Profiles" un.SecProfiles
+;-------------------------------------------
+SectionIn 1 2
+RMDir /r "$INSTDIR\profiles"
+SectionEnd
+
+Section "Un.Global Settings" un.SecGlobalSettings
+;-------------------------------------------
+SectionIn 1 2
+Delete "$INSTDIR\cfilters"
+Delete "$INSTDIR\colorfilters"
+Delete "$INSTDIR\dfilters"
+Delete "$INSTDIR\enterprises.tsv"
+Delete "$INSTDIR\init.lua"
+Delete "$INSTDIR\console.lua"
+Delete "$INSTDIR\dtd_gen.lua"
+Delete "$INSTDIR\smi_modules"
+RMDir "$INSTDIR"
+SectionEnd
+
+Section /o "Un.Personal Settings" un.SecPersonalSettings
+;-------------------------------------------
+SectionIn 2
+SetShellVarContext current
+Delete "$APPDATA\${PROGRAM_NAME}\*.*"
+RMDir "$APPDATA\${PROGRAM_NAME}"
+DeleteRegKey HKCU "Software\${PROGRAM_NAME}"
+SectionEnd
+
+Section "-Un.Finally"
+;-------------------------------------------
+SectionIn 1 2
+
+!insertmacro UpdateIcons
+
+; this test must be done after all other things uninstalled (e.g. Global Settings)
+IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
+ MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist
+NoFinalErrorMsg:
+SectionEnd
+
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
diff --git a/packaging/nsis/windeployqt-to-nsis.ps1 b/packaging/nsis/windeployqt-to-nsis.ps1
new file mode 100644
index 0000000..14883f1
--- /dev/null
+++ b/packaging/nsis/windeployqt-to-nsis.ps1
@@ -0,0 +1,108 @@
+# windeployqt-to-nsh
+#
+# Windeployqt-to-nsh - Convert the output of windeployqt to an equivalent set of
+# NSIS "File" function calls.
+#
+# Copyright 2014 Gerald Combs <gerald@wireshark.org>
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+#requires -version 2
+
+<#
+.SYNOPSIS
+Creates NSIS "File" function calls required for Qt packaging.
+
+.DESCRIPTION
+This script creates an NSIS-compatible file based on the output of
+windeployqt. If Qt is present, version 5.3 or later is required.
+Otherwise a dummy file will be created.
+
+If building with Qt, QMake must be in your PATH.
+
+.PARAMETER Executable
+The path to a Qt application. It will be examined for dependent DLLs.
+
+.PARAMETER FilePath
+Output filename.
+
+.PARAMETER DebugConfig
+Assume debug binaries.
+
+.INPUTS
+-Executable Path to the Qt application.
+-FilePath Output NSIS file.
+
+.OUTPUTS
+List of NSIS commands required to package supporting DLLs.
+
+.EXAMPLE
+C:\PS> .\windeployqt-to-nsis.ps1 windeployqt.exe ..\..\staging\wireshark.exe wireshark-qt-manifest.nsh [-DebugConfig]
+#>
+
+Param(
+ [Parameter(Mandatory=$true, Position=0)]
+ [String] $Executable,
+
+ [Parameter(Position=1)]
+ [String] $FilePath = "wireshark-qt-manifest.nsh",
+
+ [Parameter(Mandatory=$false)]
+ [Switch] $DebugConfig
+)
+
+
+try {
+ $qtVersion = [version](qmake -query QT_VERSION)
+ $nsisCommands = @("# Qt version " + $qtVersion ; "#")
+
+ if ($qtVersion -lt "5.3") {
+ Throw "Qt " + $qtVersion + " found. 5.3 or later is required."
+ }
+
+ $DebugOrRelease = If ($DebugConfig) {"--debug"} Else {"--release"}
+
+ # windeployqt lists translation files that it don't exist (e.g.
+ # qtbase_ar.qm), so we handle those by hand.
+ # https://bugreports.qt.io/browse/QTBUG-65974
+ $wdqtList = windeployqt `
+ $DebugOrRelease `
+ --no-compiler-runtime `
+ --no-translations `
+ --list relative `
+ $Executable
+
+ $basePath = Split-Path -Parent $Executable
+
+ $currentDir = ""
+
+ foreach ($entry in $wdqtList) {
+ $dir = Split-Path -Parent $entry
+ if ($dir -and $dir -ne $currentDir) {
+ $nsisCommands += "SetOutPath `"`$INSTDIR\$dir`""
+ $currentDir = $dir
+ }
+ $nsisCommands += "File `"$basePath\$entry`""
+ }
+}
+
+catch {
+
+ $nsisCommands = @"
+# Qt not configured
+#
+"@
+
+}
+
+Set-Content $FilePath @"
+#
+# Automatically generated by $($MyInvocation.MyCommand.Name)
+#
+"@
+
+Add-Content $FilePath $nsisCommands
diff --git a/packaging/nsis/windeployqt-to-nsis.py b/packaging/nsis/windeployqt-to-nsis.py
new file mode 100644
index 0000000..2881f31
--- /dev/null
+++ b/packaging/nsis/windeployqt-to-nsis.py
@@ -0,0 +1,91 @@
+#!/bin/env python3
+
+# windeployqt-to-nsh
+#
+# Windeployqt-to-nsh - Convert the output of windeployqt to an equivalent set of
+# NSIS "File" function calls.
+#
+# Rewritten in python from windeployqt-to-nsis.ps1, that has the following copyright:
+#
+# Copyright 2014 Gerald Combs <gerald@wireshark.org>
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import sys
+import os
+import argparse
+import subprocess
+
+parser = argparse.ArgumentParser()
+group = parser.add_mutually_exclusive_group(required=True)
+group.add_argument('--mapping')
+group.add_argument('--executable')
+parser.add_argument('--sysroot')
+parser.add_argument('outfile')
+args = parser.parse_args()
+
+if args.mapping:
+ if not args.sysroot:
+ sys.exit('Option --sysroot is required with option --mapping')
+ qt_version = None
+ with open(args.mapping, 'r', encoding='utf-8') as f:
+ out = f.read()
+else:
+ # Qt version
+ qmake_command = [
+ 'qmake6.exe',
+ '-query', 'QT_VERSION'
+ ]
+ qmake_out = subprocess.run(qmake_command, check=True, capture_output=True, encoding="utf-8")
+ qt_version = qmake_out.stdout.strip()
+
+ # XXX The powershell script asserts that the Qt version is greater than 5.3. We already require Qt6 to build the
+ # installer using MSYS2 (currently not enforced).
+
+ # Windeployqt output
+ windeploy_command = [
+ "windeployqt6.exe",
+ "--no-compiler-runtime",
+ "--no-translations",
+ "--list", "mapping",
+ args.executable
+ ]
+ out = subprocess.run(windeploy_command, check=True, capture_output=True, encoding="utf-8").stdout
+
+with open(args.outfile, 'w') as f:
+ header = """\
+#
+# Automatically generated by {}
+#""".format(parser.prog)
+
+ if qt_version:
+ header += """\
+# Qt version {}
+#""".format(qt_version)
+
+ print(header, file=f)
+
+ current_dir = ""
+ for line in out.splitlines():
+ line = line.strip()
+ if not line or line.startswith('#'):
+ continue
+ path, relative = line.split(" ")
+ rel_path = os.path.split(relative)
+ if len(rel_path) > 1:
+ base_dir = rel_path[0].strip('"')
+ if base_dir != current_dir:
+ set_out_path = 'SetOutPath "$INSTDIR\{}"'.format(base_dir)
+ print(set_out_path, file=f)
+ current_dir = base_dir
+
+ path = path.strip('"')
+ if args.sysroot:
+ path = os.path.join(args.sysroot, path)
+ file_path = 'File "{}"'.format(path)
+ print(file_path, file=f)
+
diff --git a/packaging/nsis/wireshark-additional-tasks.nsddef b/packaging/nsis/wireshark-additional-tasks.nsddef
new file mode 100644
index 0000000..bc12865
--- /dev/null
+++ b/packaging/nsis/wireshark-additional-tasks.nsddef
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+This file was created by NSISDialogDesigner 1.5.0.0
+https://coolsoft.altervista.org/nsisdialogdesigner
+Do not edit manually!
+-->
+<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
+ <CreateFunctionCustomScript>; Defined in wireshark.nsi
+Call InitAdditionalTasksPage</CreateFunctionCustomScript>
+ <Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" />
+ <CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Wireshark" TabIndex="1" />
+ <CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Wireshark Quick Launch Icon" TabIndex="2" />
+ <CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Wireshark Desktop Icon" TabIndex="3" />
+ <CheckBox Name="StartMenuCheckBox" Location="22, 34" Size="406, 14" Text="Wireshark Start Menu Item" TabIndex="4" />
+ <Label Name="FileExtensionsLabel" Location="12, 101" Size="426, 14" Text="Associate File Extensions" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="5" />
+ <Label Name="CreateShortcutsLabel" Location="12, 9" Size="426, 14" Text="Create Shortcuts" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="6" />
+</Dialog>
diff --git a/packaging/nsis/wireshark-additional-tasks.nsdinc b/packaging/nsis/wireshark-additional-tasks.nsdinc
new file mode 100644
index 0000000..694bb58
--- /dev/null
+++ b/packaging/nsis/wireshark-additional-tasks.nsdinc
@@ -0,0 +1,70 @@
+; =========================================================
+; This file was generated by NSISDialogDesigner 1.5.0.0
+; https://coolsoft.altervista.org/nsisdialogdesigner
+;
+; Do not edit it manually, use NSISDialogDesigner instead!
+; =========================================================
+
+; handle variables
+Var hCtl_AdditionalTasksPage
+Var hCtl_AdditionalTasksPage_ExtensionsLabel
+Var hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox
+Var hCtl_AdditionalTasksPage_DesktopIconCheckBox
+Var hCtl_AdditionalTasksPage_StartMenuCheckBox
+Var hCtl_AdditionalTasksPage_FileExtensionsLabel
+Var hCtl_AdditionalTasksPage_CreateShortcutsLabel
+Var hCtl_AdditionalTasksPage_Font1
+
+
+; dialog create function
+Function fnc_AdditionalTasksPage_Create
+
+ ; custom font definitions
+ CreateFont $hCtl_AdditionalTasksPage_Font1 "Microsoft Sans Serif" "8.25" "700"
+
+ ; === AdditionalTasksPage (type: Dialog) ===
+ nsDialogs::Create 1018
+ Pop $hCtl_AdditionalTasksPage
+ ${If} $hCtl_AdditionalTasksPage == error
+ Abort
+ ${EndIf}
+ !insertmacro MUI_HEADER_TEXT "Additional Tasks" "Create shortcuts and associate file extensions."
+
+ ; === ExtensionsLabel (type: Label) ===
+ ${NSD_CreateLabel} 14u 93u 245u 32u "Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz."
+ Pop $hCtl_AdditionalTasksPage_ExtensionsLabel
+
+ ; === AssociateExtensionsCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 78u 267u 9u "Associate trace file extensions with Wireshark"
+ Pop $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox
+
+ ; === DesktopIconCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 33u 267u 9u "Wireshark Desktop Icon"
+ Pop $hCtl_AdditionalTasksPage_DesktopIconCheckBox
+
+ ; === StartMenuCheckBox (type: Checkbox) ===
+ ${NSD_CreateCheckbox} 14u 21u 267u 9u "Wireshark Start Menu Item"
+ Pop $hCtl_AdditionalTasksPage_StartMenuCheckBox
+
+ ; === FileExtensionsLabel (type: Label) ===
+ ${NSD_CreateLabel} 8u 62u 280u 9u "Associate File Extensions"
+ Pop $hCtl_AdditionalTasksPage_FileExtensionsLabel
+ SendMessage $hCtl_AdditionalTasksPage_FileExtensionsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0
+
+ ; === CreateShortcutsLabel (type: Label) ===
+ ${NSD_CreateLabel} 8u 6u 280u 9u "Create Shortcuts"
+ Pop $hCtl_AdditionalTasksPage_CreateShortcutsLabel
+ SendMessage $hCtl_AdditionalTasksPage_CreateShortcutsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0
+
+ ; CreateFunctionCustomScript
+ ; Defined in wireshark.nsi
+ Call InitAdditionalTasksPage
+
+
+FunctionEnd
+
+; dialog show function
+Function fnc_AdditionalTasksPage_Show
+ Call fnc_AdditionalTasksPage_Create
+ nsDialogs::Show
+FunctionEnd
diff --git a/packaging/nsis/wireshark-common.nsh b/packaging/nsis/wireshark-common.nsh
new file mode 100644
index 0000000..00e3152
--- /dev/null
+++ b/packaging/nsis/wireshark-common.nsh
@@ -0,0 +1,154 @@
+
+; ============================================================================
+; Name and version information
+; ============================================================================
+
+Unicode true
+; This improves the installer's appearance considerably here on a display scaled
+; to 225%, but checkboxes are comically small. We might be able to fix this
+; using the SysCompImg extension:
+; http://forums.winamp.com/showthread.php?t=443754
+ManifestDPIAware true
+; These might be correct in the future, but are currently undocumented:
+; http://forums.winamp.com/showthread.php?t=452632
+; ManifestDPIAware System
+; ManifestDPIAwareness "PerMonitorV2,System"
+
+!ifdef NSIS_INCLUDE_DIR
+!addincludedir ${NSIS_INCLUDE_DIR}
+!endif
+
+!include "wireshark-config.nsh"
+
+!define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} ${WIRESHARK_TARGET_PLATFORM}"
+Name "${DISPLAY_NAME}"
+
+!define PROGRAM_FULL_NAME "The ${PROGRAM_NAME} Network Protocol Analyzer"
+!define PROGRAM_NAME_PATH "${PROGRAM_NAME}.exe"
+
+!define UNINSTALLER_NAME "uninstall-wireshark.exe"
+
+VIAddVersionKey "ProductName" "${PROGRAM_NAME}"
+VIAddVersionKey "Comments" "It's a great product with a great story to tell. I'm pumped!"
+VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team"
+; NSIS handles U+00a9 but not a UTF-8 encoded copyright symbol.
+VIAddVersionKey "LegalCopyright" "${U+00a9} Gerald Combs and many others"
+VIAddVersionKey "LegalTrademarks" "Wireshark and the 'fin' logo are registered trademarks of the Wireshark Foundation"
+VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for Windows on ${WIRESHARK_TARGET_PLATFORM}"
+VIAddVersionKey "Language" "English"
+VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
+VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
+VIProductVersion "${PRODUCT_VERSION}"
+
+XPStyle on
+
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+; Used to refresh the display of file association
+!define SHCNE_ASSOCCHANGED 0x08000000
+!define SHCNF_IDLIST 0
+
+!macro UpdateIcons
+ Push $R0
+ Push $R1
+ Push $R2
+
+ !define UPDATEICONS_UNIQUE ${__LINE__}
+
+ IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
+UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+ Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
+ MessageBox MB_OK|MB_ICONSTOP \
+ "Can't find 'shell32.dll' library. Impossible to update icons" \
+ /SD IDOK
+ Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
+ !undef UPDATEICONS_UNIQUE
+ Pop $R2
+ Pop $R1
+ Pop $R0
+
+; Force the icon cache to refresh
+; https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
+IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2
+Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
+
+!macroend
+
+; ============================================================================
+; Push our known file extensions onto the stack, prepended with a marker
+; Note that this is a subset of all the extensions for files that
+; Wireshark can read. We probably don't want to grab JPEG or MP3 files.
+; ============================================================================
+
+; Used to add associations between file extensions and Wireshark
+!define WIRESHARK_ASSOC "wireshark-capture-file"
+
+!define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER"
+
+!macro PushFileExtensions
+ Push "${FILE_EXTENSION_MARKER}"
+ Push ".wpz"
+ Push ".wpc"
+ Push ".vwr"
+ Push ".trc"
+ Push ".trace"
+ Push ".tr1"
+ Push ".tpc"
+ Push ".syc"
+ Push ".snoop"
+ Push ".rf5"
+ Push ".pkt"
+ Push ".pklg"
+ Push ".pcapng"
+ Push ".pcap"
+ Push ".out"
+ Push ".ntar"
+ Push ".mplog"
+ Push ".lcap"
+ Push ".ipfix"
+ Push ".fdc"
+ Push ".erf"
+ Push ".enc"
+ Push ".cap"
+ Push ".bfr"
+ Push ".atc"
+ Push ".apc"
+ Push ".acp"
+ Push ".5vw"
+ Push ".rtp"
+!macroend
+
+!macro IsWiresharkRunning
+; See if Wireshark is running
+; https://nsis.sourceforge.io/Check_whether_your_application_is_running
+${Do}
+
+ System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
+ IntCmp $R0 0 checkRunningSession
+ System::Call 'kernel32::CloseHandle(i $R0)'
+ Goto isRunning
+
+checkRunningSession:
+ System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
+ IntCmp $R0 0 notRunning
+ System::Call 'kernel32::CloseHandle(i $R0)'
+
+isRunning:
+ ; You'd better go catch it.
+ MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking
+ Quit
+
+notRunning:
+ ${ExitDo}
+
+continueChecking:
+${Loop}
+!macroend
diff --git a/packaging/nsis/wireshark-config.nsh.in b/packaging/nsis/wireshark-config.nsh.in
new file mode 100644
index 0000000..769f9e7
--- /dev/null
+++ b/packaging/nsis/wireshark-config.nsh.in
@@ -0,0 +1,40 @@
+# ============================================================================
+# NSIS configuration definitions. Generated from wireshark-config.nsh.in.
+# ============================================================================
+
+# Do not prefix comments with ";". They will be removed by CMake.
+
+# MUST match "<Product ... Name=" in wix/Wireshark.wxs.
+#define PROGRAM_NAME "@PROGRAM_NAME@"
+#define TOP_SRC_DIR "@TOP_SRC_DIR@"
+#define WIRESHARK_TARGET_PLATFORM @WIRESHARK_TARGET_PLATFORM@
+#define EXTRA_INSTALLER_DIR "@EXTRA_INSTALLER_DIR@"
+#define NPCAP_PACKAGE_VERSION @NPCAP_VERSION@
+#define USBPCAP_PACKAGE_VERSION @USBPCAP_VERSION@
+#define VERSION @PROJECT_VERSION@
+#define MAJOR_VERSION @PROJECT_MAJOR_VERSION@
+#define MINOR_VERSION @PROJECT_MINOR_VERSION@
+#define PRODUCT_VERSION @PRODUCT_VERSION@
+
+#define VCREDIST_DIR "@VCREDIST_DIR@"
+#define VCREDIST_EXE "@VCREDIST_EXE@"
+
+# Optional components
+
+#cmakedefine MMDBRESOLVE_EXE @MMDBRESOLVE_EXE@
+#cmakedefine BUILD_etwdump
+#cmakedefine SPANDSP_FOUND
+#cmakedefine BCG729_FOUND
+#cmakedefine SBC_FOUND
+#cmakedefine ILBC_FOUND
+#cmakedefine OPUS_FOUND
+#cmakedefine LIBSSH_FOUND
+
+#cmakedefine DOCBOOK_DIR "@DOCBOOK_DIR@"
+
+#cmakedefine SMI_DIR "@SMI_DIR@"
+
+#cmakedefine QT_DIR "@QT_DIR@"
+
+#cmakedefine ENABLE_SIGNED_NSIS
+#cmakedefine SKIP_NSIS_QT_DLLS
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi
new file mode 100644
index 0000000..5271cd3
--- /dev/null
+++ b/packaging/nsis/wireshark.nsi
@@ -0,0 +1,1657 @@
+;
+; wireshark.nsi
+;
+
+; Set the compression mechanism first.
+; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
+; is no longer the default, so use the /SOLID switch.
+; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
+; So if you get an error here, please update to at least NSIS 2.07!
+SetCompressor /SOLID lzma
+SetCompressorDictSize 64 ; MB
+
+!include "wireshark-common.nsh"
+!include 'LogicLib.nsh'
+!include "StrFunc.nsh"
+!include "WordFunc.nsh"
+
+${StrRep}
+${UnStrRep}
+
+; See https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time for documentation
+!macro !defineifexist _VAR_NAME _FILE_NAME
+ !tempfile _TEMPFILE
+ !ifdef NSIS_WIN32_MAKENSIS
+ ; Windows - cmd.exe
+ !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
+ !else
+ ; Posix - sh
+ !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
+ !endif
+ !include '${_TEMPFILE}'
+ !delfile '${_TEMPFILE}'
+ !undef _TEMPFILE
+!macroend
+!define !defineifexist "!insertmacro !defineifexist"
+
+; ============================================================================
+; Header configuration
+; ============================================================================
+
+; The file to write
+OutFile "${OUTFILE_DIR}\${PROGRAM_NAME}-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe"
+; Installer icon
+Icon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
+; Uninstaller icon
+UninstallIcon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
+
+; ============================================================================
+; Modern UI
+; ============================================================================
+; The modern user interface will look much better than the common one.
+; However, as the development of the modern UI is still going on, and the script
+; syntax changes, you will need exactly that NSIS version, which this script is
+; made for. This is the current (December 2003) latest version: V2.0b4
+; If you are using a different version, it's not predictable what will happen.
+
+!include "MUI2.nsh"
+!include "InstallOptions.nsh"
+;!addplugindir ".\Plugins"
+
+!define MUI_ICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
+!define MUI_UNICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
+BrandingText "Wireshark${U+00ae} Installer"
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue."
+;!define MUI_FINISHPAGE_LINK "Install Npcap to be able to capture packets from a network."
+;!define MUI_FINISHPAGE_LINK_LOCATION "https://npcap.com/"
+
+; NSIS shows Readme files by opening the Readme file with the default application for
+; the file's extension. "README.win32" won't work in most cases, because extension "win32"
+; is usually not associated with an appropriate text editor. We should use extension "txt"
+; for a text file or "html" for an html README file.
+!define MUI_FINISHPAGE_TITLE_3LINES
+!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
+!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+; NSIS runs as Administrator and will run Wireshark as Administrator
+; if these are enabled.
+;!define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH}"
+;!define MUI_FINISHPAGE_RUN_NOTCHECKED
+
+!define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
+
+; ============================================================================
+; MUI Pages
+; ============================================================================
+
+!insertmacro MUI_PAGE_WELCOME
+
+!define MUI_LICENSEPAGE_TEXT_TOP "Wireshark is distributed under the GNU General Public License."
+!define MUI_LICENSEPAGE_TEXT_BOTTOM "This is not an end user license agreement (EULA). It is provided here for informational purposes only."
+!define MUI_LICENSEPAGE_BUTTON "Noted"
+!insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt"
+
+Page custom DisplayDonatePage
+
+!insertmacro MUI_PAGE_COMPONENTS
+!ifdef QT_DIR
+Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage
+!endif
+!insertmacro MUI_PAGE_DIRECTORY
+Page custom DisplayNpcapPage
+Page custom DisplayUSBPcapPage
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+
+; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
+!define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue."
+; Uninstall stuff (this text isn't used with the MODERN_UI!)
+;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue."
+
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_FINISHPAGE_TITLE_3LINES
+
+!insertmacro MUI_UNPAGE_WELCOME
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_COMPONENTS
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+
+; ============================================================================
+; MUI Languages
+; ============================================================================
+
+!insertmacro MUI_LANGUAGE "English"
+
+; ============================================================================
+; Reserve Files
+; ============================================================================
+
+ ;Things that need to be extracted on first (keep these lines before any File command!)
+ ;Only useful for BZIP2 compression
+
+ ; Old Modern 1 UI: https://nsis.sourceforge.io/Docs/Modern%20UI/Readme.html
+ ; To do: Upgrade to the Modern 2 UI:
+ ;ReserveFile "AdditionalTasksPage.ini"
+ ReserveFile "DonatePage.ini"
+ ReserveFile "NpcapPage.ini"
+ ReserveFile "USBPcapPage.ini"
+ ReserveFile /plugin InstallOptions.dll
+
+ ; Modern UI 2 / nsDialog pages.
+ ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html
+ ; https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html
+ !ifdef QT_DIR
+ !include "wireshark-additional-tasks.nsdinc"
+ !endif
+
+; ============================================================================
+; Section macros
+; ============================================================================
+!include "Sections.nsh"
+
+; ============================================================================
+; Command Line
+; ============================================================================
+!include "FileFunc.nsh"
+
+!insertmacro GetParameters
+!insertmacro GetOptions
+
+; ========= Install extcap binary and help file =========
+!macro InstallExtcap EXTCAP_NAME
+
+ SetOutPath $INSTDIR
+ File "${STAGING_DIR}\${EXTCAP_NAME}.html"
+ SetOutPath $INSTDIR\extcap
+ File "${STAGING_DIR}\extcap\${EXTCAP_NAME}.exe"
+
+!macroend
+
+; ========= Check if silent mode install of /EXTRACOMPONENTS =========
+!macro CheckExtrasFlag EXTRAS_NAME
+ !define EXTRAS_FLAG ${__LINE__}
+Section
+ IfSilent +1 skip_${EXTRAS_FLAG}
+ push $R0
+ push $R1
+ push $R2
+ ${GetParameters} $R0
+ ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1
+ IfErrors popreg_${EXTRAS_FLAG}
+ ${WordFind} $R1 "," "E+1" $R0
+
+; No delimiters found - check for single word match
+ ${If} $R0 = 1
+ StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG}
+ ${ENDIF}
+
+; Loop through all delimited words checking for match
+ IntOp $R2 0 + 1
+ ${While} $R0 != 2
+ StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0
+ IntOp $R2 $R2 + 1
+ ${WordFind} $R1 "," "E+$R2" $R0
+ ${EndWhile}
+ Goto popreg_${EXTRAS_FLAG}
+
+install_${EXTRAS_FLAG}:
+ !insertmacro InstallExtcap ${EXTRAS_NAME}
+popreg_${EXTRAS_FLAG}:
+ pop $R2
+ pop $R1
+ pop $R0
+skip_${EXTRAS_FLAG}:
+ !undef EXTRAS_FLAG
+SectionEnd
+!macroend
+
+; ============================================================================
+; Component page configuration
+; ============================================================================
+ComponentText "The following components are available for installation."
+
+; ============================================================================
+; Directory selection page configuration
+; ============================================================================
+; The text to prompt the user to enter a directory
+DirText "Choose a directory in which to install ${PROGRAM_NAME}."
+
+; The default installation directory
+InstallDir $PROGRAMFILES64\${PROGRAM_NAME}
+
+; See if this is an upgrade; if so, use the old InstallDir as default
+InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir
+
+
+; ============================================================================
+; Install page configuration
+; ============================================================================
+ShowInstDetails show
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+Var EXTENSION
+; https://docs.microsoft.com/en-us/windows/win32/shell/fa-file-types
+Function Associate
+ Push $R0
+ !insertmacro PushFileExtensions
+
+ Pop $EXTENSION
+
+ ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
+ ReadRegStr $R0 HKCR $EXTENSION ""
+ StrCmp $R0 "" Associate.doRegister
+ Goto Associate.end
+
+Associate.doRegister:
+ ;The extension is not associated to any program, we can do the link
+ WriteRegStr HKCR $EXTENSION "" ${WIRESHARK_ASSOC}
+ DetailPrint "Registered file type: $EXTENSION"
+
+Associate.end:
+ Pop $EXTENSION
+ ${Loop}
+
+ Pop $R0
+FunctionEnd
+
+; Control states
+Var START_MENU_STATE
+Var DESKTOP_ICON_STATE
+Var FILE_ASSOCIATE_STATE
+
+; NSIS
+Var OLD_UNINSTALLER
+Var OLD_INSTDIR
+Var OLD_DISPLAYNAME
+Var TMP_UNINSTALLER
+
+; WiX
+Var REGISTRY_BITS
+Var TMP_PRODUCT_GUID
+Var WIX_DISPLAYNAME
+Var WIX_DISPLAYVERSION
+Var WIX_UNINSTALLSTRING
+
+; ============================================================================
+; 64-bit support
+; ============================================================================
+!include x64.nsh
+
+!include "GetWindowsVersion.nsh"
+!include WinMessages.nsh
+
+Function .onInit
+ ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
+ ${IfNot} ${RunningX64}
+ MessageBox MB_OK "Wireshark only runs on 64 bit machines.$\nTry installing a 32 bit version (3.6 or earlier) instead." /SD IDOK
+ Abort
+ ${EndIf}
+
+ !if ${WIRESHARK_TARGET_PLATFORM} == "x64"
+ ${If} ${IsNativeARM64}
+ MessageBox MB_OK "You're installing the x64 version of Wireshark on an Arm64 system.$\nThe native Arm64 installer might work better." /SD IDOK
+ ${EndIf}
+ !endif
+
+ !if ${WIRESHARK_TARGET_PLATFORM} == "arm64"
+ ${IfNot} ${IsNativeARM64}
+ MessageBox MB_OK "You're trying to install the Arm64 version of Wireshark on an x64 system.$\nTry the native x64 installer instead." /SD IDOK
+ Abort
+ ${EndIf}
+ !endif
+
+ ; Get the Windows version
+ ${GetWindowsVersion} $R0
+
+ ; This should match the following:
+ ; - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in
+ ; - The <compatibility><application> section in image\wireshark.exe.manifest.in
+ ; - The VersionNT parts of packaging\wix\Prerequisites.wxi
+
+ ; Uncomment to test.
+ ; MessageBox MB_OK "You're running Windows $R0."
+
+ ; Check if we're able to run with this version
+ StrCmp $R0 '95' lbl_winversion_unsupported
+ StrCmp $R0 '98' lbl_winversion_unsupported
+ StrCmp $R0 'ME' lbl_winversion_unsupported
+ StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
+ StrCmp $R0 '2000' lbl_winversion_unsupported_2000
+ StrCmp $R0 'XP' lbl_winversion_unsupported_xp_2003
+ StrCmp $R0 '2003' lbl_winversion_unsupported_xp_2003
+ StrCmp $R0 'Vista' lbl_winversion_unsupported_vista_2008
+ StrCmp $R0 '2008' lbl_winversion_unsupported_vista_2008
+ Goto lbl_winversion_supported
+
+lbl_winversion_unsupported:
+ MessageBox MB_OK \
+ "Windows $R0 is no longer supported.$\nPlease install Ethereal 0.99.0 instead." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_unsupported_nt4:
+ MessageBox MB_OK \
+ "Windows $R0 is no longer supported.$\nPlease install Wireshark 0.99.4 instead." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_unsupported_2000:
+ MessageBox MB_OK \
+ "Windows $R0 is no longer supported.$\nPlease install Wireshark 1.2 or 1.0 instead." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_unsupported_xp_2003:
+ MessageBox MB_OK \
+ "Windows $R0 is no longer supported.$\nPlease install ${PROGRAM_NAME} 1.12 or 1.10 instead." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_unsupported_vista_2008:
+ MessageBox MB_OK \
+ "Windows $R0 is no longer supported.$\nPlease install ${PROGRAM_NAME} 2.2 instead." \
+ /SD IDOK
+ Quit
+
+lbl_winversion_supported:
+!insertmacro IsWiresharkRunning
+
+ ; Default control values.
+ StrCpy $START_MENU_STATE ${BST_CHECKED}
+ StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
+ StrCpy $FILE_ASSOCIATE_STATE ${BST_CHECKED}
+
+ ; Copied from https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new
+ ReadRegStr $OLD_UNINSTALLER HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+ "UninstallString"
+ StrCmp $OLD_UNINSTALLER "" check_wix
+
+ ReadRegStr $OLD_INSTDIR HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \
+ "Path"
+ StrCmp $OLD_INSTDIR "" check_wix
+
+ ReadRegStr $OLD_DISPLAYNAME HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+ "DisplayName"
+ StrCmp $OLD_DISPLAYNAME "" done
+
+ ; We're reinstalling. Flip our control states according to what the
+ ; user chose before.
+ ; (we use the "all users" start menu, so select it first)
+ SetShellVarContext all
+ ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 1 sm $START_MENU_STATE di $DESKTOP_ICON_STATE"
+ ${IfNot} ${FileExists} $SMPROGRAMS\${PROGRAM_NAME}.lnk
+ StrCpy $START_MENU_STATE ${BST_UNCHECKED}
+ ${Endif}
+ ${If} ${FileExists} $DESKTOP\${PROGRAM_NAME}.lnk
+ StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
+ ${Endif}
+ ; Leave FILE_ASSOCIATE_STATE checked.
+ ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 2 sm $START_MENU_STATE $SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk \
+ ; $\ndi $DESKTOP_ICON_STATE $DESKTOP\${PROGRAM_NAME}.lnk
+
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$OLD_DISPLAYNAME is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ /SD IDYES \
+ IDYES prep_nsis_uninstaller \
+ IDNO done
+ Abort
+
+; Copy the uninstaller to $TEMP and run it.
+; The uninstaller normally does this by itself, but doesn't wait around
+; for the executable to finish, which means ExecWait won't work correctly.
+prep_nsis_uninstaller:
+ ClearErrors
+ StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
+ ; ...because we surround UninstallString in quotes.
+ StrCpy $0 $OLD_UNINSTALLER -1 1
+ StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
+ StrCpy $2 1
+ System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
+ ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
+
+ Delete "$TMP_UNINSTALLER"
+
+; Look for a WiX-installed package.
+
+check_wix:
+ StrCpy $REGISTRY_BITS 64
+ SetRegView 64
+ check_wix_restart:
+ StrCpy $0 0
+ wix_reg_enum_loop:
+ EnumRegKey $TMP_PRODUCT_GUID HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
+ StrCmp $TMP_PRODUCT_GUID "" wix_enum_reg_done
+ IntOp $0 $0 + 1
+ ReadRegStr $WIX_DISPLAYNAME HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "DisplayName"
+ ; MessageBox MB_OK|MB_ICONINFORMATION "Reading HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1 DisplayName = $2"
+ ; Look for "Wireshark".
+ StrCmp $WIX_DISPLAYNAME "${PROGRAM_NAME}" wix_found wix_reg_enum_loop
+
+ wix_found:
+ ReadRegStr $WIX_DISPLAYVERSION HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "DisplayVersion"
+ ReadRegStr $WIX_UNINSTALLSTRING HKLM \
+ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
+ "UninstallString"
+ StrCmp $WIX_UNINSTALLSTRING "" done
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$WIX_DISPLAYNAME $WIX_DISPLAYVERSION (msi) is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ /SD IDYES \
+ IDYES prep_wix_uninstaller \
+ IDNO done
+ Abort
+
+ ; Run the WiX-provided UninstallString.
+ prep_wix_uninstaller:
+ ClearErrors
+ ExecWait "$WIX_UNINSTALLSTRING"
+
+ Goto done
+
+ wix_enum_reg_done:
+ ; MessageBox MB_OK|MB_ICONINFORMATION "Checked $0 $REGISTRY_BITS bit keys"
+ IntCmp $REGISTRY_BITS 32 done
+ StrCpy $REGISTRY_BITS 32
+ SetRegView 32
+ Goto check_wix_restart
+
+done:
+
+ ; Command line parameters
+ ${GetParameters} $R0
+
+ ${GetOptions} $R0 "/desktopicon=" $R1
+ ${If} $R1 == "yes"
+ StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
+ ${ElseIf} $R1 == "no"
+ StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
+ ${Endif}
+
+ ;Extract InstallOptions INI files
+ ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
+ !insertmacro INSTALLOPTIONS_EXTRACT "DonatePage.ini"
+ !insertmacro INSTALLOPTIONS_EXTRACT "NpcapPage.ini"
+ !insertmacro INSTALLOPTIONS_EXTRACT "USBPcapPage.ini"
+FunctionEnd
+
+!ifdef QT_DIR
+Function DisplayAdditionalTasksPage
+ Call fnc_AdditionalTasksPage_Show
+FunctionEnd
+!endif
+
+Function DisplayDonatePage
+ !insertmacro MUI_HEADER_TEXT "Your donations keep these releases coming" "Donate today"
+ !insertmacro INSTALLOPTIONS_DISPLAY "DonatePage.ini"
+FunctionEnd
+
+Function DisplayNpcapPage
+ !insertmacro MUI_HEADER_TEXT "Packet Capture" "Wireshark requires either Npcap or WinPcap to capture live network data."
+ !insertmacro INSTALLOPTIONS_DISPLAY "NpcapPage.ini"
+FunctionEnd
+
+Function DisplayUSBPcapPage
+ !insertmacro MUI_HEADER_TEXT "USB Capture" "USBPcap is required to capture USB traffic. Should USBPcap be installed (experimental)?"
+ !insertmacro INSTALLOPTIONS_DISPLAY "USBPcapPage.ini"
+FunctionEnd
+
+; ============================================================================
+; Installation execution commands
+; ============================================================================
+
+Var USBPCAP_UNINSTALL ;declare variable for holding the value of a registry key
+;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
+
+Section "-Required"
+;-------------------------------------------
+
+;
+; Install for every user
+;
+SetShellVarContext all
+
+SetOutPath $INSTDIR
+!ifndef SKIP_UNINSTALLER
+WriteUninstaller "$INSTDIR\${UNINSTALLER_NAME}"
+!endif
+File "${STAGING_DIR}\libwiretap.dll"
+File "${STAGING_DIR}\libwireshark.dll"
+File "${STAGING_DIR}\libwsutil.dll"
+
+!include wireshark-manifest.nsh
+
+File "${STAGING_DIR}\COPYING.txt"
+File "${STAGING_DIR}\NEWS.txt"
+File "${STAGING_DIR}\README.txt"
+File "${STAGING_DIR}\README.windows.txt"
+File "${STAGING_DIR}\wka"
+File "${STAGING_DIR}\pdml2html.xsl"
+File "${STAGING_DIR}\ws.css"
+File "${STAGING_DIR}\wireshark.html"
+File "${STAGING_DIR}\wireshark-filter.html"
+File "${STAGING_DIR}\dumpcap.exe"
+File "${STAGING_DIR}\dumpcap.html"
+File "${STAGING_DIR}\extcap.html"
+File "${STAGING_DIR}\ipmap.html"
+File "${STAGING_DIR}\release-notes.html"
+
+!ifdef USE_VCREDIST
+; C-runtime redistributable
+; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer
+File "${VCREDIST_DIR}\${VCREDIST_EXE}"
+; If the user already has the redistributable installed they will see a
+; Big Ugly Dialog by default, asking if they want to uninstall or repair.
+; Ideally we should add a checkbox for this somewhere. In the meantime,
+; just do a "quiet" install.
+
+; http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html
+ExecWait '"$INSTDIR\${VCREDIST_EXE}" /install /quiet /norestart' $0
+DetailPrint "${VCREDIST_EXE} returned $0"
+
+; https://docs.microsoft.com/en-us/windows/desktop/Msi/error-codes
+!define ERROR_SUCCESS 0
+!define ERROR_SUCCESS_REBOOT_INITIATED 1641
+!define ERROR_PRODUCT_VERSION 1638
+!define ERROR_SUCCESS_REBOOT_REQUIRED 3010
+${Switch} $0
+ ${Case} ${ERROR_SUCCESS}
+ ${Case} ${ERROR_PRODUCT_VERSION}
+ ${Break}
+ ${Case} ${ERROR_SUCCESS_REBOOT_INITIATED} ; Shouldn't happen.
+ ${Case} ${ERROR_SUCCESS_REBOOT_REQUIRED}
+ SetRebootFlag true
+ ${Break}
+ ${Default}
+ MessageBox MB_OK "The Visual C++ Redistributable installer failed with error $0.$\nUnable to continue installation." /SD IDOK
+ Abort
+ ${Break}
+${EndSwitch}
+
+Delete "$INSTDIR\${VCREDIST_EXE}"
+!endif
+
+
+; global config files - don't overwrite if already existing
+;IfFileExists cfilters dont_overwrite_cfilters
+File "${STAGING_DIR}\cfilters"
+;dont_overwrite_cfilters:
+;IfFileExists colorfilters dont_overwrite_colorfilters
+File "${STAGING_DIR}\colorfilters"
+;dont_overwrite_colorfilters:
+;IfFileExists dfilters dont_overwrite_dfilters
+File "${STAGING_DIR}\dfilters"
+;dont_overwrite_dfilters:
+;IfFileExists smi_modules dont_overwrite_smi_modules
+File "${STAGING_DIR}\smi_modules"
+;dont_overwrite_smi_modules:
+
+
+;
+; Install the Diameter DTD and XML files in the "diameter" subdirectory
+; of the installation directory.
+;
+SetOutPath $INSTDIR\diameter
+File "${STAGING_DIR}\diameter\AlcatelLucent.xml"
+File "${STAGING_DIR}\diameter\chargecontrol.xml"
+File "${STAGING_DIR}\diameter\Cisco.xml"
+File "${STAGING_DIR}\diameter\CiscoSystems.xml"
+File "${STAGING_DIR}\diameter\Custom.xml"
+File "${STAGING_DIR}\diameter\dictionary.dtd"
+File "${STAGING_DIR}\diameter\dictionary.xml"
+File "${STAGING_DIR}\diameter\eap.xml"
+File "${STAGING_DIR}\diameter\Ericsson.xml"
+File "${STAGING_DIR}\diameter\etsie2e4.xml"
+File "${STAGING_DIR}\diameter\HP.xml"
+File "${STAGING_DIR}\diameter\Huawei.xml"
+File "${STAGING_DIR}\diameter\Inovar.xml"
+File "${STAGING_DIR}\diameter\Juniper.xml"
+File "${STAGING_DIR}\diameter\Metaswitch.xml"
+File "${STAGING_DIR}\diameter\Microsoft.xml"
+File "${STAGING_DIR}\diameter\mobileipv4.xml"
+File "${STAGING_DIR}\diameter\mobileipv6.xml"
+File "${STAGING_DIR}\diameter\nasreq.xml"
+File "${STAGING_DIR}\diameter\Nokia.xml"
+File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml"
+File "${STAGING_DIR}\diameter\Oracle.xml"
+File "${STAGING_DIR}\diameter\Siemens.xml"
+File "${STAGING_DIR}\diameter\sip.xml"
+File "${STAGING_DIR}\diameter\Starent.xml"
+File "${STAGING_DIR}\diameter\sunping.xml"
+File "${STAGING_DIR}\diameter\Telefonica.xml"
+File "${STAGING_DIR}\diameter\TGPP.xml"
+File "${STAGING_DIR}\diameter\TGPP2.xml"
+File "${STAGING_DIR}\diameter\Vodafone.xml"
+File "${STAGING_DIR}\diameter\VerizonWireless.xml"
+!include "custom_diameter_xmls.txt"
+SetOutPath $INSTDIR
+
+;
+; Install the RADIUS directory files in the "radius" subdirectory
+; of the installation directory.
+;
+SetOutPath $INSTDIR\radius
+File "${STAGING_DIR}\radius\README.radius_dictionary"
+File "${STAGING_DIR}\radius\custom.includes"
+File "${STAGING_DIR}\radius\dictionary"
+File "${STAGING_DIR}\radius\dictionary.3com"
+File "${STAGING_DIR}\radius\dictionary.3gpp"
+File "${STAGING_DIR}\radius\dictionary.3gpp2"
+File "${STAGING_DIR}\radius\dictionary.5x9"
+File "${STAGING_DIR}\radius\dictionary.acc"
+File "${STAGING_DIR}\radius\dictionary.acme"
+File "${STAGING_DIR}\radius\dictionary.actelis"
+File "${STAGING_DIR}\radius\dictionary.aerohive"
+File "${STAGING_DIR}\radius\dictionary.airespace"
+File "${STAGING_DIR}\radius\dictionary.alcatel"
+File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa"
+File "${STAGING_DIR}\radius\dictionary.alcatel.esam"
+File "${STAGING_DIR}\radius\dictionary.alcatel.sr"
+File "${STAGING_DIR}\radius\dictionary.alteon"
+File "${STAGING_DIR}\radius\dictionary.altiga"
+File "${STAGING_DIR}\radius\dictionary.alvarion"
+File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2"
+File "${STAGING_DIR}\radius\dictionary.apc"
+File "${STAGING_DIR}\radius\dictionary.aptilo"
+File "${STAGING_DIR}\radius\dictionary.aptis"
+File "${STAGING_DIR}\radius\dictionary.arbor"
+File "${STAGING_DIR}\radius\dictionary.aruba"
+File "${STAGING_DIR}\radius\dictionary.ascend"
+File "${STAGING_DIR}\radius\dictionary.asn"
+File "${STAGING_DIR}\radius\dictionary.audiocodes"
+File "${STAGING_DIR}\radius\dictionary.avaya"
+File "${STAGING_DIR}\radius\dictionary.azaire"
+File "${STAGING_DIR}\radius\dictionary.bay"
+File "${STAGING_DIR}\radius\dictionary.bintec"
+File "${STAGING_DIR}\radius\dictionary.bluecoat"
+File "${STAGING_DIR}\radius\dictionary.bristol"
+File "${STAGING_DIR}\radius\dictionary.broadsoft"
+File "${STAGING_DIR}\radius\dictionary.brocade"
+File "${STAGING_DIR}\radius\dictionary.bskyb"
+File "${STAGING_DIR}\radius\dictionary.bt"
+File "${STAGING_DIR}\radius\dictionary.cablelabs"
+File "${STAGING_DIR}\radius\dictionary.cabletron"
+File "${STAGING_DIR}\radius\dictionary.camiant"
+File "${STAGING_DIR}\radius\dictionary.chillispot"
+File "${STAGING_DIR}\radius\dictionary.cisco"
+File "${STAGING_DIR}\radius\dictionary.cisco.asa"
+File "${STAGING_DIR}\radius\dictionary.cisco.bbsm"
+File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000"
+File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000"
+File "${STAGING_DIR}\radius\dictionary.citrix"
+File "${STAGING_DIR}\radius\dictionary.clavister"
+File "${STAGING_DIR}\radius\dictionary.cnergee"
+File "${STAGING_DIR}\radius\dictionary.colubris"
+File "${STAGING_DIR}\radius\dictionary.columbia_university"
+File "${STAGING_DIR}\radius\dictionary.compat"
+File "${STAGING_DIR}\radius\dictionary.compatible"
+File "${STAGING_DIR}\radius\dictionary.cosine"
+File "${STAGING_DIR}\radius\dictionary.dante"
+File "${STAGING_DIR}\radius\dictionary.dellemc"
+File "${STAGING_DIR}\radius\dictionary.dhcp"
+File "${STAGING_DIR}\radius\dictionary.digium"
+File "${STAGING_DIR}\radius\dictionary.dlink"
+File "${STAGING_DIR}\radius\dictionary.dragonwave"
+File "${STAGING_DIR}\radius\dictionary.efficientip"
+File "${STAGING_DIR}\radius\dictionary.eltex"
+File "${STAGING_DIR}\radius\dictionary.enterasys"
+File "${STAGING_DIR}\radius\dictionary.epygi"
+File "${STAGING_DIR}\radius\dictionary.equallogic"
+File "${STAGING_DIR}\radius\dictionary.ericsson"
+File "${STAGING_DIR}\radius\dictionary.ericsson.ab"
+File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks"
+File "${STAGING_DIR}\radius\dictionary.extreme"
+File "${STAGING_DIR}\radius\dictionary.f5"
+File "${STAGING_DIR}\radius\dictionary.fdxtended"
+File "${STAGING_DIR}\radius\dictionary.fortinet"
+File "${STAGING_DIR}\radius\dictionary.foundry"
+File "${STAGING_DIR}\radius\dictionary.freedhcp"
+File "${STAGING_DIR}\radius\dictionary.freeradius"
+File "${STAGING_DIR}\radius\dictionary.freeradius.internal"
+File "${STAGING_DIR}\radius\dictionary.freeswitch"
+File "${STAGING_DIR}\radius\dictionary.gandalf"
+File "${STAGING_DIR}\radius\dictionary.garderos"
+File "${STAGING_DIR}\radius\dictionary.gemtek"
+File "${STAGING_DIR}\radius\dictionary.h3c"
+File "${STAGING_DIR}\radius\dictionary.hp"
+File "${STAGING_DIR}\radius\dictionary.huawei"
+File "${STAGING_DIR}\radius\dictionary.iana"
+File "${STAGING_DIR}\radius\dictionary.identity_engines"
+File "${STAGING_DIR}\radius\dictionary.iea"
+File "${STAGING_DIR}\radius\dictionary.infoblox"
+File "${STAGING_DIR}\radius\dictionary.infonet"
+File "${STAGING_DIR}\radius\dictionary.ipunplugged"
+File "${STAGING_DIR}\radius\dictionary.issanni"
+File "${STAGING_DIR}\radius\dictionary.itk"
+File "${STAGING_DIR}\radius\dictionary.jradius"
+File "${STAGING_DIR}\radius\dictionary.juniper"
+File "${STAGING_DIR}\radius\dictionary.karlnet"
+File "${STAGING_DIR}\radius\dictionary.kineto"
+File "${STAGING_DIR}\radius\dictionary.lancom"
+File "${STAGING_DIR}\radius\dictionary.livingston"
+File "${STAGING_DIR}\radius\dictionary.localweb"
+File "${STAGING_DIR}\radius\dictionary.lucent"
+File "${STAGING_DIR}\radius\dictionary.manzara"
+File "${STAGING_DIR}\radius\dictionary.meinberg"
+File "${STAGING_DIR}\radius\dictionary.meraki"
+File "${STAGING_DIR}\radius\dictionary.merit"
+File "${STAGING_DIR}\radius\dictionary.meru"
+File "${STAGING_DIR}\radius\dictionary.microsemi"
+File "${STAGING_DIR}\radius\dictionary.microsoft"
+File "${STAGING_DIR}\radius\dictionary.mikrotik"
+File "${STAGING_DIR}\radius\dictionary.motorola"
+File "${STAGING_DIR}\radius\dictionary.motorola.wimax"
+File "${STAGING_DIR}\radius\dictionary.navini"
+File "${STAGING_DIR}\radius\dictionary.netscreen"
+File "${STAGING_DIR}\radius\dictionary.networkphysics"
+File "${STAGING_DIR}\radius\dictionary.nexans"
+File "${STAGING_DIR}\radius\dictionary.nokia"
+File "${STAGING_DIR}\radius\dictionary.nokia.conflict"
+File "${STAGING_DIR}\radius\dictionary.nomadix"
+File "${STAGING_DIR}\radius\dictionary.nortel"
+File "${STAGING_DIR}\radius\dictionary.ntua"
+File "${STAGING_DIR}\radius\dictionary.openser"
+File "${STAGING_DIR}\radius\dictionary.packeteer"
+File "${STAGING_DIR}\radius\dictionary.paloalto"
+File "${STAGING_DIR}\radius\dictionary.patton"
+File "${STAGING_DIR}\radius\dictionary.perle"
+File "${STAGING_DIR}\radius\dictionary.propel"
+File "${STAGING_DIR}\radius\dictionary.prosoft"
+File "${STAGING_DIR}\radius\dictionary.proxim"
+File "${STAGING_DIR}\radius\dictionary.purewave"
+File "${STAGING_DIR}\radius\dictionary.quiconnect"
+File "${STAGING_DIR}\radius\dictionary.quintum"
+File "${STAGING_DIR}\radius\dictionary.redcreek"
+File "${STAGING_DIR}\radius\dictionary.rfc2865"
+File "${STAGING_DIR}\radius\dictionary.rfc2866"
+File "${STAGING_DIR}\radius\dictionary.rfc2867"
+File "${STAGING_DIR}\radius\dictionary.rfc2868"
+File "${STAGING_DIR}\radius\dictionary.rfc2869"
+File "${STAGING_DIR}\radius\dictionary.rfc3162"
+File "${STAGING_DIR}\radius\dictionary.rfc3576"
+File "${STAGING_DIR}\radius\dictionary.rfc3580"
+File "${STAGING_DIR}\radius\dictionary.rfc4072"
+File "${STAGING_DIR}\radius\dictionary.rfc4372"
+File "${STAGING_DIR}\radius\dictionary.rfc4603"
+File "${STAGING_DIR}\radius\dictionary.rfc4675"
+File "${STAGING_DIR}\radius\dictionary.rfc4679"
+File "${STAGING_DIR}\radius\dictionary.rfc4818"
+File "${STAGING_DIR}\radius\dictionary.rfc4849"
+File "${STAGING_DIR}\radius\dictionary.rfc5090"
+File "${STAGING_DIR}\radius\dictionary.rfc5176"
+File "${STAGING_DIR}\radius\dictionary.rfc5447"
+File "${STAGING_DIR}\radius\dictionary.rfc5580"
+File "${STAGING_DIR}\radius\dictionary.rfc5607"
+File "${STAGING_DIR}\radius\dictionary.rfc5904"
+File "${STAGING_DIR}\radius\dictionary.rfc6519"
+File "${STAGING_DIR}\radius\dictionary.rfc6572"
+File "${STAGING_DIR}\radius\dictionary.rfc6677"
+File "${STAGING_DIR}\radius\dictionary.rfc6911"
+File "${STAGING_DIR}\radius\dictionary.rfc6929"
+File "${STAGING_DIR}\radius\dictionary.rfc6930"
+File "${STAGING_DIR}\radius\dictionary.rfc7055"
+File "${STAGING_DIR}\radius\dictionary.rfc7155"
+File "${STAGING_DIR}\radius\dictionary.rfc7268"
+File "${STAGING_DIR}\radius\dictionary.rfc7499"
+File "${STAGING_DIR}\radius\dictionary.rfc7930"
+File "${STAGING_DIR}\radius\dictionary.riverbed"
+File "${STAGING_DIR}\radius\dictionary.riverstone"
+File "${STAGING_DIR}\radius\dictionary.roaringpenguin"
+File "${STAGING_DIR}\radius\dictionary.ruckus"
+File "${STAGING_DIR}\radius\dictionary.ruggedcom"
+File "${STAGING_DIR}\radius\dictionary.sangoma"
+File "${STAGING_DIR}\radius\dictionary.sg"
+File "${STAGING_DIR}\radius\dictionary.shasta"
+File "${STAGING_DIR}\radius\dictionary.shiva"
+File "${STAGING_DIR}\radius\dictionary.siemens"
+File "${STAGING_DIR}\radius\dictionary.slipstream"
+File "${STAGING_DIR}\radius\dictionary.sofaware"
+File "${STAGING_DIR}\radius\dictionary.sonicwall"
+File "${STAGING_DIR}\radius\dictionary.springtide"
+File "${STAGING_DIR}\radius\dictionary.starent"
+File "${STAGING_DIR}\radius\dictionary.starent.vsa1"
+File "${STAGING_DIR}\radius\dictionary.surfnet"
+File "${STAGING_DIR}\radius\dictionary.symbol"
+File "${STAGING_DIR}\radius\dictionary.t_systems_nova"
+File "${STAGING_DIR}\radius\dictionary.telebit"
+File "${STAGING_DIR}\radius\dictionary.telkom"
+File "${STAGING_DIR}\radius\dictionary.terena"
+File "${STAGING_DIR}\radius\dictionary.trapeze"
+File "${STAGING_DIR}\radius\dictionary.travelping"
+File "${STAGING_DIR}\radius\dictionary.tropos"
+File "${STAGING_DIR}\radius\dictionary.ukerna"
+File "${STAGING_DIR}\radius\dictionary.unisphere"
+File "${STAGING_DIR}\radius\dictionary.unix"
+File "${STAGING_DIR}\radius\dictionary.usr"
+File "${STAGING_DIR}\radius\dictionary.utstarcom"
+File "${STAGING_DIR}\radius\dictionary.valemount"
+File "${STAGING_DIR}\radius\dictionary.versanet"
+File "${STAGING_DIR}\radius\dictionary.verizon"
+File "${STAGING_DIR}\radius\dictionary.vqp"
+File "${STAGING_DIR}\radius\dictionary.walabi"
+File "${STAGING_DIR}\radius\dictionary.waverider"
+File "${STAGING_DIR}\radius\dictionary.wichorus"
+File "${STAGING_DIR}\radius\dictionary.wimax"
+File "${STAGING_DIR}\radius\dictionary.wimax.alvarion"
+File "${STAGING_DIR}\radius\dictionary.wimax.wichorus"
+File "${STAGING_DIR}\radius\dictionary.wispr"
+File "${STAGING_DIR}\radius\dictionary.xedia"
+File "${STAGING_DIR}\radius\dictionary.xylan"
+File "${STAGING_DIR}\radius\dictionary.yubico"
+File "${STAGING_DIR}\radius\dictionary.zeus"
+File "${STAGING_DIR}\radius\dictionary.zte"
+File "${STAGING_DIR}\radius\dictionary.zyxel"
+!include "custom_radius_dict.txt"
+SetOutPath $INSTDIR
+
+;
+; install the dtds in the dtds subdirectory
+;
+SetOutPath $INSTDIR\dtds
+File "${STAGING_DIR}\dtds\dc.dtd"
+File "${STAGING_DIR}\dtds\itunes.dtd"
+File "${STAGING_DIR}\dtds\mscml.dtd"
+File "${STAGING_DIR}\dtds\pocsettings.dtd"
+File "${STAGING_DIR}\dtds\presence.dtd"
+File "${STAGING_DIR}\dtds\reginfo.dtd"
+File "${STAGING_DIR}\dtds\rlmi.dtd"
+File "${STAGING_DIR}\dtds\rss.dtd"
+File "${STAGING_DIR}\dtds\smil.dtd"
+File "${STAGING_DIR}\dtds\xcap-caps.dtd"
+File "${STAGING_DIR}\dtds\xcap-error.dtd"
+File "${STAGING_DIR}\dtds\watcherinfo.dtd"
+SetOutPath $INSTDIR
+
+; Create the extcap directory
+CreateDirectory $INSTDIR\extcap
+
+;
+; install the protobuf .proto definitions in the protobuf subdirectory
+;
+SetOutPath $INSTDIR\protobuf
+File "${STAGING_DIR}\protobuf\*.proto"
+
+; Install the TPNCP DAT file in the "tpncp" subdirectory
+; of the installation directory.
+SetOutPath $INSTDIR\tpncp
+File "${STAGING_DIR}\tpncp\tpncp.dat"
+
+;
+; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
+;
+SetOutPath $INSTDIR\wimaxasncp
+File "${STAGING_DIR}\wimaxasncp\dictionary.xml"
+File "${STAGING_DIR}\wimaxasncp\dictionary.dtd"
+SetOutPath $INSTDIR
+
+; Write the installation path into the registry for InstallDirRegKey
+WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir "$INSTDIR"
+
+; Write the uninstall keys for Windows
+; https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs
+; https://docs.microsoft.com/en-us/previous-versions/ms954376(v=msdn.10)
+; https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
+!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
+
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}"
+!ifdef QT_DIR
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH},0"
+!endif
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Wireshark developer community, https://www.wireshark.org"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org"
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html"
+
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${MAJOR_VERSION}
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${MINOR_VERSION}
+
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"'
+WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S'
+
+; To quote https://web.archive.org/web/20150911221413/http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf:
+; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
+Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk"
+
+; Create file extensions if the Associated Tasks page check box
+; is checked.
+${If} $FILE_ASSOCIATE_STATE == ${BST_CHECKED}
+WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
+WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH}" "%1"'
+WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH}",1'
+; We refresh the icon cache down in -Finally.
+Call Associate
+; If you add something here be sure to sync it with the uninstall section and the
+; AdditionalTasks page
+${Endif}
+
+; if running as a silent installer, don't try to install npcap
+IfSilent SecRequired_skip_Npcap
+
+; Install Npcap (depending on npcap page setting)
+ReadINIStr $0 "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State"
+StrCmp $0 "0" SecRequired_skip_Npcap
+SetOutPath $INSTDIR
+File "${EXTRA_INSTALLER_DIR}\npcap-${NPCAP_PACKAGE_VERSION}.exe"
+ExecWait '"$INSTDIR\npcap-${NPCAP_PACKAGE_VERSION}.exe" /winpcap_mode=no /loopback_support=no' $0
+DetailPrint "Npcap installer returned $0"
+SecRequired_skip_Npcap:
+
+; If running as a silent installer, don't try to install USBPcap
+IfSilent SecRequired_skip_USBPcap
+
+ReadINIStr $0 "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State"
+StrCmp $0 "0" SecRequired_skip_USBPcap
+SetOutPath $INSTDIR
+File "${EXTRA_INSTALLER_DIR}\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"
+ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"' $0
+DetailPrint "USBPcap installer returned $0"
+${If} $0 == "0"
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+ ${EndIf}
+ ReadRegStr $USBPCAP_UNINSTALL HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
+ ${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+ ${EndIf}
+ ${StrRep} $0 '$USBPCAP_UNINSTALL' 'Uninstall.exe' 'USBPcapCMD.exe'
+ ${StrRep} $1 '$0' '"' ''
+ CopyFiles /SILENT $1 $INSTDIR\extcap
+ SetRebootFlag true
+${EndIf}
+SecRequired_skip_USBPcap:
+
+; If no user profile exists for Wireshark but for Ethereal, copy it over
+SetShellVarContext current
+IfFileExists $APPDATA\Wireshark profile_done
+IfFileExists $APPDATA\Ethereal 0 profile_done
+;MessageBox MB_YESNO "This seems to be the first time you use Wireshark. Copy over the personal settings from Ethereal?" /SD IDYES IDNO profile_done
+CreateDirectory $APPDATA\Wireshark
+CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
+profile_done:
+SetShellVarContext all
+
+SectionEnd ; "Required"
+
+!ifdef QT_DIR
+Section "${PROGRAM_NAME}" SecWiresharkQt
+;-------------------------------------------
+; by default, Wireshark.exe is installed
+SetOutPath $INSTDIR
+File "${QT_DIR}\${PROGRAM_NAME_PATH}"
+; Write an entry for ShellExecute
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "" '$INSTDIR\${PROGRAM_NAME_PATH}'
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "Path" '$INSTDIR'
+
+!ifndef SKIP_NSIS_QT_DLLS
+!include wireshark-qt-manifest.nsh
+!endif
+
+${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations"
+SetOutPath $INSTDIR
+!ifdef TRANSLATIONS_FOLDER
+ ; Starting from Qt 5.5, *.qm files are put in a translations subfolder
+ File /r "${QT_DIR}\translations"
+!else
+ File "${QT_DIR}\*.qm"
+!endif
+
+; Is the Start Menu check box checked?
+${If} $START_MENU_STATE == ${BST_CHECKED}
+ CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
+${Endif}
+
+${If} $DESKTOP_ICON_STATE == ${BST_CHECKED}
+ CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
+${Endif}
+
+SectionEnd ; "SecWiresharkQt"
+!endif
+
+
+Section "TShark" SecTShark
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\tshark.exe"
+File "${STAGING_DIR}\tshark.html"
+SectionEnd
+
+Section "-Plugins & Extensions"
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g711.dll"
+!ifdef SPANDSP_FOUND
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g722.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g726.dll"
+!endif
+!ifdef BCG729_FOUND
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g729.dll"
+!endif
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\l16mono.dll"
+!ifdef SBC_FOUND
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\sbc.dll"
+!endif
+!ifdef ILBC_FOUND
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\ilbc.dll"
+!endif
+!ifdef OPUS_FOUND
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\opus_dec.dll"
+!endif
+
+; This should be a function or macro
+SetOutPath '$INSTDIR\profiles\Bluetooth'
+File "${STAGING_DIR}\profiles\Bluetooth\colorfilters"
+File "${STAGING_DIR}\profiles\Bluetooth\preferences"
+SetOutPath '$INSTDIR\profiles\Classic'
+File "${STAGING_DIR}\profiles\Classic\colorfilters"
+SetOutPath '$INSTDIR\profiles\No Reassembly'
+File "${STAGING_DIR}\profiles\No Reassembly\preferences"
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ethercat.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\gryphon.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\irda.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\opcua.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\profinet.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\unistim.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimax.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxasncp.dll"
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxmacphy.dll"
+!include "custom_plugins.txt"
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap\usbdump.dll"
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\mate.dll"
+
+!ifdef SMI_DIR
+SetOutPath '$INSTDIR\snmp\mibs'
+File "${SMI_DIR}\share\mibs\iana\*"
+File "${SMI_DIR}\share\mibs\ietf\*"
+File "${SMI_DIR}\share\mibs\irtf\*"
+File "${SMI_DIR}\share\mibs\tubs\*"
+File "${SMI_DIR}\share\pibs\*"
+File "${SMI_DIR}\share\yang\*.yang"
+!include "custom_mibs.txt"
+!endif
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\transum.dll"
+
+SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
+File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\stats_tree.dll"
+
+SectionEnd ; "Plugins / Extensions"
+
+Section "-Additional command line tools"
+
+SetOutPath $INSTDIR
+File "${STAGING_DIR}\capinfos.exe"
+File "${STAGING_DIR}\capinfos.html"
+
+File "${STAGING_DIR}\captype.exe"
+File "${STAGING_DIR}\captype.html"
+
+File "${STAGING_DIR}\editcap.exe"
+File "${STAGING_DIR}\editcap.html"
+
+File "${STAGING_DIR}\mergecap.exe"
+File "${STAGING_DIR}\mergecap.html"
+
+!ifdef MMDBRESOLVE_EXE
+File "${STAGING_DIR}\mmdbresolve.html"
+File "${STAGING_DIR}\mmdbresolve.exe"
+!endif
+
+File "${STAGING_DIR}\randpkt.exe"
+File "${STAGING_DIR}\randpkt.html"
+
+File "${STAGING_DIR}\rawshark.exe"
+File "${STAGING_DIR}\rawshark.html"
+
+File "${STAGING_DIR}\reordercap.exe"
+File "${STAGING_DIR}\reordercap.html"
+
+File "${STAGING_DIR}\sharkd.exe"
+;File "${STAGING_DIR}\sharkd.html"
+
+File "${STAGING_DIR}\text2pcap.exe"
+File "${STAGING_DIR}\text2pcap.html"
+
+SectionEnd ; "Tools"
+
+SectionGroup /e "External capture tools (extcap)" SecExtcapGroup
+
+Section /o "Androiddump" SecAndroiddump
+;-------------------------------------------
+ !insertmacro InstallExtcap "androiddump"
+SectionEnd
+!insertmacro CheckExtrasFlag "androiddump"
+
+!ifdef BUILD_etwdump
+Section "Etwdump" SecEtwdump
+;-------------------------------------------
+ !insertmacro InstallExtcap "Etwdump"
+SectionEnd
+!insertmacro CheckExtrasFlag "Etwdump"
+!endif
+
+Section /o "Randpktdump" SecRandpktdump
+;-------------------------------------------
+ !insertmacro InstallExtcap "randpktdump"
+SectionEnd
+!insertmacro CheckExtrasFlag "randpktdump"
+
+!ifdef LIBSSH_FOUND
+Section /o "Sshdump, Ciscodump, and Wifidump" SecSshdump
+;-------------------------------------------
+ !insertmacro InstallExtcap "sshdump"
+ !insertmacro InstallExtcap "ciscodump"
+ !insertmacro InstallExtcap "wifidump"
+SectionEnd
+!insertmacro CheckExtrasFlag "sshdump"
+!insertmacro CheckExtrasFlag "ciscodump"
+!insertmacro CheckExtrasFlag "wifidump"
+!endif
+
+Section /o "UDPdump" SecUDPdump
+;-------------------------------------------
+ !insertmacro InstallExtcap "udpdump"
+SectionEnd
+!insertmacro CheckExtrasFlag "udpdump"
+
+SectionGroupEnd ; "External Capture (extcap)"
+
+Section "-Clear Partial Selected"
+!insertmacro ClearSectionFlag ${SecExtcapGroup} ${SF_PSELECTED}
+SectionEnd
+
+!ifdef DOCBOOK_DIR
+Section "-Documentation"
+
+SetOutPath "$INSTDIR\Wireshark User's Guide"
+File /r "${DOCBOOK_DIR}\wsug_html_chunked\*.*"
+
+SetOutPath $INSTDIR
+File "${DOCBOOK_DIR}\faq.html"
+SectionEnd
+!endif
+
+Section "-Finally"
+
+!insertmacro UpdateIcons
+
+; Compute and write the installation directory size
+${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
+IntFmt $0 "0x%08X" $0
+WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0"
+
+SectionEnd
+
+; ============================================================================
+; Section macros
+; ============================================================================
+!include "Sections.nsh"
+
+; ============================================================================
+; Uninstall page configuration
+; ============================================================================
+ShowUninstDetails show
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+Function un.Disassociate
+ Push $R0
+!insertmacro PushFileExtensions
+
+ Pop $EXTENSION
+ ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
+ ReadRegStr $R0 HKCR $EXTENSION ""
+ StrCmp $R0 ${WIRESHARK_ASSOC} un.Disassociate.doDeregister
+ Goto un.Disassociate.end
+un.Disassociate.doDeregister:
+ ; The extension is associated with Wireshark so, we must destroy this!
+ DeleteRegKey HKCR $EXTENSION
+ DetailPrint "Deregistered file type: $EXTENSION"
+un.Disassociate.end:
+ Pop $EXTENSION
+ ${Loop}
+
+ Pop $R0
+FunctionEnd
+
+Section "-Required"
+SectionEnd
+
+!define EXECUTABLE_MARKER "EXECUTABLE_MARKER"
+Var EXECUTABLE
+
+Section /o "Un.USBPcap" un.SecUSBPcap
+;-------------------------------------------
+SectionIn 2
+${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+${EndIf}
+ReadRegStr $1 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
+${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+${EndIf}
+${If} $1 != ""
+ ${UnStrRep} $2 '$1' '\Uninstall.exe' ''
+ ${UnStrRep} $3 '$2' '"' ''
+ ExecWait '$1 _?=$3' $0
+ DetailPrint "USBPcap uninstaller returned $0"
+ ${If} $0 == "0"
+ Delete "$3\Uninstall.exe"
+ Delete "$INSTDIR\extcap\USBPcapCMD.exe"
+ ${EndIf}
+${EndIf}
+ClearErrors
+SectionEnd
+
+
+Section "Uninstall" un.SecUinstall
+;-------------------------------------------
+;
+; UnInstall for every user
+;
+SectionIn 1 2
+SetShellVarContext all
+
+!insertmacro IsWiresharkRunning
+
+Push "${EXECUTABLE_MARKER}"
+Push "${PROGRAM_NAME}"
+Push "capinfos"
+Push "captype"
+Push "dftest"
+Push "dumpcap"
+Push "editcap"
+Push "mergecap"
+Push "randpkt"
+Push "rawshark"
+Push "reordercap"
+Push "sharkd"
+Push "text2pcap"
+Push "tshark"
+
+!ifdef MMDBRESOLVE_EXE
+Push "mmdbresolve"
+!endif
+
+Pop $EXECUTABLE
+${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER}
+
+ ; IsWiresharkRunning should make sure everything is closed down so we *shouldn't* run
+ ; into any problems here.
+ Delete "$INSTDIR\$EXECUTABLE.exe"
+ IfErrors 0 deletionSuccess
+ MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0
+ Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process."
+
+deletionSuccess:
+ Pop $EXECUTABLE
+
+${Loop}
+
+
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe"
+
+Call un.Disassociate
+
+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\audio\*.*"
+Delete "$INSTDIR\bearer\*.*"
+Delete "$INSTDIR\diameter\*.*"
+Delete "$INSTDIR\extcap\androiddump.*"
+Delete "$INSTDIR\extcap\ciscodump.*"
+Delete "$INSTDIR\extcap\etwdump.*"
+Delete "$INSTDIR\extcap\randpktdump.*"
+Delete "$INSTDIR\extcap\sshdump.*"
+Delete "$INSTDIR\extcap\udpdump.*"
+Delete "$INSTDIR\extcap\wifidump.*"
+Delete "$INSTDIR\gpl-2.0-standalone.html"
+Delete "$INSTDIR\Acknowledgements.md"
+Delete "$INSTDIR\generic\*.*"
+Delete "$INSTDIR\help\*.*"
+Delete "$INSTDIR\iconengines\*.*"
+Delete "$INSTDIR\imageformats\*.*"
+Delete "$INSTDIR\mediaservice\*.*"
+Delete "$INSTDIR\multimedia\*.*"
+Delete "$INSTDIR\networkinformation\*.*"
+Delete "$INSTDIR\platforms\*.*"
+Delete "$INSTDIR\playlistformats\*.*"
+Delete "$INSTDIR\printsupport\*.*"
+Delete "$INSTDIR\share\glib-2.0\schemas\*.*"
+Delete "$INSTDIR\snmp\*.*"
+Delete "$INSTDIR\snmp\mibs\*.*"
+Delete "$INSTDIR\styles\translations\*.*"
+Delete "$INSTDIR\styles\*.*"
+Delete "$INSTDIR\protobuf\*.*"
+Delete "$INSTDIR\tls\*.*"
+Delete "$INSTDIR\tpncp\*.*"
+Delete "$INSTDIR\translations\*.*"
+Delete "$INSTDIR\ui\*.*"
+Delete "$INSTDIR\wimaxasncp\*.*"
+Delete "$INSTDIR\ws.css"
+; previous versions installed these files
+Delete "$INSTDIR\*.manifest"
+; previous versions installed this file
+Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
+Delete "$INSTDIR\README*"
+Delete "$INSTDIR\NEWS.txt"
+Delete "$INSTDIR\manuf"
+Delete "$INSTDIR\wka"
+Delete "$INSTDIR\services"
+Delete "$INSTDIR\pdml2html.xsl"
+Delete "$INSTDIR\pcrepattern.3.txt"
+Delete "$INSTDIR\user-guide.chm"
+Delete "$INSTDIR\example_snmp_users_file"
+Delete "$INSTDIR\ipmap.html"
+Delete "$INSTDIR\radius\*.*"
+Delete "$INSTDIR\dtds\*.*"
+Delete "$INSTDIR\browser_sslkeylog.lua"
+Delete "$INSTDIR\console.lua"
+Delete "$INSTDIR\dtd_gen.lua"
+Delete "$INSTDIR\init.lua"
+Delete "$INSTDIR\release-notes.html"
+
+RMDir "$INSTDIR\accessible"
+RMDir "$INSTDIR\audio"
+RMDir "$INSTDIR\bearer"
+RMDir "$INSTDIR\extcap"
+RMDir "$INSTDIR\iconengines"
+RMDir "$INSTDIR\imageformats"
+RMDir "$INSTDIR\mediaservice"
+RMDir "$INSTDIR\multimedia"
+RMDir "$INSTDIR\networkinformation"
+RMDir "$INSTDIR\platforms"
+RMDir "$INSTDIR\playlistformats"
+RMDir "$INSTDIR\printsupport"
+RMDir "$INSTDIR\styles\translations"
+RMDir "$INSTDIR\styles"
+RMDir "$SMPROGRAMS\${PROGRAM_NAME}"
+RMDir "$INSTDIR\help"
+RMDir "$INSTDIR\generic"
+RMDir /r "$INSTDIR\Wireshark User's Guide"
+RMDir "$INSTDIR\diameter"
+RMDir "$INSTDIR\snmp\mibs"
+RMDir "$INSTDIR\snmp"
+RMDir "$INSTDIR\radius"
+RMDir "$INSTDIR\dtds"
+RMDir "$INSTDIR\protobuf"
+RMDir "$INSTDIR\tls"
+RMDir "$INSTDIR\tpncp"
+RMDir "$INSTDIR\translations"
+RMDir "$INSTDIR\ui"
+RMDir "$INSTDIR\wimaxasncp"
+RMDir "$INSTDIR"
+
+SectionEnd ; "Uinstall"
+
+Section "Un.Plugins" un.SecPlugins
+;-------------------------------------------
+SectionIn 1 2
+;Delete "$INSTDIR\plugins\${VERSION}\*.*"
+;Delete "$INSTDIR\plugins\*.*"
+;RMDir "$INSTDIR\plugins\${VERSION}"
+;RMDir "$INSTDIR\plugins"
+RMDir /r "$INSTDIR\plugins"
+SectionEnd
+
+Section "Un.Global Profiles" un.SecProfiles
+;-------------------------------------------
+SectionIn 1 2
+RMDir /r "$INSTDIR\profiles"
+SectionEnd
+
+Section "Un.Global Settings" un.SecGlobalSettings
+;-------------------------------------------
+SectionIn 1 2
+Delete "$INSTDIR\cfilters"
+Delete "$INSTDIR\colorfilters"
+Delete "$INSTDIR\dfilters"
+Delete "$INSTDIR\enterprises.tsv"
+Delete "$INSTDIR\smi_modules"
+RMDir "$INSTDIR"
+SectionEnd
+
+Section /o "Un.Personal Settings" un.SecPersonalSettings
+;-------------------------------------------
+SectionIn 2
+SetShellVarContext current
+Delete "$APPDATA\${PROGRAM_NAME}\*.*"
+RMDir "$APPDATA\${PROGRAM_NAME}"
+DeleteRegKey HKCU "Software\${PROGRAM_NAME}"
+SectionEnd
+
+;VAR un.NPCAP_UNINSTALL
+
+Section /o "Un.Npcap" un.SecNpcap
+;-------------------------------------------
+SectionIn 2
+ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "UninstallString"
+;IfErrors un.lbl_npcap_notinstalled ;if RegKey is unavailable, Npcap is not installed
+${If} $1 != ""
+ ;MessageBox MB_OK "Npcap $1" /SD IDOK
+ ExecWait '$1' $0
+ DetailPrint "Npcap uninstaller returned $0"
+ ;SetRebootFlag true
+${EndIf}
+;un.lbl_npcap_notinstalled:
+SectionEnd
+
+Section "-Un.Finally"
+;-------------------------------------------
+SectionIn 1 2
+
+!insertmacro UpdateIcons
+
+; this test must be done after all other things uninstalled (e.g. Global Settings)
+IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
+ MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist
+NoFinalErrorMsg:
+SectionEnd
+
+; Sign our installer and uninstaller during compilation.
+!ifdef ENABLE_SIGNED_NSIS
+!finalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the installer exe to be signed.
+!uninstfinalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the uninstaller exe to be signed.
+!endif
+
+; ============================================================================
+; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
+; ============================================================================
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+!ifdef QT_DIR
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkQt} "The main network protocol analyzer application."
+!endif
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer."
+
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecExtcapGroup} "External Capture Interfaces"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddump} "Provide capture interfaces from Android devices."
+ !ifdef BUILD_etwdump
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEtwdump} "Provide an interface to read Event Tracing for Windows (ETW) event trace (ETL)."
+ !endif
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdump} "Provide an interface to the random packet generator. (see also randpkt)"
+ !ifdef LIBSSH_FOUND
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSshdump} "Provide remote capture through SSH. (tcpdump, Cisco EPC, wifi)"
+ !endif
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecUDPdump} "Provide capture interface to receive UDP packets streamed from network devices."
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecNpcap} "Call Npcap's uninstall program."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUSBPcap} "Call USBPcap's uninstall program."
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
+
+; ============================================================================
+; Callback functions
+; ============================================================================
+!ifdef QT_DIR
+
+Var QT_SELECTED
+
+; Called from fnc_AdditionalTasksPage_Create via DisplayAdditionalTasksPage.
+Function InitAdditionalTasksPage
+ ; We've created the Additional tasks page. Update our control states
+ ; before they are shown.
+ ; We set XXX_STATE -> XxxCheckBox here and go the other direction below.
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
+ ${NSD_SetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
+
+ StrCpy $QT_SELECTED 0
+ ${If} ${SectionIsSelected} ${SecWiresharkQt}
+ StrCpy $QT_SELECTED 1
+ ${Endif}
+ EnableWindow $hCtl_AdditionalTasksPage_CreateShortcutsLabel $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_StartMenuCheckBox $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_DesktopIconCheckBox $QT_SELECTED
+
+ EnableWindow $hCtl_AdditionalTasksPage_ExtensionsLabel $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $QT_SELECTED
+ EnableWindow $hCtl_AdditionalTasksPage_FileExtensionsLabel $QT_SELECTED
+FunctionEnd
+
+Function LeaveAdditionalTasksPage
+ ; We're leaving the Additional tasks page. Get our control states
+ ; before they're destroyed.
+ ; We set XxxCheckBox -> XXX_STATE here and go the other direction above.
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
+ ${NSD_GetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
+FunctionEnd
+
+!endif ; QT_DIR
+
+Var NPCAP_NAME ; DisplayName from Npcap installation
+Var WINPCAP_NAME ; DisplayName from WinPcap installation
+Var NPCAP_DISPLAY_VERSION ; DisplayVersion from Npcap installation
+Var USBPCAP_NAME ; DisplayName from USBPcap installation
+
+Function myShowCallback
+
+ ClearErrors
+ ; detect if WinPcap should be installed
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Text" "Install Npcap ${NPCAP_PACKAGE_VERSION}"
+ ReadRegStr $NPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayName"
+ IfErrors 0 lbl_npcap_installed
+ ; check also if WinPcap is installed
+ ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
+ IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Neither of these are installed"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old Npcap or WinPcap versions)"
+ Goto lbl_npcap_done
+
+lbl_npcap_installed:
+ ReadRegStr $NPCAP_DISPLAY_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayVersion"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 1" "Text" "Currently installed Npcap version"
+ StrCmp $NPCAP_NAME "Npcap" 0 +3
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Npcap $NPCAP_DISPLAY_VERSION"
+ Goto +2
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$NPCAP_NAME"
+
+ ; Compare the installed build against the one we have.
+ StrCmp $NPCAP_DISPLAY_VERSION "" lbl_npcap_do_install ; Npcap wasn't installed improperly?
+ ${VersionConvert} $NPCAP_DISPLAY_VERSION "" $R0 ; 0.99-r7 -> 0.99.114.7
+ ${VersionConvert} "${NPCAP_PACKAGE_VERSION}" "" $R1
+ ${VersionCompare} $R0 $R1 $1
+ StrCmp $1 "2" lbl_npcap_do_install
+
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "0"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "If you wish to install Npcap, please uninstall $NPCAP_NAME manually first."
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Flags" "DISABLED"
+ Goto lbl_npcap_done
+
+lbl_winpcap_installed:
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1"
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME may be uninstalled first."
+ Goto lbl_npcap_done
+
+lbl_npcap_do_install:
+ ; seems to be an old version, install newer one
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1"
+ StrCmp $NPCAP_NAME "Npcap" 0 +3
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed Npcap $NPCAP_DISPLAY_VERSION will be uninstalled first."
+ Goto +2
+ WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $NPCAP_NAME will be uninstalled first."
+
+lbl_npcap_done:
+
+ ; detect if USBPcap should be installed
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_PACKAGE_VERSION}"
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+ ${EndIf}
+ ReadRegStr $USBPCAP_NAME HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "DisplayName"
+ ${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+ ${EndIf}
+ IfErrors 0 lbl_usbpcap_installed ;if RegKey is available, USBPcap is already installed
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "USBPcap is currently not installed"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old USBPcap versions)"
+ Goto lbl_usbpcap_done
+
+lbl_usbpcap_installed:
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "$USBPCAP_NAME"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" "0"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_PACKAGE_VERSION}, please uninstall $USBPCAP_NAME manually first."
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Flags" "DISABLED"
+ Goto lbl_usbpcap_done
+
+lbl_usbpcap_done:
+
+FunctionEnd