From dd816a121829f8129dc70b70c25d83eed08e279a Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 8 Dec 2016 09:41:47 -0800 Subject: [PATCH] Update to WinSparkle 0.5.3. Update our WinSparkle package to 0.5.3. This fixes a file deletion bug. Note that WinSparkle now supports application shutdown callbacks, which should let us fix bugs 9687 and 12989. Bug: 13217 Change-Id: I4b5f325c6dc251ce167f7bd344bbf3ca5ad3fe14 Reviewed-on: https://code.wireshark.org/review/19230 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- cmake/modules/FindWinSparkle.cmake | 12 +++++++++--- tools/win-setup.ps1 | 9 +++++---- ui/software_update.c | 9 +++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/cmake/modules/FindWinSparkle.cmake b/cmake/modules/FindWinSparkle.cmake index 54c01d8903..6395102055 100644 --- a/cmake/modules/FindWinSparkle.cmake +++ b/cmake/modules/FindWinSparkle.cmake @@ -17,9 +17,15 @@ ENDIF (WINSPARKLE_INCLUDE_DIRS) INCLUDE(FindWSWinLibs) FindWSWinLibs("WinSparkle.*" "WINSPARKLE_HINTS") -FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}" ) +# The 64-bit wpcap.lib is under /x64/Release +set ( _RELEASE_SUBDIR "Release" ) +if( WIN32 AND "${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64" ) + set ( _RELEASE_SUBDIR "x64/Release" ) +endif() -FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}" ) +FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}/include" ) + +FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}/${_RELEASE_SUBDIR}" ) # handle the QUIETLY and REQUIRED arguments and set WINSPARKLE_FOUND to TRUE if # all listed variables are TRUE @@ -30,7 +36,7 @@ IF(WINSPARKLE_FOUND) SET(WINSPARKLE_LIBRARIES ${WINSPARKLE_LIBRARY} ) SET(WINSPARKLE_INCLUDE_DIRS ${WINSPARKLE_INCLUDE_DIR} ) if (WIN32) - set ( WINSPARKLE_DLL_DIR "${WINSPARKLE_HINTS}" + set ( WINSPARKLE_DLL_DIR "${WINSPARKLE_HINTS}/${_RELEASE_SUBDIR}" CACHE PATH "Path to the WinSparkle DLL" ) file( GLOB _winsparkle_dll RELATIVE "${WINSPARKLE_DLL_DIR}" diff --git a/tools/win-setup.ps1 b/tools/win-setup.ps1 index 9432864887..1215b92146 100644 --- a/tools/win-setup.ps1 +++ b/tools/win-setup.ps1 @@ -99,8 +99,8 @@ Param( # trouble instead of trying to catch exceptions everywhere. $ErrorActionPreference = "Stop" -$Win64CurrentTag = "2016-11-29" -$Win32CurrentTag = "2016-11-29" +$Win64CurrentTag = "2016-12-12" +$Win32CurrentTag = "2016-12-12" # Archive file / subdir. $Win64Archives = @{ @@ -121,7 +121,7 @@ $Win64Archives = @{ "snappy-1.1.3-win64ws.zip" = ""; "spandsp-0.0.6-win64ws.zip" = ""; "upx303w.zip" = ""; - "WinSparkle-0.3-44-g2c8d9d3-win64ws.zip" = ""; + "WinSparkle-0.5.3.zip" = ""; "WpdPack_4_1_2.zip" = ""; "zlib-1.2.8-ws.zip" = ""; } @@ -144,7 +144,7 @@ $Win32Archives = @{ "snappy-1.1.3-win32ws.zip" = ""; "spandsp-0.0.6-win32ws.zip" = ""; "upx303w.zip" = ""; - "WinSparkle-0.3-44-g2c8d9d3-win32ws.zip" = ""; + "WinSparkle-0.5.3.zip" = ""; "WpdPack_4_1_2.zip" = ""; "zlib-1.2.8-ws.zip" = ""; } @@ -202,6 +202,7 @@ $CleanupItems = @( "AirPcap_Devpack_4_1_0_1622" "GeoIP-1.*-win??ws" "WinSparkle-0.3-44-g2c8d9d3-win??ws" + "WinSparkle-0.5.?" "WpdPack" "current-tag.txt" ) diff --git a/ui/software_update.c b/ui/software_update.c index ffe2b2e712..a33dbd5b47 100644 --- a/ui/software_update.c +++ b/ui/software_update.c @@ -94,10 +94,19 @@ void software_update_init(void) { const char *update_url = get_appcast_update_url(prefs.gui_update_channel); + /* + * According to the WinSparkle 0.5 documentation these must be called + * once, before win_sparkle_init. We can't update them dynamically when + * our preferences change. + */ win_sparkle_set_registry_path("Software\\Wireshark\\WinSparkle Settings"); win_sparkle_set_appcast_url(update_url); win_sparkle_set_automatic_check_for_updates(prefs.gui_update_enabled ? 1 : 0); win_sparkle_set_update_check_interval(prefs.gui_update_interval); + /* Todo: Fix bugs 9687 and 12989. + * win_sparkle_set_can_shutdown_callback(...); + * win_sparkle_set_shutdown_request_callback(...); + */ win_sparkle_init(); }