diff --git a/src/xrGame/MainMenu.cpp b/src/xrGame/MainMenu.cpp index cc069c7e885..896256664bc 100644 --- a/src/xrGame/MainMenu.cpp +++ b/src/xrGame/MainMenu.cpp @@ -26,8 +26,10 @@ #include "ui/UICDkey.h" +#ifdef WINDOWS #include #pragma comment(lib, "shell32.lib") +#endif #include "Common/object_broker.h" @@ -848,9 +850,14 @@ void CMainMenu::OnDownloadMPMap_CopyURL(CUIWindow* w, void* d) void CMainMenu::OnDownloadMPMap(CUIWindow* w, void* d) { LPCSTR url = m_downloaded_mp_map_url.c_str(); +#ifdef WINDOWS LPCSTR params = NULL; STRCONCAT(params, "/C start ", url); ShellExecute(0, "open", "cmd.exe", params, NULL, SW_SHOW); +#else + std::string command = "xdg-open " + std::string{url}; + system(command.c_str()); +#endif } demo_info const* CMainMenu::GetDemoInfo(LPCSTR file_name) diff --git a/src/xrGame/login_manager.cpp b/src/xrGame/login_manager.cpp index a549fb3b038..10513853748 100644 --- a/src/xrGame/login_manager.cpp +++ b/src/xrGame/login_manager.cpp @@ -407,9 +407,14 @@ bool login_manager::get_remember_me_from_registry() void login_manager::forgot_password(char const* url) { +#ifdef WINDOWS LPCSTR params = NULL; STRCONCAT(params, "/C start ", url); ShellExecute(0, "open", "cmd.exe", params, NULL, SW_SHOW); +#else + std::string command = "xdg-open " + std::string{url}; + system(command.c_str()); +#endif } } // namespace gamespy_gp