From 2ee00c2b3a3c453b7e4fa58267467afaca650111 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Sun, 20 Mar 2022 12:16:28 +0200 Subject: [PATCH] Weather: Fixed bug where the widget fails to start on new installs due to ExplorerPatcher not existing in `%APPDATA%` --- ExplorerPatcher/dllmain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index e7b383e..b2808bd 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -9072,6 +9072,14 @@ DWORD Inject(BOOL bIsExplorer) wprintf(L"Running on Windows %d, OS Build %d.%d.%d.%d.\n", IsWindows11() ? 11 : 10, global_rovi.dwMajorVersion, global_rovi.dwMinorVersion, global_rovi.dwBuildNumber, global_ubr); #endif + WCHAR wszPath[MAX_PATH]; + SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wszPath); + wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH)); + if (!PathFileExistsW(wszPath)) + { + CreateDirectoryW(wszPath, NULL); + } + #ifdef _WIN64 wszEPWeatherKillswitch = calloc(sizeof(WCHAR), MAX_PATH); srand(time(NULL));