112 bool Init(
const std::vector<std::string> ¶ms) {
113 if (wxSingleInstanceChecker::IsAnotherRunning()) {
114 wxChar separator = wxFileName::GetPathSeparator();
115 wxString service_name =
118 auto checker =
new wxSingleInstanceChecker(
120 if (!checker->IsAnotherRunning()) {
122 if (!m_server->Create(service_name)) {
123 wxLogDebug(wxT(
"Failed to create an IPC service."));
130 wxString hostName = wxT(
"localhost");
132 wxConnectionBase *connection =
133 client->MakeConnection(hostName, service_name, _T(
"OpenCPN"));
136 if (params.empty()) {
137 for (
size_t n = 0; n < params.size(); n++) {
138 wxString path(params[n]);
139 if (::wxFileExists(path)) {
140 connection->Execute(path);
144 connection->Execute(wxT(
""));
145 connection->Disconnect();
155 separator + _T(
"_OpenCPN_SILock"));
156 if (wxFileExists(lockFile)) wxRemoveFile(lockFile);
159 _(
"Sorry, an existing instance of OpenCPN may be too busy "
160 "to respond.\nPlease retry."),
161 wxT(
"OpenCPN"), wxICON_INFORMATION | wxOK);