From 73e1eb2a8bea93d4759f07cbb3a3145203c682fe Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 13:13:16 +0000 Subject: [PATCH] Ensure Environment Variables are propagated. --- launcher/src/CmderLauncher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index be99de7..6ac22e5 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -164,6 +164,10 @@ void StartCmder(std::wstring path, bool is_single_mode) GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); SetEnvironmentVariable(L"CMDER_START", buff); } + + // Ensure EnvironmentVariables are propagated. + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL); + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); // For Windows >= 8 STARTUPINFO si = { 0 }; si.cb = sizeof(STARTUPINFO);