MGR: on Linux, accept 2 optional args: -clientdir or -e and -datadir or -d, use when launching client

svn path=/trunk/boinc/; revision=18919
This commit is contained in:
Charlie Fenton 2009-08-26 11:53:51 +00:00
parent 583c997f65
commit 1829b18cf1
3 changed files with 22 additions and 24 deletions

View File

@ -305,21 +305,11 @@ bool CBOINCClientManager::StartupBOINCCore() {
#else // Unix based systems
wxString savedWD = ::wxGetCwd();
if (m_strBOINCClientExecDirectory.IsEmpty() {
m_strBOINCClientExecDirectory = ::wxGetCwd();
}
if (m_strBOINCClientExecDirectory.Last != '/') {
m_strBOINCClientExecDirectory.Append('/');
}
if (m_strBOINCClientDataDirectory.IsEmpty() {
m_strBOINCClientDataDirectory = m_strBOINCClientExecDirectory;
}
wxSetWorkingDirectory(m_strBOINCClientDataDirectory);
wxSetWorkingDirectory(wxGetApp().GetDataDirectory());
// Append boinc.exe to the end of the strExecute string and get ready to rock
strExecute = m_strBOINCClientExecDirectory + wxT("boinc --redirectio --launched_by_manager");
strExecute = wxGetApp().GetRootDirectory() + wxT("boinc --redirectio --launched_by_manager");
#ifdef SANDBOX
if (!g_use_sandbox) {
strExecute += wxT(" --insecure");
@ -327,7 +317,7 @@ bool CBOINCClientManager::StartupBOINCCore() {
#endif
wxLogTrace(wxT("Function Status"), wxT("CMainDocument::StartupBOINCCore - szExecute '%s'\n"), strExecute.c_str());
wxLogTrace(wxT("Function Status"), wxT("CMainDocument::StartupBOINCCore - szDataDirectory '%s'\n"), m_strBOINCClientDataDirectory.c_str());
wxLogTrace(wxT("Function Status"), wxT("CMainDocument::StartupBOINCCore - szDataDirectory '%s'\n"), wxGetApp().GetDataDirectory().c_str());
m_lBOINCCoreProcessId = ::wxExecute(strExecute);

View File

@ -148,8 +148,6 @@ bool CBOINCGUIApp::OnInit() {
#endif
m_strBOINCMGRRootDirectory = wxEmptyString;
m_strBOINCMGRDataDirectory = wxEmptyString;
m_strBOINCClientExecDirectory = wxEmptyString;
m_strBOINCClientDataDirectory = wxEmptyString;
m_strBOINCArguments = wxEmptyString;
m_bAccessibilityEnabled = false;
m_bGUIVisible = true;
@ -558,15 +556,11 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) {
if (parser.Found(wxT("autostart"))) {
m_bBOINCMGRAutoStarted = true;
}
#if defined(__WXMSW__) || defined(__WXMAC__)
if (parser.Found(wxT("systray"))) {
m_bGUIVisible = false;
}
if (parser.Found(wxT("clientdir"), &m_strBOINCClientExecDirectory)) {
m_bGUIVisible = false;
}
if (parser.Found(wxT("datadir"), &m_strBOINCClientDataDirectory)) {
m_bGUIVisible = false;
}
#endif
if (parser.Found(wxT("insecure"))) {
g_use_sandbox = false;
}
@ -574,6 +568,22 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) {
m_bDebugSkins = true;
}
#if !(defined(__WXMSW__) || defined(__WXMAC__))
if (!parser.Found(wxT("clientdir"), &m_strBOINCMGRRootDirectory)) {
m_strBOINCMGRRootDirectory = ::wxGetCwd();
}
if (m_strBOINCMGRRootDirectory.Last() != '/') {
m_strBOINCMGRRootDirectory.Append('/');
}
if (!parser.Found(wxT("datadir"), &m_strBOINCMGRDataDirectory)) {
m_strBOINCMGRDataDirectory = m_strBOINCMGRRootDirectory;
}
if (m_strBOINCMGRDataDirectory.Last() != '/') {
m_strBOINCMGRDataDirectory.Append('/');
}
#endif
return true;
}

View File

@ -84,8 +84,6 @@ protected:
wxString m_strBOINCMGRRootDirectory;
wxString m_strBOINCMGRDataDirectory;
wxString m_strBOINCArguments;
wxString m_strBOINCClientExecDirectory;
wxString m_strBOINCClientDataDirectory;
bool m_bAccessibilityEnabled;