Merge remote-tracking branch 'origin/fix_launcher_overwrite' into vagrant+packer

This commit is contained in:
Dax T. Games
2024-06-03 08:22:30 -04:00
4 changed files with 65 additions and 57 deletions

View File

@ -300,13 +300,16 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml"); PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
} }
if (wcscmp(cpuCfgPath, L"") == 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config. if ( PathFileExists(cpuCfgPath) || use_user_cfg == false ) // config/[cpu 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 if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
{ {
if (!CopyFile(cfgPath, cpuCfgPath, FALSE)) if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
{ {
if (PathFileExists(windowsTerminalDir)) { if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL, MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED) (GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied." ? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
@ -323,9 +326,10 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
} }
} }
} }
else // vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file else // [terminal emulator config] file does not exist, copy config/[cpu specific terminal emulator config] file to [terminal emulator config] file
{ {
if (!CopyFile(cpuCfgPath, cfgPath, FALSE)) if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
{ {
if (PathFileExists(windowsTerminalDir)) if (PathFileExists(windowsTerminalDir))
{ {
@ -346,11 +350,12 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
} }
} }
} }
else if (wcscmp(userCfgPath, L"") == 0 && PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it. }
else if (PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
{ {
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{ {
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml. if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
{ {
if (!CopyFile(cfgPath, userCfgPath, FALSE)) if (!CopyFile(cfgPath, userCfgPath, FALSE))
{ {
@ -372,7 +377,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
} }
} }
} }
else // vendor/conemu-maximus5/ConEmu.xml does not exist, copy config/user-conemu.xml to vendor/conemu-maximus5/ConEmu.xml else // [terminal emulator config] file does not exist, copy config/user_[terminal emulator config] file to [terminal emulator config] file
{ {
if (!CopyFile(userCfgPath, cfgPath, FALSE)) if (!CopyFile(userCfgPath, cfgPath, FALSE))
{ {
@ -395,13 +400,13 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
} }
} }
} }
else if (!PathFileExists(windowsTerminalDir)) { // '/c [path]' was specified, don't copy anything and use existing user_conemu.xml to start comemu. else if (!PathFileExists(windowsTerminalDir)) { // '/c [path]' was specified, don't copy anything and use existing user_[terminal emulator config] file.
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml"); PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
} }
} }
else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{ {
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
{ {
if (!CopyFile(cfgPath, userCfgPath, FALSE)) if (!CopyFile(cfgPath, userCfgPath, FALSE))
{ {
@ -422,7 +427,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
exit(1); exit(1);
} }
} }
else // vendor/ConEmu.xml.default config exists, copy Cmder vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml. else // vendor/[terminal emulator config].default config exists, copy Cmder vendor/[terminal emulator config].default file to [terminal emulator config] file.
{ {
if (!CopyFile(defaultCfgPath, cfgPath, FALSE)) if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
{ {
@ -445,7 +450,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
} }
} }
} }
else if (!CopyFile(defaultCfgPath, cfgPath, FALSE) && PathFileExists(conEmuDir)) else {
if (!CopyFile(defaultCfgPath, cfgPath, FALSE) && PathFileExists(conEmuDir))
{ {
MessageBox(NULL, MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED) (GetLastError() == ERROR_ACCESS_DENIED)
@ -454,7 +460,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
exit(1); exit(1);
} }
} }
else if (wcscmp(cfgPath, L"") == 0 && PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml }
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.
{ {
if (!CopyFile(cfgPath, userCfgPath, FALSE)) if (!CopyFile(cfgPath, userCfgPath, FALSE))
{ {
@ -478,7 +485,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml"); PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
} }
else if (wcscmp(defaultCfgPath, L"") == 0) // '/c [path]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/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]'.
{ {
if (!CopyFile(defaultCfgPath, userCfgPath, FALSE)) if (!CopyFile(defaultCfgPath, userCfgPath, FALSE))
{ {

View File

@ -55,6 +55,7 @@ exit /b
set "GIT_VERSION=%%C" set "GIT_VERSION=%%C"
) else ( ) else (
echo "'git --version' returned an improper version string!" echo "'git --version' returned an improper version string!"
%print_debug% :read_version "returned string: '%%A %%B %%C' by executable path: %git_executable%"
pause pause
exit /b exit /b
) )

12
vendor/sources.json vendored
View File

@ -6,13 +6,13 @@
}, },
{ {
"name": "git-for-windows", "name": "git-for-windows",
"version": "2.42.0.windows.1", "version": "2.45.1.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.1/PortableGit-2.42.0-64-bit.7z.exe" "url": "https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/PortableGit-2.45.1-64-bit.7z.exe"
}, },
{ {
"name": "clink", "name": "clink",
"version": "1.5.12", "version": "1.6.14",
"url": "https://github.com/chrisant996/clink/releases/download/v1.5.12/clink.1.5.12.c7156f.zip" "url": "https://github.com/chrisant996/clink/releases/download/v1.6.14/clink.1.6.14.93b83f.zip"
}, },
{ {
"name": "conemu-maximus5", "name": "conemu-maximus5",
@ -21,7 +21,7 @@
}, },
{ {
"name": "clink-completions", "name": "clink-completions",
"version": "0.4.11", "version": "0.5.2",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.11.zip" "url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.5.2.zip"
} }
] ]

View File

@ -73,7 +73,7 @@
}, },
{ {
"colorScheme": "One Half Dark", "colorScheme": "One Half Dark",
"commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\...\\profile.ps1'''\"", "commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\..\\profile.ps1'''\"",
"guid": "{eb1f6578-ce9d-47a9-a8c7-9b3fdd22302d}", "guid": "{eb1f6578-ce9d-47a9-a8c7-9b3fdd22302d}",
"hidden": false, "hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_orange.ico", "icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_orange.ico",