Index: src/ch/ch.cpp =================================================================== diff -u -r8dc649003961dad64b92da67426814fb5dd862e0 -rffb46a396ce20cda2e04020cf01c118ae81642b5 --- src/ch/ch.cpp (.../ch.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) +++ src/ch/ch.cpp (.../ch.cpp) (revision ffb46a396ce20cda2e04020cf01c118ae81642b5) @@ -138,7 +138,7 @@ bool bChanged=false; // flag that'll be returned - if the paths has changed // generate the current filename - uses language from config - CString strHelpPath = ExpandPath(_T("\\Help\\")); + CString strHelpPath = m_pathProcessor.ExpandPath(_T("\\Help\\")); strHelpPath += GetResManager().m_ld.GetHelpName(); if(strHelpPath != m_pszHelpFilePath) { @@ -347,7 +347,7 @@ rResManager.SetCallback(ResManCallback); GetPropValue(rCfg, strPath); TRACE(_T("Help path=%s\n"), strPath); - if(!rResManager.SetLanguage(ExpandPath(strPath))) + if(!rResManager.SetLanguage(m_pathProcessor.ExpandPath(strPath))) { TCHAR szData[2048]; _sntprintf(szData, 2048, _T("Couldn't find the language file specified in configuration file:\n%s\nPlease correct this path to point the language file to use.\nProgram will now exit."), (PCTSTR)strPath); @@ -363,6 +363,17 @@ EnableHtmlHelp(); + // ================================= Handle early command line options ======================================== + if(m_cmdLineParser.HasCommandLineParams() && m_cmdLineParser.HasSystemStartupOption()) + { + SetPropValue(rCfg, m_cmdLineParser.IsSystemStartupEnabled()); + rCfg.Write(); + + SetAutorun(GetPropValue(rCfg)); + + return FALSE; + } + // ================================= Checking for running instances of CH ======================================== // check instance - return false if it's the second one LOG_INFO(_T("Checking for other running instances of Copy Handler")); @@ -565,7 +576,7 @@ void CCopyHandlerApp::RegisterShellExtension() { - CString strPath = CString(GetProgramPath()) + _T("\\"); + CString strPath = CString(m_pathProcessor.GetProgramPath()) + _T("\\"); #ifdef _WIN64 strPath += _T("chext64.dll"); @@ -603,7 +614,7 @@ void CCopyHandlerApp::UnregisterShellExtension() { - CString strPath = CString(GetProgramPath()) + _T("\\"); + CString strPath = CString(m_pathProcessor.GetProgramPath()) + _T("\\"); #ifdef _WIN64 strPath += _T("chext64.dll"); @@ -638,7 +649,7 @@ // update language in resource manager CString strPath; GetPropValue(GetConfig(), strPath); - GetResManager().SetLanguage(ExpandPath(strPath)); + GetResManager().SetLanguage(m_pathProcessor.ExpandPath(strPath)); } if(setPropNames.HasValue(PropData::GetPropertyName()))