From f3e4c6dede35665081cba94599a1b0f072a1f15d Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Fri, 4 Jun 2010 17:58:45 +0000 Subject: [PATCH] Fixed issue 497 --- lib/synergy/CApp.cpp | 15 ++++++++++++++- lib/synergy/CServerApp.cpp | 9 --------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/synergy/CApp.cpp b/lib/synergy/CApp.cpp index 709e9bd1..3ab793e9 100644 --- a/lib/synergy/CApp.cpp +++ b/lib/synergy/CApp.cpp @@ -173,7 +173,20 @@ CApp::parseArgs(int argc, const char* const* argv, int& i) // parse options for (i = 1; i < argc; ++i) { - if (parseArg(argc, argv, i)) { + #if SYSAPI_WIN32 + // suggest that user installs as a windows service. when launched as + // service, process should automatically detect that it should run in + // daemon mode. + if (argsBase().m_daemon) { + LOG((CLOG_ERR + "The --daemon argument is not supported on Windows. " + "Instead, install %s as a service (--service install).", + argsBase().m_pname)); + m_bye(kExitArgs); + } + #endif + + else if (parseArg(argc, argv, i)) { continue; } diff --git a/lib/synergy/CServerApp.cpp b/lib/synergy/CServerApp.cpp index 2db1af73..32c888d0 100644 --- a/lib/synergy/CServerApp.cpp +++ b/lib/synergy/CServerApp.cpp @@ -128,15 +128,6 @@ CServerApp::parseArgs(int argc, const char* const* argv) m_bye(kExitArgs); } -#if SYSAPI_WIN32 - // if user wants to run as daemon, but process not launched from service launcher... - if (args().m_daemon && !CArchMiscWindows::wasLaunchedAsService()) { - LOG((CLOG_ERR "cannot launch as daemon if process not started through " - "service host (use '--service start' argument instead)")); - m_bye(kExitArgs); - } -#endif - // set log filter if (!CLOG->setFilter(args().m_logFilter)) { LOG((CLOG_PRINT "%s: unrecognized log level `%s'" BYE,