mirror of
https://github.com/cmderdev/cmder.git
synced 2025-11-29 18:19:41 +08:00
Merge branch 'fix_launcher_overwrite-2' into development-dax
* fix_launcher_overwrite-2: cleanup cleanup cleanup not set
This commit is contained in:
@@ -300,7 +300,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
|
||||
if ( PathFileExists(cpuCfgPath) || use_user_cfg == false ) // config/[host specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
|
||||
if (wcscmp(cpuCfgPath, L"") != 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/[host specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
|
||||
{
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
@@ -348,7 +348,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
|
||||
else if (wcscmp(userCfgPath, L"") != 0 && PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
|
||||
{
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
@@ -447,12 +447,12 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else if (PathFileExists(cfgPath)) // This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
|
||||
else if (wcscmp(cfgPath, L"") != 0 && PathFileExists(cfgPath)) // This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
@@ -475,9 +475,9 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
else if (wcscmp(defaultCfgPath, L"") == 0) // '/c [path]' was specified and 'vendor/[terminal emulator config].default' config exists, copy Cmder 'vendor/[terminal emulator config].default' file to '[user specified path]/config/user_[terminal emulator config]'.
|
||||
else if (wcscmp(defaultCfgPath, L"") != 0) // '/c [path]' was specified and 'vendor/[terminal emulator config].default' config exists, copy Cmder 'vendor/[terminal emulator config].default' file to '[user specified path]/config/user_[terminal emulator config]'.
|
||||
{
|
||||
if (!CopyFile(defaultCfgPath, userCfgPath, FALSE))
|
||||
if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir)) {
|
||||
MessageBox(NULL,
|
||||
@@ -622,7 +622,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
// Try to find m'intty.exe' so ConEmu can launch using %MINTTY_EXE% in external Git for Cmder Mini.
|
||||
// See: https://github.com/Maximus5/ConEmu/issues/2559 for why this is commented.
|
||||
|
||||
/*
|
||||
/*
|
||||
if (PathFileExists(vendoredGit))
|
||||
{
|
||||
PathCombine(minTTYPath, vendoredGit, L"usr\\bin\\mintty.exe");
|
||||
@@ -660,7 +660,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
sei.lpFile = terminalPath;
|
||||
sei.lpParameters = args;
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
|
||||
|
||||
if (admin && ShellExecuteEx(&sei))
|
||||
{
|
||||
if (!sei.hProcess)
|
||||
|
||||
Reference in New Issue
Block a user