From e5c4e8bf027ce61e7f8ea89b3d61611be3a911d8 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 24 Jan 2022 18:33:06 +0200 Subject: [PATCH] Moved ep_dwm as separate executable --- ExplorerPatcher.sln | 9 ++ ExplorerPatcher/ExplorerPatcher.vcxproj | 10 +- .../ExplorerPatcher.vcxproj.filters | 13 +-- ExplorerPatcher/GUI.c | 98 +--------------- ExplorerPatcher/def.h | 21 ++++ ExplorerPatcher/dllmain.c | 7 -- ExplorerPatcher/utility.c | 108 ++++++++++++++++++ ExplorerPatcher/utility.h | 19 +-- ep_dwm | 2 +- ep_setup/ep_setup.c | 54 ++++++++- ep_setup/ep_setup.rc | 2 + ep_setup/ep_setup.vcxproj | 12 ++ ep_setup/ep_setup.vcxproj.filters | 2 + ep_setup/ep_setup_debug.rc | 2 + ep_setup/resource.h | 1 + 15 files changed, 218 insertions(+), 142 deletions(-) create mode 100644 ExplorerPatcher/def.h diff --git a/ExplorerPatcher.sln b/ExplorerPatcher.sln index 4427751..ea96bec 100644 --- a/ExplorerPatcher.sln +++ b/ExplorerPatcher.sln @@ -12,6 +12,7 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_setup", "ep_setup\ep_setup.vcxproj", "{2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}" ProjectSection(ProjectDependencies) = postProject {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9} = {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9} + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87} = {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_setup_patch", "ep_setup_patch\ep_setup_patch.vcxproj", "{0C13E5F3-106B-4836-A7C2-8E5808A6ED78}" @@ -19,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_setup_patch", "ep_setup_ {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF} = {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_dwm", "ep_dwm\ep_dwm\ep_dwm.vcxproj", "{1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|amd64 = Debug|amd64 @@ -59,6 +62,12 @@ Global {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|amd64.ActiveCfg = Release|x64 {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|amd64.Build.0 = Release|x64 {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|IA-32.ActiveCfg = Release|Win32 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|amd64.ActiveCfg = Debug|x64 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|amd64.Build.0 = Debug|x64 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|IA-32.ActiveCfg = Debug|x64 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|amd64.ActiveCfg = Release|x64 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|amd64.Build.0 = Release|x64 + {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|IA-32.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ExplorerPatcher/ExplorerPatcher.vcxproj b/ExplorerPatcher/ExplorerPatcher.vcxproj index 558c947..857e4f6 100644 --- a/ExplorerPatcher/ExplorerPatcher.vcxproj +++ b/ExplorerPatcher/ExplorerPatcher.vcxproj @@ -201,14 +201,6 @@ - - EP_DWM_NO_DLLMAIN;EP_DWM_NO_EXPORTS;%(PreprocessorDefinitions) - EP_DWM_NO_DLLMAIN;EP_DWM_NO_EXPORTS;%(PreprocessorDefinitions) - EP_DWM_NO_DLLMAIN;EP_DWM_NO_EXPORTS;%(PreprocessorDefinitions) - EP_DWM_NO_DLLMAIN;EP_DWM_NO_EXPORTS;%(PreprocessorDefinitions) - true - true - true true @@ -300,7 +292,6 @@ - @@ -315,6 +306,7 @@ + diff --git a/ExplorerPatcher/ExplorerPatcher.vcxproj.filters b/ExplorerPatcher/ExplorerPatcher.vcxproj.filters index a2249ae..5f3ad00 100644 --- a/ExplorerPatcher/ExplorerPatcher.vcxproj.filters +++ b/ExplorerPatcher/ExplorerPatcher.vcxproj.filters @@ -28,12 +28,6 @@ {190d08ad-4a1d-4b58-81a1-6403eeb3cd2a} - - {50a6ac61-12c4-460e-a9d1-cdaf9bf7e7b1} - - - {fd25654b-7123-401a-86c7-90413d703f30} - @@ -129,8 +123,8 @@ Header Files\sws - - Header Files\ep_dwm + + Header Files @@ -211,9 +205,6 @@ Source Files\sws - - Source Files\ep_dwm - diff --git a/ExplorerPatcher/GUI.c b/ExplorerPatcher/GUI.c index c70af6a..f645ded 100644 --- a/ExplorerPatcher/GUI.c +++ b/ExplorerPatcher/GUI.c @@ -327,101 +327,7 @@ LSTATUS GUI_Internal_RegSetValueExW( } else if (!wcscmp(lpValueName, L"Virtualized_" _T(EP_CLSID) L"_DisableRoundedCorners")) { - WCHAR wszPath[MAX_PATH]; - GetSystemDirectoryW(wszPath, MAX_PATH); - wcscat_s(wszPath, MAX_PATH, L"\\cmd.exe"); - - WCHAR wszSCPath[MAX_PATH]; - GetSystemDirectoryW(wszSCPath, MAX_PATH); - wcscat_s(wszSCPath, MAX_PATH, L"\\sc.exe"); - - WCHAR wszRundll32[MAX_PATH]; - GetSystemDirectoryW(wszRundll32, MAX_PATH); - wcscat_s(wszRundll32, MAX_PATH, L"\\rundll32.exe"); - - WCHAR wszEP[MAX_PATH]; - GetWindowsDirectoryW(wszEP, MAX_PATH); - wcscat_s(wszEP, MAX_PATH, L"\\dxgi.dll"); - - WCHAR wszTaskkill[MAX_PATH]; - GetSystemDirectoryW(wszTaskkill, MAX_PATH); - wcscat_s(wszTaskkill, MAX_PATH, L"\\taskkill.exe"); - - WCHAR wszArgumentsRegister[MAX_PATH * 10]; - swprintf_s( - wszArgumentsRegister, - MAX_PATH * 10, - L"/c \"" - L"\"%s\" create ep_dwm_" _T(EP_CLSID_LITE) L" binPath= \"\\\"%s\\\" \\\"%s\\\",ZZDWM\" DisplayName= \"ExplorerPatcher Desktop Window Manager Service\" start= auto & " - L"\"%s\" description ep_dwm_" _T(EP_CLSID_LITE) L" \"Implements functionality to disable rounded corners for windows\" & " - L"\"%s\" start ep_dwm_" _T(EP_CLSID_LITE) - L"\"", - wszSCPath, - wszRundll32, - wszEP, - wszSCPath, - wszSCPath - ); - WCHAR wszArgumentsUnRegister[MAX_PATH * 10]; - swprintf_s( - wszArgumentsUnRegister, - MAX_PATH * 10, - L"/c \"" - L"\"%s\" stop ep_dwm_" _T(EP_CLSID_LITE) L" & " - L"\"%s\" delete ep_dwm_" _T(EP_CLSID_LITE) L" & " - L"\"", - wszSCPath, - wszSCPath - ); - wprintf(L"%s\n", wszArgumentsRegister); - - BOOL bAreRoundedCornersDisabled = FALSE; - HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, L"Global\\ep_dwm_" _T(EP_CLSID)); - if (h_exists) - { - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - bAreRoundedCornersDisabled = TRUE; - } - else - { - bAreRoundedCornersDisabled = FALSE; - } - CloseHandle(h_exists); - } - else - { - if (GetLastError() == ERROR_ACCESS_DENIED) - { - bAreRoundedCornersDisabled = TRUE; - } - else - { - bAreRoundedCornersDisabled = FALSE; - } - } - if ((bAreRoundedCornersDisabled && *(DWORD*)lpData) || (!bAreRoundedCornersDisabled && !*(DWORD*)lpData)) - { - return ERROR_SUCCESS; - } - SHELLEXECUTEINFO ShExecInfo = { 0 }; - ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); - ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; - ShExecInfo.hwnd = NULL; - ShExecInfo.lpVerb = L"runas"; - ShExecInfo.lpFile = wszPath; - ShExecInfo.lpParameters = !bAreRoundedCornersDisabled ? wszArgumentsRegister : wszArgumentsUnRegister; - ShExecInfo.lpDirectory = NULL; - ShExecInfo.nShow = SW_HIDE; - ShExecInfo.hInstApp = NULL; - if (ShellExecuteExW(&ShExecInfo) && ShExecInfo.hProcess) - { - WaitForSingleObject(ShExecInfo.hProcess, INFINITE); - DWORD dwExitCode = 0; - GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode); - CloseHandle(ShExecInfo.hProcess); - } - return ERROR_SUCCESS; + return RegisterDWMService(*(DWORD*)lpData, 0); } else if (!wcscmp(lpValueName, L"Virtualized_" _T(EP_CLSID) L"_RegisterAsShellExtension")) { @@ -612,7 +518,7 @@ LSTATUS GUI_Internal_RegQueryValueExW( } else if (!wcscmp(lpValueName, L"Virtualized_" _T(EP_CLSID) L"_DisableRoundedCorners")) { - HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, L"Global\\ep_dwm_" _T(EP_CLSID)); + HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, _T(EP_DWM_EVENTNAME)); if (h_exists) { if (GetLastError() == ERROR_ALREADY_EXISTS) diff --git a/ExplorerPatcher/def.h b/ExplorerPatcher/def.h new file mode 100644 index 0000000..14a52c5 --- /dev/null +++ b/ExplorerPatcher/def.h @@ -0,0 +1,21 @@ +#ifndef _H_DEF_H_ +#define _H_DEF_H_ +#define APPID L"Microsoft.Windows.Explorer" +#define REGPATH "SOFTWARE\\ExplorerPatcher" +#define REGPATH_OLD "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ExplorerPatcher" +#define REGPATH_STARTMENU REGPATH_OLD +#define SPECIAL_FOLDER CSIDL_PROGRAM_FILES +#define SPECIAL_FOLDER_LEGACY CSIDL_APPDATA +#define PRODUCT_NAME "ExplorerPatcher" +#define PRODUCT_PUBLISHER "VALINET Solutions SRL" +#define APP_RELATIVE_PATH "\\" PRODUCT_NAME +#define EP_CLSID_LITE "D17F1E1A-5919-4427-8F89-A1A8503CA3EB" +#define EP_CLSID "{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}" +#define DOSMODE_OFFSET 78 +#define SETUP_UTILITY_NAME "ep_setup.exe" +#define TOAST_BUFSIZ 1024 +#define SEH_REGPATH "Control Panel\\Quick Actions\\Control Center\\QuickActionsStateCapture\\ExplorerPatcher" +#define EP_SETUP_HELPER_SWITCH "/CreateExplorerShellUnelevatedAfterServicing" +#define EP_DWM_SERVICENAME "ep_dwm_" EP_CLSID_LITE +#define EP_DWM_EVENTNAME "Global\\ep_dwm_2_" EP_CLSID_LITE +#endif \ No newline at end of file diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index e44d372..1b341d6 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -162,13 +162,6 @@ HRESULT WINAPI _DllGetClassObject( REFIID riid, LPVOID* ppv ); -#ifdef _WIN64 -BOOL ep_dwm_StartService(LPWSTR wszServiceName, LPWSTR wszEventName); -__declspec(dllexport) int ZZDWM(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow) -{ - ep_dwm_StartService(L"ep_dwm_Service_" _T(EP_CLSID), L"Global\\ep_dwm_" _T(EP_CLSID)); -} -#endif #pragma region "Updates" #ifdef _WIN64 diff --git a/ExplorerPatcher/utility.c b/ExplorerPatcher/utility.c index 2673635..43994f5 100644 --- a/ExplorerPatcher/utility.c +++ b/ExplorerPatcher/utility.c @@ -681,3 +681,111 @@ void ToggleTaskbarAutohide() SHAppBarMessage(ABM_SETSTATE, &abd); } } + +LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride) +{ + WCHAR wszPath[MAX_PATH]; + GetSystemDirectoryW(wszPath, MAX_PATH); + wcscat_s(wszPath, MAX_PATH, L"\\cmd.exe"); + + WCHAR wszSCPath[MAX_PATH]; + GetSystemDirectoryW(wszSCPath, MAX_PATH); + wcscat_s(wszSCPath, MAX_PATH, L"\\sc.exe"); + + WCHAR wszRundll32[MAX_PATH]; + SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszRundll32); + wcscat_s(wszRundll32, MAX_PATH, _T(APP_RELATIVE_PATH)); + wcscat_s(wszRundll32, MAX_PATH, L"\\ep_dwm.exe"); + + WCHAR wszEP[MAX_PATH]; + GetWindowsDirectoryW(wszEP, MAX_PATH); + wcscat_s(wszEP, MAX_PATH, L"\\dxgi.dll"); + + WCHAR wszTaskkill[MAX_PATH]; + GetSystemDirectoryW(wszTaskkill, MAX_PATH); + wcscat_s(wszTaskkill, MAX_PATH, L"\\taskkill.exe"); + + WCHAR wszArgumentsRegister[MAX_PATH * 10]; + swprintf_s( + wszArgumentsRegister, + MAX_PATH * 10, + L"/c \"" + L"\"%s\" create " _T(EP_DWM_SERVICENAME) L" binPath= \"\\\"%s\\\" %s\" DisplayName= \"ExplorerPatcher Desktop Window Manager Service\" start= auto & " + L"\"%s\" description " _T(EP_DWM_SERVICENAME) L" \"Service for managing aspects related to the Desktop Window Manager.\" & " + L"\"%s\" %s " _T(EP_DWM_SERVICENAME) + L"\"", + wszSCPath, + wszRundll32, + _T(EP_DWM_SERVICENAME) L" " _T(EP_DWM_EVENTNAME), + wszSCPath, + wszSCPath, + (!dwOverride || dwOverride == 3) ? L"start" : L"query" + ); + WCHAR wszArgumentsUnRegister[MAX_PATH * 10]; + swprintf_s( + wszArgumentsUnRegister, + MAX_PATH * 10, + L"/c \"" + L"\"%s\" stop " _T(EP_DWM_SERVICENAME) L" & " + L"\"%s\" delete " _T(EP_DWM_SERVICENAME) L" & " + L"\"", + wszSCPath, + wszSCPath + ); + wprintf(L"%s\n", wszArgumentsRegister); + + BOOL bAreRoundedCornersDisabled = FALSE; + if (dwOverride) + { + bAreRoundedCornersDisabled = !(dwOverride - 1); + } + else + { + HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, _T(EP_DWM_EVENTNAME)); + if (h_exists) + { + if (GetLastError() == ERROR_ALREADY_EXISTS) + { + bAreRoundedCornersDisabled = TRUE; + } + else + { + bAreRoundedCornersDisabled = FALSE; + } + CloseHandle(h_exists); + } + else + { + if (GetLastError() == ERROR_ACCESS_DENIED) + { + bAreRoundedCornersDisabled = TRUE; + } + else + { + bAreRoundedCornersDisabled = FALSE; + } + } + if ((bAreRoundedCornersDisabled && dwDesiredState) || (!bAreRoundedCornersDisabled && !dwDesiredState)) + { + return FALSE; + } + } + SHELLEXECUTEINFO ShExecInfo = { 0 }; + ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); + ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; + ShExecInfo.hwnd = NULL; + ShExecInfo.lpVerb = L"runas"; + ShExecInfo.lpFile = wszPath; + ShExecInfo.lpParameters = !bAreRoundedCornersDisabled ? wszArgumentsRegister : wszArgumentsUnRegister; + ShExecInfo.lpDirectory = NULL; + ShExecInfo.nShow = SW_HIDE; + ShExecInfo.hInstApp = NULL; + if (ShellExecuteExW(&ShExecInfo) && ShExecInfo.hProcess) + { + WaitForSingleObject(ShExecInfo.hProcess, INFINITE); + DWORD dwExitCode = 0; + GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode); + CloseHandle(ShExecInfo.hProcess); + } + return TRUE; +} \ No newline at end of file diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index a70ffc6..3903a79 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -19,22 +19,7 @@ #include "queryversion.h" #pragma comment(lib, "Psapi.lib") -#define APPID L"Microsoft.Windows.Explorer" -#define REGPATH "SOFTWARE\\ExplorerPatcher" -#define REGPATH_OLD "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ExplorerPatcher" -#define REGPATH_STARTMENU REGPATH_OLD -#define SPECIAL_FOLDER CSIDL_PROGRAM_FILES -#define SPECIAL_FOLDER_LEGACY CSIDL_APPDATA -#define PRODUCT_NAME "ExplorerPatcher" -#define PRODUCT_PUBLISHER "VALINET Solutions SRL" -#define APP_RELATIVE_PATH "\\" PRODUCT_NAME -#define EP_CLSID_LITE "D17F1E1A-5919-4427-8F89-A1A8503CA3EB" -#define EP_CLSID "{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}" -#define DOSMODE_OFFSET 78 -#define SETUP_UTILITY_NAME "ep_setup.exe" -#define TOAST_BUFSIZ 1024 -#define SEH_REGPATH "Control Panel\\Quick Actions\\Control Center\\QuickActionsStateCapture\\ExplorerPatcher" -#define EP_SETUP_HELPER_SWITCH "/CreateExplorerShellUnelevatedAfterServicing" +#include "def.h" #define WM_MSG_GUI_SECTION WM_USER + 1 #define WM_MSG_GUI_SECTION_GET 1 @@ -249,6 +234,8 @@ void LaunchPropertiesGUI(HMODULE hModule); BOOL SystemShutdown(BOOL reboot); +LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride); + inline long long milliseconds_now() { LARGE_INTEGER s_frequency; BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency); diff --git a/ep_dwm b/ep_dwm index e058f2e..cb881d8 160000 --- a/ep_dwm +++ b/ep_dwm @@ -1 +1 @@ -Subproject commit e058f2e8cc13dc094ba55f472a1ade969d260526 +Subproject commit cb881d8bcc22bfb518782f340e03aa7c3204a6f7 diff --git a/ep_setup/ep_setup.c b/ep_setup/ep_setup.c index cfad35a..0db9ad4 100644 --- a/ep_setup/ep_setup.c +++ b/ep_setup/ep_setup.c @@ -333,6 +333,19 @@ int WINAPI wWinMain( wcscat_s(wszPath, MAX_PATH, L"\\" _T(PRODUCT_NAME) L".amd64.dll"); bOk = InstallResource(TRUE, hInstance, IDR_EP_AMD64, wszPath); } + if (argc >= 2) + { + wcsncpy_s(wszPath, MAX_PATH, wargv[1], MAX_PATH); + } + else + { + GetCurrentDirectoryW(MAX_PATH, wszPath); + } + if (bOk) + { + wcscat_s(wszPath, MAX_PATH, L"\\ep_dwm.exe"); + bOk = InstallResource(TRUE, hInstance, IDR_EP_DWM, wszPath); + } return 0; } @@ -434,6 +447,37 @@ int WINAPI wWinMain( CloseHandle(sei.hProcess); } + BOOL bAreRoundedCornersDisabled = FALSE; + HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, L"Global\\ep_dwm_" _T(EP_CLSID)); + if (h_exists) + { + if (GetLastError() == ERROR_ALREADY_EXISTS) + { + bAreRoundedCornersDisabled = TRUE; + } + else + { + bAreRoundedCornersDisabled = FALSE; + } + CloseHandle(h_exists); + } + else + { + if (GetLastError() == ERROR_ACCESS_DENIED) + { + bAreRoundedCornersDisabled = TRUE; + } + else + { + bAreRoundedCornersDisabled = FALSE; + } + } + if (bAreRoundedCornersDisabled) + { + RegisterDWMService(0, 1); + RegisterDWMService(0, 3); + } + WCHAR wszSCPath[MAX_PATH]; GetSystemDirectoryW(wszSCPath, MAX_PATH); wcscat_s(wszSCPath, MAX_PATH, L"\\sc.exe"); @@ -443,7 +487,7 @@ int WINAPI wWinMain( ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = L"runas"; ShExecInfo.lpFile = wszSCPath; - ShExecInfo.lpParameters = L"stop ep_dwm_" _T(EP_CLSID_LITE); + ShExecInfo.lpParameters = L"stop " _T(EP_DWM_SERVICENAME); ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_HIDE; ShExecInfo.hInstApp = NULL; @@ -579,6 +623,12 @@ int WINAPI wWinMain( bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath); } if (bOk) + { + PathRemoveFileSpecW(wszPath); + wcscat_s(wszPath, MAX_PATH, L"\\ep_dwm.exe"); + bOk = InstallResource(bInstall, hInstance, IDR_EP_DWM, wszPath); + } + if (bOk) { bOk = GetWindowsDirectoryW(wszPath, MAX_PATH); } @@ -612,7 +662,7 @@ int WINAPI wWinMain( wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(SETUP_UTILITY_NAME) L"\" /uninstall"); bOk = SetupUninstallEntry(bInstall, wszPath); } - ShExecInfo.lpParameters = bInstall ? L"start ep_dwm_" _T(EP_CLSID_LITE) : L"delete ep_dwm_" _T(EP_CLSID_LITE); + ShExecInfo.lpParameters = bInstall ? L"start " _T(EP_DWM_SERVICENAME) : L"delete " _T(EP_DWM_SERVICENAME); if (ShellExecuteExW(&ShExecInfo) && ShExecInfo.hProcess) { WaitForSingleObject(ShExecInfo.hProcess, INFINITE); diff --git a/ep_setup/ep_setup.rc b/ep_setup/ep_setup.rc index 0359bd4..2a9389a 100644 --- a/ep_setup/ep_setup.rc +++ b/ep_setup/ep_setup.rc @@ -94,6 +94,8 @@ IDR_EP_AMD64 RCDATA "..\\build\\Release\\ExplorerPatcher. IDR_EP_IA32 RCDATA "..\\build\\Release\\ExplorerPatcher.IA-32.dll" +IDR_EP_DWM RCDATA "..\\build\\Release\\ep_dwm.exe" + #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/ep_setup/ep_setup.vcxproj b/ep_setup/ep_setup.vcxproj index 9b5c907..4942bc2 100644 --- a/ep_setup/ep_setup.vcxproj +++ b/ep_setup/ep_setup.vcxproj @@ -169,6 +169,10 @@ + + true + true + true true @@ -177,6 +181,14 @@ true true + + true + true + + + + + true true diff --git a/ep_setup/ep_setup.vcxproj.filters b/ep_setup/ep_setup.vcxproj.filters index f11db67..1e63132 100644 --- a/ep_setup/ep_setup.vcxproj.filters +++ b/ep_setup/ep_setup.vcxproj.filters @@ -46,5 +46,7 @@ + + \ No newline at end of file diff --git a/ep_setup/ep_setup_debug.rc b/ep_setup/ep_setup_debug.rc index 5bbe6b2..597f277 100644 --- a/ep_setup/ep_setup_debug.rc +++ b/ep_setup/ep_setup_debug.rc @@ -94,6 +94,8 @@ IDR_EP_AMD64 RCDATA "..\\build\\Debug\\ExplorerPatcher.am IDR_EP_IA32 RCDATA "..\\build\\Debug\\ExplorerPatcher.IA-32.dll" +IDR_EP_DWM RCDATA "..\\build\\Debug\\ep_dwm.exe" + #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/ep_setup/resource.h b/ep_setup/resource.h index 6be02ae..a26c845 100644 --- a/ep_setup/resource.h +++ b/ep_setup/resource.h @@ -4,6 +4,7 @@ // #define IDR_EP_AMD64 103 #define IDR_EP_IA32 104 +#define IDR_EP_DWM 105 // Next default values for new objects //