| 182 | } |
| 183 | |
| 184 | bool PluginHost::Start(int connectPort) |
| 185 | { |
| 186 | const auto cmd = wxString::Format("\"%s\" %s %d", |
| 187 | PlatformCompatibility::GetExecutablePath(), |
| 188 | PluginHost::HostArgument, |
| 189 | connectPort); |
| 190 | |
| 191 | auto process = std::make_unique<wxProcess>(); |
| 192 | process->Detach(); |
| 193 | if(wxExecute(cmd, wxEXEC_ASYNC, process.get()) != 0) |
| 194 | { |
| 195 | //process will delete itself upon termination |
| 196 | process.release(); |
| 197 | return true; |
| 198 | } |
| 199 | return false; |
| 200 | } |
| 201 | |
| 202 | bool PluginHost::IsHostProcess() |
| 203 | { |