From b9ccddf47d0e4b6ec564457b2246be4f9141344c Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Thu, 7 May 2026 00:26:18 -0700 Subject: [PATCH] launcher: prevent early hook from launching in standalone configurator (#678) ## Description of change Seems to be an oversight when it was initially implemented; hooks should not load when launching `spicecfg` (or `spice -cfg` or `spice64 -cfg`). --- src/spice2x/launcher/launcher.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index c2c0061..e3a7db1 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -1532,16 +1532,18 @@ int main_implementation(int argc, char *argv[]) { } // early hooks - for (auto &hook : early_hooks) { - log_info("launcher", "loading early hook DLL {}", hook); - libutils::print_dll_info(hook); - HMODULE module; - if (!(module = libutils::try_library(hook))) { - log_warning("launcher", "failed to load early hook {}: {}", hook, get_last_error_string()); - deferredlogs::defer_error_messages({ - fmt::format("failed to load early hook {}:", hook), - fmt::format(" {}", get_last_error_string()) - }); + if (!cfg_run) { + for (auto &hook : early_hooks) { + log_info("launcher", "loading early hook DLL {}", hook); + libutils::print_dll_info(hook); + HMODULE module; + if (!(module = libutils::try_library(hook))) { + log_warning("launcher", "failed to load early hook {}: {}", hook, get_last_error_string()); + deferredlogs::defer_error_messages({ + fmt::format("failed to load early hook {}:", hook), + fmt::format(" {}", get_last_error_string()) + }); + } } }