From 94b586deb536cf0ba0bd74f29a9c3322049040b5 Mon Sep 17 00:00:00 2001 From: copilot Date: Thu, 12 Nov 2026 13:44:27 +0100 Subject: [PATCH] Fix Windows portable updater for MSVC. Use const SDL_GetBasePath and include shellapi.h so ShellExecuteA compiles under WIN32_LEAN_AND_MEAN. Co-authored-by: Cursor --- src/WindowsPortableUpdater.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/WindowsPortableUpdater.cpp b/src/WindowsPortableUpdater.cpp index 90318a0..ac4ea01 100644 --- a/src/WindowsPortableUpdater.cpp +++ b/src/WindowsPortableUpdater.cpp @@ -9,6 +9,7 @@ #ifdef _WIN32 #include #include +#include #endif namespace WindowsPortableUpdater { @@ -86,11 +87,11 @@ bool apply_zip_and_restart(const std::string& zipBytes) { #ifdef _WIN32 namespace fs = std::filesystem; try { - char* basePath = SDL_GetBasePath(); + const char* basePath = SDL_GetBasePath(); if(!basePath) return false; fs::path appDir = fs::path(basePath); - SDL_free(basePath); + SDL_free(const_cast(basePath)); fs::path tempRoot = fs::temp_directory_path() / "infinipaint-update"; fs::create_directories(tempRoot);