Merge pull request #427 from kodybrown/development

Added code to check for the existence of a customized ini file..
This commit is contained in:
Martin Kemp 2015-12-04 13:04:21 +00:00
commit 9a1d49bfc3

View File

@ -113,8 +113,21 @@ void StartCmder(std::wstring path, bool is_single_mode)
PathRemoveFileSpec(exeDir); PathRemoveFileSpec(exeDir);
PathCombine(icoPath, exeDir, L"icons\\cmder.ico"); PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
// Check for machine-specific config file.
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(oldCfgPath, oldCfgPath, sizeof(oldCfgPath) / sizeof(oldCfgPath[0]));
if (!PathFileExists(oldCfgPath)) {
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml"); PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml");
}
// Check for machine-specific config file.
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0]));
if (!PathFileExists(cfgPath)) {
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml"); PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
}
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe"); PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
if (FileExists(oldCfgPath) && !FileExists(cfgPath)) if (FileExists(oldCfgPath) && !FileExists(cfgPath))