From 8a1f4db62f55ad32843d77125d12c82f344809a0 Mon Sep 17 00:00:00 2001 From: Andy Vandijck Date: Mon, 23 Jun 2025 14:46:42 +0200 Subject: [PATCH] Fix running of updates on Windows XP --- src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp index 8c55c257..ca2f01ec 100644 --- a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp +++ b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp @@ -20,9 +20,13 @@ WinSparkleDllWrapper *WinSparkleDllWrapper::GetInstance() WinSparkleDllWrapper::WinSparkleDllWrapper() { - wxFile temp_file; - temp_file_name = wxFileName::CreateTempFileName("winsparkle", &temp_file); - + wchar_t temp_file_path_w[MAX_PATH + 1]; + GetTempPathW(MAX_PATH, temp_file_path_w); + wxString temp_file_path = wxString(temp_file_path_w); + wchar_t temp_file_name_w[MAX_PATH + 1]; + GetLongPathNameW(temp_file_path.wc_str(), temp_file_name_w, MAX_PATH + 1); + temp_file_name = wxString(temp_file_name_w) + "WinSparkle.dll"; + wxFile temp_file = wxFile(temp_file_name, wxFile::write); HRSRC res = FindResource(wxGetInstance(), MAKEINTRESOURCE(WINSPARKLE_DLL_RC), RT_RCDATA); if (!res) @@ -41,6 +45,7 @@ WinSparkleDllWrapper::WinSparkleDllWrapper() temp_file.Close(); + winsparkle_dll = new wxDynamicLibrary(temp_file_name, wxDL_NOW | wxDL_VERBATIM); winsparkle_init = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_init"));