Fix running of updates on Windows XP

This commit is contained in:
Andy Vandijck 2025-06-23 14:46:42 +02:00
parent c31499ca10
commit 8a1f4db62f
1 changed files with 8 additions and 3 deletions

View File

@ -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<func_win_sparkle_init>(winsparkle_dll->GetSymbol("win_sparkle_init"));