diff --git a/CMakeLists.txt b/CMakeLists.txt index 161143e..fe09068 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.25 FATAL_ERROR) # Create project project(sdk_launcher DESCRIPTION "A minimal SDK launcher for Strata Source engine games" - VERSION "0.4.1" + VERSION "0.4.2" HOMEPAGE_URL "https://github.com/StrataSource/sdk-launcher") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -103,6 +103,7 @@ function(sdk_launcher_configure_target TARGET) endfunction() # miniz +set(BUILD_NO_STDIO ON CACHE INTERNAL "" FORCE) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/miniz") # Qt diff --git a/ext/miniz b/ext/miniz index 1ff82be..2fa13ca 160000 --- a/ext/miniz +++ b/ext/miniz @@ -1 +1 @@ -Subproject commit 1ff82be7d67f5c2f8b5497f538eea247861e0717 +Subproject commit 2fa13ca8a3cf196345001c9fe17bf42ee32c00f9 diff --git a/src/Window.cpp b/src/Window.cpp index 211c73c..ac6ca59 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -1,5 +1,6 @@ #include "Window.h" +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include "Config.h" @@ -306,16 +306,21 @@ void Window::loadGameConfig(const QString& path) { button->setToolTip(action + " " + entry.arguments.join(" ")); QObject::connect(button, &LaunchButton::doubleClicked, this, [this, action, args=entry.arguments, cwd=rootPath] { auto* process = new QProcess; - QObject::connect(process, &QProcess::errorOccurred, this, [this](QProcess::ProcessError code) { + QObject::connect(process, &QProcess::errorOccurred, this, [this, timeStart = std::chrono::steady_clock::now()](QProcess::ProcessError code) { QString error; switch (code) { using enum QProcess::ProcessError; case FailedToStart: error = tr("The process failed to start. Perhaps the executable it points to might not exist?"); break; - case Crashed: + case Crashed: { + auto timeEnd = std::chrono::steady_clock::now(); + if (std::chrono::duration(timeEnd - timeStart).count() > 30'000) { + return; + } error = tr("The process crashed."); break; + } case Timedout: error = tr("The process timed out."); break;