Index: src/ch/AppHelper.cpp =================================================================== diff -u -N -ra0a0c78670588f86c6be24afb076e6b304441563 -rf2eab440135dd8052881aa3e9af83ec85e9bf1bf --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision a0a0c78670588f86c6be24afb076e6b304441563) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision f2eab440135dd8052881aa3e9af83ec85e9bf1bf) @@ -220,17 +220,7 @@ bool CAppHelper::GetProgramDataPath(CString& rStrPath) { - if(!m_optPortableMode.is_initialized()) - { - // check if the ch.ini exists in the program's directory - it is the only way we can determine portable mode - CString strPortableCfgPath = CString(GetProgramPath()) + _T("\\ch.xml"); - if(GetFileAttributes(strPortableCfgPath) == INVALID_FILE_ATTRIBUTES) - m_optPortableMode = false; - else - m_optPortableMode = true; - - } - if(m_optPortableMode.get() == true) + if(IsInPortableMode()) rStrPath = GetProgramPath(); else { @@ -255,6 +245,21 @@ return true; } +bool CAppHelper::IsInPortableMode() +{ + if(!m_optPortableMode.is_initialized()) + { + // check if the ch.ini exists in the program's directory - it is the only way we can determine portable mode + CString strPortableCfgPath = CString(GetProgramPath()) + _T("\\ch.xml"); + if(GetFileAttributes(strPortableCfgPath) == INVALID_FILE_ATTRIBUTES) + m_optPortableMode = false; + else + m_optPortableMode = true; + } + + return m_optPortableMode.get(); +} + bool CAppHelper::SetAutorun(bool bEnable) { // check the current key value (to avoid irritating messages from some firewall software)