mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-13 13:17:55 +08:00
Merge remote-tracking branch 'origin' into user_lua
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
@ -61,6 +61,9 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<AdditionalManifestFiles>src/app.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||
</Manifest>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
@ -84,6 +87,9 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<AdditionalManifestFiles>src/app.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||
</Manifest>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
||||
</PostBuildEvent>
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#pragma comment(lib, "Shlwapi.lib")
|
||||
#pragma warning( disable : 4091 )
|
||||
|
||||
#ifndef UNICODE
|
||||
#error "Must be compiled with unicode support."
|
||||
@ -85,6 +86,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
||||
wchar_t userBinDirPath[MAX_PATH] = { 0 };
|
||||
wchar_t userProfiledDirPath[MAX_PATH] = { 0 };
|
||||
wchar_t userProfilePath[MAX_PATH] = { 0 };
|
||||
wchar_t legacyUserProfilePath[MAX_PATH] = { 0 };
|
||||
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
||||
|
||||
std::wstring cmderStart = path;
|
||||
@ -104,6 +107,21 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
|
||||
|
||||
PathCombine(configDirPath, exeDir, L"config");
|
||||
|
||||
PathCombine(legacyUserProfilePath, configDirPath, L"user-profile.cmd");
|
||||
if (PathFileExists(legacyUserProfilePath)) {
|
||||
PathCombine(userProfilePath, configDirPath, L"user_profile.cmd");
|
||||
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||
wcstombs_s(&i, pR, (size_t)MAX_PATH,
|
||||
userProfilePath, (size_t)MAX_PATH);
|
||||
rename(lPr, pR);
|
||||
}
|
||||
|
||||
if (wcscmp(userConfigDirPath, L"") == 0)
|
||||
{
|
||||
PathCombine(userConfigDirPath, exeDir, L"config");
|
||||
@ -118,6 +136,20 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
|
||||
PathCombine(userProfiledDirPath, userConfigDirPath, L"profile.d");
|
||||
SHCreateDirectoryEx(0, userProfiledDirPath, 0);
|
||||
|
||||
PathCombine(legacyUserProfilePath, userConfigDirPath, L"user-profile.cmd");
|
||||
if (PathFileExists(legacyUserProfilePath)) {
|
||||
PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd");
|
||||
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||
wcstombs_s(&i, pR, (size_t)MAX_PATH,
|
||||
userProfilePath, (size_t)MAX_PATH);
|
||||
rename(lPr, pR);
|
||||
}
|
||||
}
|
||||
|
||||
// Set path to vendored ConEmu config file
|
||||
@ -131,7 +163,6 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
||||
|
||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
|
||||
if (PathFileExists(cpuCfgPath)) {
|
||||
if (PathFileExists(cfgPath)) {
|
||||
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
||||
@ -334,6 +365,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
||||
HKEY cmderKey;
|
||||
// FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
|
||||
RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL);
|
||||
RegCloseKey(cmderKey);
|
||||
RegCloseKey(root);
|
||||
}
|
||||
@ -385,7 +417,7 @@ cmderOptions GetOption()
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
MessageBox(NULL, szArgList[i + 1], L"/START - Folder doses not exist!", MB_OK);
|
||||
MessageBox(NULL, szArgList[i + 1], L"/START - Folder does not exist!", MB_OK);
|
||||
}
|
||||
}
|
||||
else if (_wcsicmp(L"/task", szArgList[i]) == 0)
|
||||
|
Binary file not shown.
54
launcher/src/app.manifest
Normal file
54
launcher/src/app.manifest
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
|
||||
<!-- Project description definition -->
|
||||
<description>Cmder Console Emulator</description>
|
||||
|
||||
<!-- Project dependency definition -->
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0" processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
||||
<!-- Win32 User Account Control definition -->
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel
|
||||
level="asInvoker"
|
||||
uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<!-- Required for appcompat behaviour -->
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Add dpi awareness -->
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true/pm</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
|
||||
</assembly>
|
27
launcher/src/version.rc2.sample
Normal file
27
launcher/src/version.rc2.sample
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
/**
|
||||
* WARNING: do NOT modify this file! the content of this file should be
|
||||
* automatically genereted before AppVeyor builds using the
|
||||
* respective .ps1 Powershell scripts.
|
||||
*
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Define the version numbers and build information manually here:
|
||||
|
||||
#define CMDER_MAJOR_VERSION {Cmder-Major-Version}
|
||||
#define CMDER_MINOR_VERSION {Cmder-Minor-Version}
|
||||
#define CMDER_REVISION_VERSION {Cmder-Revision-Version}
|
||||
#define CMDER_BUILD_VERSION {Cmder-Build-Version}
|
||||
#define CMDER_VERSION_STR {Cmder-Version-Str}
|
||||
|
||||
#define CMDER_PRODUCT_NAME_STR "Cmder"
|
||||
#define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator."
|
||||
#define CMDER_INTERNAL_NAME_STR "Cmder"
|
||||
#define CMDER_ORIGINAL_FILENAME_STR "Cmder.exe"
|
||||
#define CMDER_COMPANY_NAME_STR "Samuel Vasko"
|
||||
#define CMDER_COPYRIGHT_YEAR_STR "2016"
|
||||
|
||||
#define CMDER_DEBUGFLAG 0x0L // set to 0x1L to enable debug mode
|
||||
#define CMDER_BUILDFLAGS 0x0L
|
||||
/////////////////////////////////////////////////////////////////////////////
|
Reference in New Issue
Block a user