mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	Revert "Set CMDER_START to homeprofile"
This reverts commit 728e83a85b.
The problem with *always* setting CMDER_START is that this makes the
`-new_console:d:%USERPROFILE%` in the conemu task definitions unnecessary, as
this is now always overwritten as CMDER_START is set. This also means that a
very visible conemu UI for setting the startup dir does not work anymore which
might leave the user puzzled why.
			
			
This commit is contained in:
		| @@ -3,7 +3,6 @@ | |||||||
| #include <Shlwapi.h> | #include <Shlwapi.h> | ||||||
| #include "resource.h" | #include "resource.h" | ||||||
| #include <vector> | #include <vector> | ||||||
| #include <Shlobj.h> |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #pragma comment(lib, "Shlwapi.lib") | #pragma comment(lib, "Shlwapi.lib") | ||||||
| @@ -156,16 +155,7 @@ void StartCmder(std::wstring path, bool is_single_mode) | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	SetEnvironmentVariable(L"CMDER_ROOT", exeDir); | 	SetEnvironmentVariable(L"CMDER_ROOT", exeDir); | ||||||
| 	if (streqi(path.c_str(), L"")) | 	if (!streqi(path.c_str(), L"")) | ||||||
| 	{ |  | ||||||
| 		wchar_t* homeProfile = 0; |  | ||||||
| 		SHGetKnownFolderPath(FOLDERID_Profile, 0, NULL, &homeProfile); |  | ||||||
| 		if (!SetEnvironmentVariable(L"CMDER_START", homeProfile)) { |  | ||||||
| 			MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK); |  | ||||||
| 		} |  | ||||||
| 		CoTaskMemFree(static_cast<void*>(homeProfile)); |  | ||||||
| 	} |  | ||||||
| 	else |  | ||||||
| 	{ | 	{ | ||||||
| 		if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) { | 		if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) { | ||||||
| 			MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK); | 			MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user