Fix updating not working when running mono through wine (Thanks arydev)

This commit is contained in:
UnknownShadow200 2020-08-12 21:16:06 +10:00
parent 17b5aeb883
commit 675dce9b94

View File

@ -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.");