From 94f785948bda6b32a2d23a937eeaee6add22b173 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 5 Feb 2012 17:41:40 +0700 Subject: [PATCH] Check that modules are in place on start. There're many people who forget to run "make install" and then wonder why they can't load any module. This should fix it, hopefully. --- src/main.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2aaa3cde..fbd196e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,12 +204,18 @@ int main(int argc, char** argv) { return 0; } -#ifndef RUN_FROM_SOURCE - if (CFile::Exists(pZNC->GetCurPath() + "/znc-uninstalled.pc")) { - CUtils::PrintError("It looks like you are running ZNC without installing it first."); - CUtils::PrintError("Recompile with --enable-run-from-source if you intend to do that."); + { + set ssGlobalMods; + pZNC->GetModules().GetAvailableMods(ssGlobalMods, CModInfo::GlobalModule); + if (ssGlobalMods.empty()) { + CUtils::PrintError("No modules found. Perhaps you didn't install ZNC properly?"); + CUtils::PrintError("Read http://wiki.znc.in/Installation for instructions."); + if (!CUtils::GetBoolInput("Do you really want to run ZNC without any modules?", false)) { + delete pZNC; + return 1; + } + } } -#endif if (isRoot()) { CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");