From 675dce9b94bcf482b4c6d3216628d89e1d352c8d Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 12 Aug 2020 21:16:06 +1000 Subject: [PATCH] Fix updating not working when running mono through wine (Thanks arydev) --- MCGalaxy/Server/Maintenance/Updater.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MCGalaxy/Server/Maintenance/Updater.cs b/MCGalaxy/Server/Maintenance/Updater.cs index 78ebfe0ce..2c41926aa 100644 --- a/MCGalaxy/Server/Maintenance/Updater.cs +++ b/MCGalaxy/Server/Maintenance/Updater.cs @@ -96,10 +96,11 @@ namespace MCGalaxy { string path = Path.Combine(Utils.FolderPath, "Updater.exe"); if (!File.Exists(path)) throw new FileNotFoundException("Unable to find " + path); - bool mono = Type.GetType("Mono.Runtime") != null; - if (!mono) { + try { Process.Start(path, "securitycheck10934579068013978427893755755270374" + exeName); - } else { + } catch { + if (Type.GetType("Mono.Runtime") == null) throw; + // if running on mono, try again with 'mono /usr/bin/MCGalaxyCLI.exe' instead Process.Start("mono", path + " securitycheck10934579068013978427893755755270374" + exeName); } Server.Stop(false, "Updating server.");