mirror of
https://github.com/cmderdev/cmder.git
synced 2025-03-13 06:04:36 +08:00
Merge pull request #2942 from daxgames/cmder4win
Cmder for Windows - Add `Bash`, `Powershell`, `mintty`.
This commit is contained in:
commit
7ac805cda5
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -52,6 +52,27 @@ jobs:
|
|||||||
working-directory: scripts
|
working-directory: scripts
|
||||||
run: .\pack.ps1 -verbose -terminal all
|
run: .\pack.ps1 -verbose -terminal all
|
||||||
|
|
||||||
|
- name: Upload artifact (cmder_win_mini.zip)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build/cmder_win_mini.zip
|
||||||
|
name: cmder_win_mini.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload artifact (cmder_win.7z)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build/cmder_win.7z
|
||||||
|
name: cmder_win.7z
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload artifact (cmder_win.zip)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build/cmder_win.zip
|
||||||
|
name: cmder_win.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload artifact (cmder_wt.zip)
|
- name: Upload artifact (cmder_wt.zip)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
|
|
||||||
- Fixes #2940
|
- Fixes #2940
|
||||||
|
|
||||||
|
### Adds
|
||||||
|
|
||||||
|
- Cmder for Windows
|
||||||
|
- Uses Windows and Git for Windows Native Terminals.
|
||||||
|
- Does not contain a terminal emulator like ConEmu or Windows Terminal.
|
||||||
|
|
||||||
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
|
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
@ -188,6 +188,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="src\CmderLauncher.cpp" />
|
<ClCompile Include="src\CmderLauncher.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\icons\cmder.ico" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
@ -107,9 +107,9 @@ bool FileExists(const wchar_t * filePath)
|
|||||||
|
|
||||||
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring iconPath = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"")
|
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring iconPath = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"")
|
||||||
{
|
{
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
wchar_t appId[MAX_PATH] = { 0 };
|
wchar_t appId[MAX_PATH] = { 0 };
|
||||||
#endif
|
#endif
|
||||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||||
wchar_t icoPath[MAX_PATH] = { 0 };
|
wchar_t icoPath[MAX_PATH] = { 0 };
|
||||||
wchar_t cfgPath[MAX_PATH] = { 0 };
|
wchar_t cfgPath[MAX_PATH] = { 0 };
|
||||||
@ -131,8 +131,17 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||||
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
||||||
wchar_t winDir[MAX_PATH] = { 0 };
|
wchar_t winDir[MAX_PATH] = { 0 };
|
||||||
wchar_t emulatorPath[MAX_PATH] = { 0 };
|
wchar_t vendorDir[MAX_PATH] = { 0 };
|
||||||
|
wchar_t initCmd[MAX_PATH] = { 0 };
|
||||||
|
wchar_t initPowerShell[MAX_PATH] = { 0 };
|
||||||
|
wchar_t initBash[MAX_PATH] = { 0 };
|
||||||
|
wchar_t initMintty[MAX_PATH] = { 0 };
|
||||||
|
wchar_t vendoredGit[MAX_PATH] = { 0 };
|
||||||
|
wchar_t amdx64Git[MAX_PATH] = { 0 };
|
||||||
|
wchar_t x86Git[MAX_PATH] = { 0 };
|
||||||
|
wchar_t programFiles[MAX_PATH] = { 0 };
|
||||||
|
wchar_t programFilesX86[MAX_PATH] = { 0 };
|
||||||
|
wchar_t minTTYPath[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
std::wstring cmderStart = path;
|
std::wstring cmderStart = path;
|
||||||
std::wstring cmderTask = taskName;
|
std::wstring cmderTask = taskName;
|
||||||
@ -144,9 +153,9 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
|
|
||||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||||
|
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
wcscpy_s(appId, exeDir);
|
wcscpy_s(appId, exeDir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PathRemoveFileSpec(exeDir);
|
PathRemoveFileSpec(exeDir);
|
||||||
|
|
||||||
@ -255,8 +264,9 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
PathCombine(vendorDir, exeDir, L"vendor");
|
||||||
PathCombine(conEmuDir, exeDir, L"vendor\\conemu-maximus5");
|
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
|
||||||
|
PathCombine(conEmuDir, vendorDir, L"conemu-maximus5");
|
||||||
GetEnvironmentVariable(L"WINDIR", winDir, MAX_PATH);
|
GetEnvironmentVariable(L"WINDIR", winDir, MAX_PATH);
|
||||||
|
|
||||||
if (PathFileExists(windowsTerminalDir))
|
if (PathFileExists(windowsTerminalDir))
|
||||||
@ -319,7 +329,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
|
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
|
||||||
{
|
{
|
||||||
if (PathFileExists(windowsTerminalDir)) {
|
if (PathFileExists(windowsTerminalDir)) {
|
||||||
MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||||
@ -346,7 +356,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
if (!CopyFile(cfgPath, userCfgPath, 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_settings.json! Access Denied."
|
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settings.json! Access Denied."
|
||||||
@ -367,7 +378,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(userCfgPath, cfgPath, FALSE))
|
if (!CopyFile(userCfgPath, cfgPath, FALSE))
|
||||||
{
|
{
|
||||||
if (PathFileExists(windowsTerminalDir)) {
|
if (PathFileExists(windowsTerminalDir))
|
||||||
|
{
|
||||||
MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
? L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
? L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||||
@ -395,7 +407,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
if (!CopyFile(cfgPath, userCfgPath, 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/user_windows_terminal_settings.json! Access Denied."
|
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings.json! Access Denied."
|
||||||
@ -415,7 +428,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
|
if (!CopyFile(defaultCfgPath, cfgPath, 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_default_settings_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||||
@ -437,7 +451,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(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);
|
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -446,7 +460,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
if (!CopyFile(cfgPath, userCfgPath, 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/user_windows_terminal_settings_settings.json! Access Denied."
|
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settings.json! Access Denied."
|
||||||
@ -469,7 +484,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
{
|
{
|
||||||
if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))
|
if ( ! CopyFile(defaultCfgPath, userCfgPath, 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_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json! Access Denied."
|
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json! Access Denied."
|
||||||
@ -488,22 +504,50 @@ 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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetEnvironmentVariable(L"ProgramFiles", programFiles, MAX_PATH);
|
||||||
|
GetEnvironmentVariable(L"ProgramFiles(x86)", programFilesX86, MAX_PATH);
|
||||||
|
|
||||||
|
PathCombine(vendoredGit, vendorDir, L"git-for-windows");
|
||||||
|
PathCombine(amdx64Git, programFiles, L"Git");
|
||||||
|
PathCombine(x86Git, programFilesX86, L"Git");
|
||||||
|
|
||||||
SYSTEM_INFO sysInfo;
|
SYSTEM_INFO sysInfo;
|
||||||
GetNativeSystemInfo(&sysInfo);
|
GetNativeSystemInfo(&sysInfo);
|
||||||
if (PathFileExists(windowsTerminalDir)) {
|
if (PathFileExists(windowsTerminalDir))
|
||||||
|
{
|
||||||
PathCombine(terminalPath, exeDir, L"vendor\\windows-terminal\\WindowsTerminal.exe");
|
PathCombine(terminalPath, exeDir, L"vendor\\windows-terminal\\WindowsTerminal.exe");
|
||||||
}
|
}
|
||||||
else if (PathFileExists(conEmuDir))
|
else if (PathFileExists(conEmuDir))
|
||||||
{
|
{
|
||||||
|
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
|
||||||
|
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
|
||||||
PathCombine(terminalPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
|
PathCombine(terminalPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PathCombine(terminalPath, winDir, L"system32\\cmd.exe");
|
PathCombine(terminalPath, winDir, L"system32\\cmd.exe");
|
||||||
}
|
|
||||||
|
|
||||||
if (!PathFileExists(windowsTerminalDir)) {
|
if (streqi(cmderTask.c_str(), L"powershell"))
|
||||||
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
|
{
|
||||||
|
PathCombine(terminalPath, winDir, L"System32\\WindowsPowerShell\\v1.0\\powershell.exe");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
else if (streqi(cmderTask.c_str(), L"mintty"))
|
||||||
|
{
|
||||||
|
if (PathFileExists(vendoredGit))
|
||||||
|
{
|
||||||
|
PathCombine(terminalPath, vendoredGit, L"git-bash.exe");
|
||||||
|
}
|
||||||
|
else if (PathFileExists(amdx64Git))
|
||||||
|
{
|
||||||
|
PathCombine(terminalPath, amdx64Git, L"git-bash.exe");
|
||||||
|
}
|
||||||
|
else if (PathFileExists(x86Git))
|
||||||
|
{
|
||||||
|
PathCombine(terminalPath, x86Git, L"git-bash.exe");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!streqi(cmderStart.c_str(), L""))
|
if (!streqi(cmderStart.c_str(), L""))
|
||||||
@ -524,13 +568,6 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!streqi(cmderTitle.c_str(), L""))
|
|
||||||
{
|
|
||||||
if (!PathFileExists(windowsTerminalDir)) {
|
|
||||||
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cfgRoot.length() != 0)
|
if (cfgRoot.length() != 0)
|
||||||
{
|
{
|
||||||
if (!PathFileExists(windowsTerminalDir)) {
|
if (!PathFileExists(windowsTerminalDir)) {
|
||||||
@ -546,6 +583,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
// The `/run` arg and its value MUST be the last arg of ConEmu
|
// The `/run` arg and its value MUST be the last arg of ConEmu
|
||||||
// see : https://conemu.github.io/en/ConEmuArgs.html
|
// see : https://conemu.github.io/en/ConEmuArgs.html
|
||||||
// > This must be the last used switch (excepting -new_console and -cur_console)
|
// > This must be the last used switch (excepting -new_console and -cur_console)
|
||||||
|
PathCombine(initCmd, vendorDir, L"init.bat");
|
||||||
|
PathCombine(initPowerShell, vendorDir, L"profile.ps1");
|
||||||
|
PathCombine(initBash, vendorDir, L"start_git_bash.cmd");
|
||||||
|
PathCombine(initMintty, vendorDir, L"start_git_mintty.cmd");
|
||||||
|
|
||||||
if (!streqi(cmderTask.c_str(), L""))
|
if (!streqi(cmderTask.c_str(), L""))
|
||||||
{
|
{
|
||||||
if (PathFileExists(windowsTerminalDir)) {
|
if (PathFileExists(windowsTerminalDir)) {
|
||||||
@ -557,7 +599,22 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf_s(args, L"%s %s", args, cmderTask.c_str());
|
if (streqi(cmderTask.c_str(), L"powershell"))
|
||||||
|
{
|
||||||
|
swprintf_s(args, L"%s -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%s'''\"", args, initPowerShell);
|
||||||
|
}
|
||||||
|
else if (streqi(cmderTask.c_str(), L"bash"))
|
||||||
|
{
|
||||||
|
swprintf_s(args, L"%s /c \"%s\"", args, initBash);
|
||||||
|
}
|
||||||
|
else if (streqi(cmderTask.c_str(), L"mintty"))
|
||||||
|
{
|
||||||
|
swprintf_s(args, L"%s /c \"%s\"", args, initMintty);
|
||||||
|
}
|
||||||
|
else if (streqi(cmderTask.c_str(), L"cmder"))
|
||||||
|
{
|
||||||
|
swprintf_s(args, L"%s /k \"%s\"", args, initCmd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,23 +625,42 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
SetEnvironmentVariable(L"CMDER_USER_BIN", userBinDirPath);
|
SetEnvironmentVariable(L"CMDER_USER_BIN", userBinDirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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");
|
||||||
|
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||||
|
}
|
||||||
|
else if (PathFileExists(amdx64Git))
|
||||||
|
{
|
||||||
|
PathCombine(minTTYPath, amdx64Git, L"usr\\bin\\mintty.exe");
|
||||||
|
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||||
|
}
|
||||||
|
else if (PathFileExists(x86Git))
|
||||||
|
{
|
||||||
|
PathCombine(minTTYPath, x86Git, L"usr\\bin\\mintty.exe");
|
||||||
|
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Ensure EnvironmentVariables are propagated.
|
// Ensure EnvironmentVariables are propagated.
|
||||||
|
|
||||||
STARTUPINFO si = { 0 };
|
STARTUPINFO si = { 0 };
|
||||||
|
|
||||||
si.cb = sizeof(STARTUPINFO);
|
si.cb = sizeof(STARTUPINFO);
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
si.lpTitle = appId;
|
si.lpTitle = appId;
|
||||||
si.dwFlags = STARTF_TITLEISAPPID;
|
si.dwFlags = STARTF_TITLEISAPPID;
|
||||||
#endif
|
#endif
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
|
||||||
// MessageBox(NULL, terminalPath, _T("Error"), MB_OK);
|
|
||||||
// MessageBox(NULL, args, _T("Error"), MB_OK);
|
|
||||||
|
|
||||||
if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
|
if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
|
||||||
{
|
{
|
||||||
if (PathFileExists(windowsTerminalDir)) {
|
if (PathFileExists(windowsTerminalDir))
|
||||||
|
{
|
||||||
MessageBox(NULL, _T("Unable to create the Windows Terminal process!"), _T("Error"), MB_OK);
|
MessageBox(NULL, _T("Unable to create the Windows Terminal process!"), _T("Error"), MB_OK);
|
||||||
}
|
}
|
||||||
else if (PathFileExists(conEmuDir))
|
else if (PathFileExists(conEmuDir))
|
||||||
@ -729,7 +805,6 @@ cmderOptions GetOption()
|
|||||||
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
||||||
wchar_t vendorDir[MAX_PATH] = { 0 };
|
wchar_t vendorDir[MAX_PATH] = { 0 };
|
||||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||||
wchar_t cmdInit[MAX_PATH] = { 0 };
|
|
||||||
|
|
||||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||||
PathRemoveFileSpec(exeDir);
|
PathRemoveFileSpec(exeDir);
|
||||||
@ -737,7 +812,6 @@ cmderOptions GetOption()
|
|||||||
PathCombine(vendorDir, exeDir, L"vendor");
|
PathCombine(vendorDir, exeDir, L"vendor");
|
||||||
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
|
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
|
||||||
PathCombine(conEmuDir, vendorDir, L"ConEmu-Maximus5");
|
PathCombine(conEmuDir, vendorDir, L"ConEmu-Maximus5");
|
||||||
PathCombine(cmdInit, vendorDir, L"init.bat");
|
|
||||||
|
|
||||||
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
||||||
|
|
||||||
@ -868,14 +942,11 @@ cmderOptions GetOption()
|
|||||||
cmderOptions.error = true;
|
cmderOptions.error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir))
|
if (!PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir) && streqi(cmderOptions.cmderTask.c_str(), L""))
|
||||||
{
|
{
|
||||||
cmderOptions.cmderTask = L"/k \"";
|
cmderOptions.cmderTask = L"cmder";
|
||||||
cmderOptions.cmderTask += cmdInit;
|
|
||||||
cmderOptions.cmderTask += L"\"";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmderOptions.error == true)
|
if (cmderOptions.error == true)
|
||||||
@ -909,13 +980,12 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
|
|
||||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||||
PathRemoveFileSpec(exeDir);
|
PathRemoveFileSpec(exeDir);
|
||||||
|
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
||||||
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
|
||||||
|
|
||||||
if (cmderOptions.registerApp == true)
|
if (cmderOptions.registerApp == true)
|
||||||
{
|
{
|
||||||
if (PathFileExists(windowsTerminalDir))
|
if (PathFileExists(windowsTerminalDir))
|
||||||
{
|
{
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
@ -946,4 +1016,4 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -1,15 +1,6 @@
|
|||||||
/* _
|
// Microsoft Visual C++ generated resource script.
|
||||||
___ _ __ ___ __| | ___ _ __
|
//
|
||||||
/ __| '_ ` _ \ / _` |/ _ \ '__|
|
|
||||||
| (__| | | | | | (_| | __/ |
|
|
||||||
\___|_| |_| |_|\__,_|\___|_|
|
|
||||||
=============================================================================
|
|
||||||
The Cmder Console Emulator Project
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "version.rc2"
|
|
||||||
#include "strings.rc2"
|
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -26,6 +17,7 @@
|
|||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -33,25 +25,26 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""winres.h""\r\n"
|
"#include ""winres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
@ -60,8 +53,7 @@ END
|
|||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
||||||
#endif // English (United States) resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@ -69,26 +61,30 @@ IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION
|
FILEVERSION 1,3,6,1
|
||||||
PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION
|
PRODUCTVERSION 1,3,6,1
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS (CMDER_DEBUGFLAG | CMDER_BUILDFLAGS)
|
#ifdef _DEBUG
|
||||||
FILEOS VOS_NT_WINDOWS32
|
FILEFLAGS 0x1L
|
||||||
FILETYPE VFT_APP
|
#else
|
||||||
FILESUBTYPE VFT2_UNKNOWN
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS 0x40004L
|
||||||
|
FILETYPE 0x1L
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "100904b0"
|
BLOCK "100904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", CMDER_COMPANY_NAME_STR "\0"
|
VALUE "CompanyName", "Samuel Vasko"
|
||||||
VALUE "FileDescription", CMDER_FILE_DESCRIPTION_STR "\0"
|
VALUE "FileDescription", "Cmder: Lovely Console Emulator."
|
||||||
VALUE "FileVersion", CMDER_VERSION_STR "\0"
|
VALUE "FileVersion", "1.3.6-pre1"
|
||||||
VALUE "InternalName", CMDER_INTERNAL_NAME_STR "\0"
|
VALUE "InternalName", "Cmder"
|
||||||
VALUE "LegalCopyright", "Copyright (C) " CMDER_COPYRIGHT_YEAR_STR " " CMDER_COMPANY_NAME_STR "\0"
|
VALUE "LegalCopyright", "Copyright (C) 2016 Samuel Vasko"
|
||||||
VALUE "OriginalFilename", CMDER_ORIGINAL_FILENAME_STR "\0"
|
VALUE "OriginalFilename", "Cmder.exe"
|
||||||
VALUE "ProductName", CMDER_PRODUCT_NAME_STR "\0"
|
VALUE "ProductName", "Cmder"
|
||||||
VALUE "ProductVersion", CMDER_VERSION_STR "\0"
|
VALUE "ProductVersion", "1.3.6-pre1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
@ -97,7 +93,26 @@ BEGIN
|
|||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_TITLE "Cmder Launcher"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRINGTABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_SWITCHES "Valid options:\n\n /c [CMDER User Root Path]\n /task [Windows Terminal Profile/ConEmu Task Name]\n /icon [CMDER Icon Path] - ConEmu ONLY!\n [/start [Start in Path] | [Start in Path]]\n /single - ConEmu ONLY!\n /m\n -- [ConEmu/Windows Terminal extra arguments]\n\nNote: '-- [...]' must be the last argument!\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // English (United States) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -105,5 +120,7 @@ END
|
|||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ STRINGTABLE
|
|||||||
{
|
{
|
||||||
IDS_TITLE "Cmder Launcher"
|
IDS_TITLE "Cmder Launcher"
|
||||||
|
|
||||||
IDS_SWITCHES L"Valid options:\n\n /c [CMDER User Root Path]\n /task [Windows Terminal Profile/ConEmu Task Name]\n /icon [CMDER Icon Path] - ConEmu ONLY!\n [/start [Start in Path] | [Start in Path]]\n /single - ConEmu ONLY!\n /m\n -- [ConEmu/Windows Terminal extra arguments]\n\nNote: '-- [...]' must be the last argument!\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
|
IDS_SWITCHES L"Valid options:\n\n /a Admin - Native Terminals ONLY!\n /c [CMDER User Root Path]\n /task [Windows Terminal Profile/ConEmu Task Name]\n /icon [CMDER Icon Path] - ConEmu ONLY!\n [/start [Start in Path] | [Start in Path]]\n /single - ConEmu ONLY!\n /m\n -- [ConEmu/Windows Terminal extra arguments]\n\nNote: '-- [...]' must be the last argument!\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
2
vendor/init.bat
vendored
2
vendor/init.bat
vendored
@ -540,7 +540,7 @@ if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMD
|
|||||||
set initialConfig=
|
set initialConfig=
|
||||||
|
|
||||||
if not exist "%CMDER_CONFIG_DIR%\user_init.cmd" (
|
if not exist "%CMDER_CONFIG_DIR%\user_init.cmd" (
|
||||||
powershell -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"
|
powershell -executionpolicy bypass -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"
|
||||||
|
|
||||||
if not exist "%CMDER_ROOT%\config\user_init.cmd" (
|
if not exist "%CMDER_ROOT%\config\user_init.cmd" (
|
||||||
%print_error% "Failed to generate Cmder config"
|
%print_error% "Failed to generate Cmder config"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user