diff options
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index ad4d1ba84..f0648698c 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -917,7 +917,7 @@ public: virtual int Run() override; private: - ZenEntryPoint m_EntryPoint; + zen::ZenEntryPoint m_EntryPoint; }; int @@ -967,7 +967,6 @@ main(int argc, char* argv[]) try { -#if ZEN_PLATFORM_WINDOWS ZenServerOptions GlobalOptions; ZenServiceConfig ServiceConfig; ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig); @@ -978,6 +977,7 @@ main(int argc, char* argv[]) std::filesystem::create_directories(GlobalOptions.DataDir); } +#if ZEN_PLATFORM_WINDOWS if (GlobalOptions.InstallService) { WindowsService::Install(); @@ -995,8 +995,14 @@ main(int argc, char* argv[]) ZenWindowsService App(GlobalOptions, ServiceConfig); return App.ServiceMain(); #else - return 1; -#endif + if (GlobalOptions.InstallService || GlobalOptions.UninstallService) + { + throw std::runtime_error("Service mode is not supported on this platform"); + } + + ZenEntryPoint App(GlobalOptions, ServiceConfig); + return App.Run(); +#endif // ZEN_PLATFORM_WINDOWS } catch (std::exception& Ex) { |