From 885addcfcee14671f29036919cc87e8f3b8cfde7 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 4 Feb 2024 17:33:34 +1000 Subject: [PATCH] Qt: Fix update cleanup on Windows --- src/duckstation-qt/qthost.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 7f5f738ed..a427450fc 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -111,6 +111,7 @@ static bool s_nogui_mode = false; static bool s_start_fullscreen_ui = false; static bool s_start_fullscreen_ui_fullscreen = false; static bool s_run_setup_wizard = false; +static bool s_cleanup_after_update = false; EmuThread* g_emu_thread; GDBServer* g_gdb_server; @@ -2089,9 +2090,7 @@ bool QtHost::ParseCommandLineParametersAndInitializeConfig(QApplication& app, } else if (CHECK_ARG("-updatecleanup")) { - if (AutoUpdaterDialog::isSupported()) - AutoUpdaterDialog::cleanupAfterUpdate(); - + s_cleanup_after_update = AutoUpdaterDialog::isSupported(); continue; } #ifdef ENABLE_RAINTEGRATION @@ -2214,6 +2213,10 @@ int main(int argc, char* argv[]) if (!QtHost::ParseCommandLineParametersAndInitializeConfig(app, autoboot)) return EXIT_FAILURE; + // Remove any previous-version remanants. + if (s_cleanup_after_update) + AutoUpdaterDialog::cleanupAfterUpdate(); + // Set theme before creating any windows. MainWindow::updateApplicationTheme();