From 2db33523a1c8497657963a88f70fe1726cbf8fc9 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 23 Apr 2014 23:59:30 +0200 Subject: - added an option to show meta info on downloads instead of filenames - MO will now cancel if user tries to run MO vfs-injected - when saving the MO ini file it is now written to a tmp file first and then overwritten - updated to link against boost python 1.55 --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3b89e721..994dfd29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -139,6 +139,10 @@ bool bootstrap() // verify the hook-dll exists QString dllName = qApp->applicationDirPath() + "/" + ToQString(AppConfig::hookDLLName()); + if (::GetModuleHandleW(ToWString(dllName).c_str()) != NULL) { + throw std::runtime_error("hook.dll already loaded! You can't start Mod Organizer from within itself (not even indirectly)"); + } + HMODULE dllMod = ::LoadLibraryW(ToWString(dllName).c_str()); if (dllMod == NULL) { throw windows_error("hook.dll is missing or invalid"); @@ -311,7 +315,6 @@ bool HaveWriteAccess(const std::wstring &path) } - int main(int argc, char *argv[]) { MOApplication application(argc, argv); -- cgit v1.3.1