diff --git a/src/main.cpp b/src/main.cpp index 8bb352a..961cb2b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -439,8 +439,13 @@ static bool InitImGui(SDL_Window* window, SDL_GLContext gl_context); static void Shutdown(SDL_Window* window, SDL_GLContext gl_context); #endif -// Global single instance lock +// Global single instance lock. Keyed PER VARIANT so the full node and Lite can run side by side — +// their config dirs are already separate (DRAGONX_APP_NAME), so only this lock kept them apart. +#ifdef DRAGONX_LITE_BUILD +static dragonx::util::SingleInstance g_single_instance("obsidiandragonlite"); +#else static dragonx::util::SingleInstance g_single_instance("obsidiandragon"); +#endif // Check for payment URI in command line args static std::string findPaymentURI(int argc, char* argv[]) @@ -764,11 +769,12 @@ int main(int argc, char* argv[]) // Check for existing instance if (!g_single_instance.tryLock()) { - fprintf(stderr, "Another instance of ObsidianDragon is already running.\n"); + fprintf(stderr, "Another instance of %s is already running.\n", DRAGONX_APP_NAME); DEBUG_LOGF("Please close the existing instance first.\n"); #ifdef _WIN32 - MessageBoxW(nullptr, L"Another instance of ObsidianDragon is already running.\nPlease close it first.", - L"ObsidianDragon", MB_OK | MB_ICONINFORMATION); + const std::string msg = std::string("Another instance of ") + DRAGONX_APP_NAME + + " is already running.\nPlease close it first."; + MessageBoxA(nullptr, msg.c_str(), DRAGONX_APP_NAME, MB_OK | MB_ICONINFORMATION); #endif return 1; }