Qt: Fix update cleanup on Windows

This commit is contained in:
Stenzek 2024-02-04 17:33:34 +10:00
parent 3f0aa6b559
commit 885addcfce
No known key found for this signature in database

View file

@ -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();