From 2b6d90564fa3cf379cfd57dfbfdf4cf750e994b1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 31 Jul 2018 17:51:37 +0300 Subject: exe loader extracted to the separate module, now it's possible to compile all exe using shared runtime modules --- src/miranda32/miranda32.vcxproj | 8 ++------ src/miranda32/src/miranda.cpp | 27 ++------------------------- 2 files changed, 4 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/miranda32/miranda32.vcxproj b/src/miranda32/miranda32.vcxproj index 07b5c41cc1..de61c97157 100644 --- a/src/miranda32/miranda32.vcxproj +++ b/src/miranda32/miranda32.vcxproj @@ -39,14 +39,10 @@ res/miranda32.exe.manifest - - MultiThreadedDebug - - - MultiThreaded - type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) + ucrtbased.dll;vcruntime140.dll + ucrtbase.dll;api-ms-win-crt-heap-l1-1-0.dll;api-ms-win-crt-locale-l1-1-0.dll;api-ms-win-crt-math-l1-1-0.dll;api-ms-win-crt-runtime-l1-1-0.dll;api-ms-win-crt-stdio-l1-1-0.dll;VCRUNTIME140.dll \ No newline at end of file diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp index cf13b17cb0..97bc1f467b 100644 --- a/src/miranda32/src/miranda.cpp +++ b/src/miranda32/src/miranda.cpp @@ -23,8 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "stdafx.h" - -#pragma comment(lib, "delayimp.lib") +#include "..\..\build\appstub\appstub.cpp" typedef int (WINAPI *pfnMain)(LPTSTR); @@ -36,30 +35,8 @@ const wchar_t wszRuntimeUrl[] = L"https://download.visualstudio.microsoft.com/do const wchar_t wszQuestion[] = L"Miranda NG needs the Visual Studio runtime library, but it cannot be loaded. Do you want to load it from Inernet?"; -int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int) +int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPTSTR cmdLine, int) { - wchar_t wszPath[MAX_PATH]; - GetModuleFileNameW(hInstance, wszPath, _countof(wszPath)); - - // if current dir isn't set - for (int i = lstrlenW(wszPath); i >= 0; i--) - if (wszPath[i] == '\\') { - wszPath[i] = 0; - break; - } - - SetCurrentDirectoryW(wszPath); - - lstrcatW(wszPath, L"\\libs"); - SetDllDirectoryW(wszPath); - - #ifdef _DEBUG - lstrcatW(wszPath, L"\\ucrtbased.dll"); - #else - lstrcatW(wszPath, L"\\ucrtbase.dll"); - #endif - LoadLibraryW(wszPath); - int retVal; HINSTANCE hMirApp = LoadLibraryW(L"mir_app.mir"); if (hMirApp == nullptr) { -- cgit v1.2.3