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 <cstdio>
|
||||
|
||||
CAppModule _Module;
|
||||
CAppModule* _Module;
|
||||
|
||||
typedef BOOL(WINAPI *SetDefaultDllDirectoriesFunction)(DWORD DirectoryFlags);
|
||||
|
||||
@@ -42,7 +42,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
ATLASSERT(SUCCEEDED(hr));
|
||||
|
||||
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 weAreUACElevated = CUpdateRunner::AreWeUACElevated() == S_OK;
|
||||
@@ -92,7 +93,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
exitCode = CUpdateRunner::ExtractUpdaterAndRun(lpCmdLine, false);
|
||||
|
||||
out:
|
||||
_Module.Term();
|
||||
_Module->Term();
|
||||
::CoUninitialize();
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user