diff --git a/main/source/init/splash_window.cpp b/main/source/init/splash_window.cpp index 455d9f8b3..63bfdddee 100644 --- a/main/source/init/splash_window.cpp +++ b/main/source/init/splash_window.cpp @@ -77,7 +77,7 @@ namespace hex::init { status = false; auto endTime = std::chrono::high_resolution_clock::now(); - log::info("Task '{}' finished in {} ms", name, std::chrono::duration_cast(endTime-startTime).count()); + log::info("Task '{}' finished in {} ms", name, std::chrono::duration_cast(endTime - startTime).count()); { std::lock_guard guard(this->m_progressMutex); @@ -86,12 +86,14 @@ namespace hex::init { } catch (std::exception &e) { log::error("Init task '{}' threw an exception: {}", name, e.what()); status = false; + } catch (...) { + status = false; } }; if (async) { - TaskManager::createBackgroundTask(name, [runTask](auto&){ runTask(); }); + std::thread([runTask]{ runTask(); }).detach(); } else { runTask(); } diff --git a/plugins/script_loader/dotnet/CMakeLists.txt b/plugins/script_loader/dotnet/CMakeLists.txt index eac6e0e05..846bd0b38 100644 --- a/plugins/script_loader/dotnet/CMakeLists.txt +++ b/plugins/script_loader/dotnet/CMakeLists.txt @@ -7,7 +7,7 @@ function(add_dotnet_assembly name) file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cs) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../../${name}.dll - COMMAND ${DOTNET_EXECUTABLE} build ${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.csproj --nologo -c Release -o ${CMAKE_CURRENT_BINARY_DIR}/../.. && ${CMAKE_COMMAND} -DOUTPUT_RUNTIMECONFIG="${OUTPUT_RUNTIMECONFIG}" -P ${CMAKE_CURRENT_SOURCE_DIR}/post_process_runtimeconfig.cmake + COMMAND ${DOTNET_EXECUTABLE} build ${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.csproj --nologo -c Release -o ${CMAKE_CURRENT_BINARY_DIR}/../.. && ${CMAKE_COMMAND} -DOUTPUT_RUNTIMECONFIG="\"${OUTPUT_RUNTIMECONFIG}\"" -P ${CMAKE_CURRENT_SOURCE_DIR}/post_process_runtimeconfig.cmake DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.csproj ${sources} COMMENT "Building ${name}.dll" ) diff --git a/plugins/script_loader/dotnet/post_process_runtimeconfig.cmake b/plugins/script_loader/dotnet/post_process_runtimeconfig.cmake index d80deb1e5..7008f79cc 100644 --- a/plugins/script_loader/dotnet/post_process_runtimeconfig.cmake +++ b/plugins/script_loader/dotnet/post_process_runtimeconfig.cmake @@ -1,7 +1,7 @@ -file(READ ${OUTPUT_RUNTIMECONFIG} FILE_CONTENTS) +file(READ "${OUTPUT_RUNTIMECONFIG}" FILE_CONTENTS) set(VERSION_REGEX [["version": "([0-9]+\.[0-9]+\.[0-9]+)"]]) set(REPLACE_VALUE [["version": "7.0.0"]]) string(REGEX REPLACE "${VERSION_REGEX}" ${REPLACE_VALUE} FILE_CONTENTS_OUT "${FILE_CONTENTS}") -file(WRITE ${OUTPUT_RUNTIMECONFIG} "${FILE_CONTENTS_OUT}") \ No newline at end of file +file(WRITE "${OUTPUT_RUNTIMECONFIG}" "${FILE_CONTENTS_OUT}") \ No newline at end of file