diff --git a/cmd/launcher/launcher.cpp b/cmd/launcher/launcher.cpp index 0b17b224..7a4f4894 100644 --- a/cmd/launcher/launcher.cpp +++ b/cmd/launcher/launcher.cpp @@ -514,6 +514,18 @@ getCommandLine(HWND hwnd, bool testing) return CString(); } + // compare server name to local host. a common error + // is to provide the client's name for the server. we + // don't bother to check the addresses though that'd be + // more accurate. + if (CStringUtil::CaselessCmp::equal(ARCH->getHostName(), server)) { + showError(hwnd, CStringUtil::format( + getString(IDS_SERVER_IS_CLIENT).c_str(), + server.c_str())); + SetFocus(child); + return CString(); + } + if (testing) { cmdLine += " --no-camp"; } diff --git a/cmd/launcher/launcher.rc b/cmd/launcher/launcher.rc index 6091c59f..35974cc1 100644 --- a/cmd/launcher/launcher.rc +++ b/cmd/launcher/launcher.rc @@ -254,6 +254,7 @@ BEGIN IDS_UNINSTALLED_USER "Removed auto-start. Synergy will not automatically start each time you log in." IDS_INVALID_SERVER_NAME "Server name `%{1}' is invalid." IDS_TITLE "Synergy - Version %{1}" + IDS_SERVER_IS_CLIENT "Please enter the computer name of the synergy server, not\nthe name of this computer, in the Server Host Name field." END #endif // English (U.S.) resources