mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Delay initialization of AppModule until after we set DLL paths
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#include "MachineInstaller.h"
|
#include "MachineInstaller.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
CAppModule _Module;
|
CAppModule* _Module;
|
||||||
|
|
||||||
typedef BOOL(WINAPI *SetDefaultDllDirectoriesFunction)(DWORD DirectoryFlags);
|
typedef BOOL(WINAPI *SetDefaultDllDirectoriesFunction)(DWORD DirectoryFlags);
|
||||||
|
|
||||||
@@ -42,7 +42,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||||||
ATLASSERT(SUCCEEDED(hr));
|
ATLASSERT(SUCCEEDED(hr));
|
||||||
|
|
||||||
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);
|
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);
|
||||||
hr = _Module.Init(NULL, hInstance);
|
_Module = new CAppModule();
|
||||||
|
hr = _Module->Init(NULL, hInstance);
|
||||||
|
|
||||||
bool isQuiet = (cmdLine.Find(L"-s") >= 0);
|
bool isQuiet = (cmdLine.Find(L"-s") >= 0);
|
||||||
bool weAreUACElevated = CUpdateRunner::AreWeUACElevated() == S_OK;
|
bool weAreUACElevated = CUpdateRunner::AreWeUACElevated() == S_OK;
|
||||||
@@ -92,7 +93,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||||||
exitCode = CUpdateRunner::ExtractUpdaterAndRun(lpCmdLine, false);
|
exitCode = CUpdateRunner::ExtractUpdaterAndRun(lpCmdLine, false);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
_Module.Term();
|
_Module->Term();
|
||||||
::CoUninitialize();
|
::CoUninitialize();
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user