Exemplo n.º 1
0
        public void PatchScrollsWindows()
        {
            String URL;

            if (Platform.getOS() == Platform.OS.Win)
            {
                URL = "http://download.scrolls.com/client/windows.zip";
            }
            else
            {
                URL = "http://download.scrolls.com/client/mac.zip";
            }

            String gameFolder = Path.GetFullPath(Directory.GetParent(Platform.getGlobalScrollsInstallPath()).Parent.Parent.Parent.FullName) + Path.DirectorySeparatorChar;

            //wait
            WebClientTimeOut webClient = new WebClientTimeOut();

            if (File.Exists(gameFolder + "game.zip"))
            {
                File.Delete(gameFolder + "game.zip");
            }
            try
            {
                webClient.DownloadFile(URL, gameFolder + "game.zip");
            }
            catch (WebException)
            {
                App.Popups.KillCurrentPopup();
                App.Popups.ShowOk(null, "info", "Error", "And error occured while downloading the update.", "OK");
                return;
            }

            //backup assembly
            String backupPath = gameFolder + "ScrollsModLoader.dll";

            if (File.Exists(backupPath))
            {
                File.Delete(backupPath);
            }
            File.Copy(Platform.getGlobalScrollsInstallPath() + "ScrollsModLoader.dll", backupPath);

            //backup modloader folder
            String modBackupPath = gameFolder + "ModLoader" + Path.DirectorySeparatorChar;

            if (Directory.Exists(modBackupPath))
            {
                Extensions.DeleteDirectory(modBackupPath);
            }
            Directory.Move(Platform.getGlobalScrollsInstallPath() + "ModLoader", modBackupPath);
            File.Delete(modBackupPath + "mods.ini");
            File.Delete(modBackupPath + "Assembly-CSharp.dll");

            if (Platform.getOS() == Platform.OS.Win)
            {
                Extensions.DeleteDirectory(gameFolder + "game");
            }
            else
            {
                Extensions.DeleteDirectory(gameFolder + "MacScrolls.app");
            }

            //extract
            ZipFile zip = ZipFile.Read(gameFolder + "game.zip");

            foreach (ZipEntry e in zip)
            {
                e.Extract(gameFolder + "game");
            }

            //move assembly
            File.Copy(backupPath, Platform.getGlobalScrollsInstallPath() + "ScrollsModLoader.dll");
            // File.Delete(backupPath);

            //move modloader folder back
            Directory.Move(modBackupPath, Platform.getGlobalScrollsInstallPath() + "ModLoader");

            //make new repatch backup
            File.Copy(Platform.getGlobalScrollsInstallPath() + "Assembly-CSharp.dll", Platform.getGlobalScrollsInstallPath() + "ModLoader" + Path.DirectorySeparatorChar + "Assembly-CSharp.dll");

            //make sure mods get hooks set with new version
            File.Delete(Platform.getGlobalScrollsInstallPath() + "ModLoader" + Path.DirectorySeparatorChar + "mods.ini");
            ScrollsFilter.clearHooks();
            Console.WriteLine("Cleared Hooks");

            //repatch
            Patcher patcher = new Patcher();

            if (!patcher.patchAssembly(Platform.getGlobalScrollsInstallPath()))
            {
                if (!patcher.safeModePatchAssembly())
                {
                    Dialogs.showNotification("Summoner patch failed", "Summoner failed in patch itself into the updated files. It will uninstall itself. For more informations visit scrollsguide.com/summoner");
                    File.Delete(Platform.getGlobalScrollsInstallPath() + "ScrollsModLoader.dll");
                    Extensions.DeleteDirectory(Platform.getGlobalScrollsInstallPath() + "ModLoader");
                }
            }

            Console.WriteLine("Now restarting the game...");

            //restart the game
            Platform.RestartGame();
        }
Exemplo n.º 2
0
        public static void standalonePatch()
        {
            bool writetofile = true;             //(Platform.getOS () == Platform.OS.Mac);

            Platform.ErrorLog("stand alone patch");
            Console.WriteLine("Preparing...");
            if (writetofile)
            {
                Platform.ErrorLog("Preparing...");
            }

            //get Path of Scrolls Data Folder
            String installPath   = Platform.getGlobalScrollsInstallPath();
            String modloaderpath = Platform.getModLoaderPath();

            if (installPath == null)
            {
                return;
            }
            Console.WriteLine("installpath: " + installPath);
            if (writetofile)
            {
                Platform.ErrorLog("installpath: " + installPath);
            }
            Console.WriteLine("Creating ModLoader folder...");
            if (writetofile)
            {
                Platform.ErrorLog("Creating ModLoader folder...");
            }
            //create modloader folder
            if (!System.IO.Directory.Exists(modloaderpath))
            {
                System.IO.Directory.CreateDirectory(modloaderpath);
            }

            Console.WriteLine("Backup/Reset assembly...");
            if (writetofile)
            {
                Platform.ErrorLog("Backup/Reset assembly...");
            }

            //backup original assembly
            if (!System.IO.File.Exists(modloaderpath + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll"))
            {
                System.IO.File.Copy(installPath + "Assembly-CSharp.dll", modloaderpath + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll");
            }
            else
            {
                //if a backup already exists, it is much more likely that the current assembly is messed up and the user wants to repatch
                System.IO.File.Delete(installPath + "Assembly-CSharp.dll");
                System.IO.File.Copy(modloaderpath + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll", installPath + "Assembly-CSharp.dll");
            }

            Console.WriteLine("Copying ModLoader.dll...");
            if (writetofile)
            {
                Platform.ErrorLog("Copying ModLoader.dll...");
            }
            //copy modloader for patching
            if (System.IO.File.Exists(installPath + "ScrollsModLoader.dll"))
            {
                System.IO.File.Delete(installPath + "ScrollsModLoader.dll");
            }
            System.IO.File.Copy(System.Reflection.Assembly.GetExecutingAssembly().Location, installPath + "ScrollsModLoader.dll");

            //reset ini
            if (System.IO.File.Exists(modloaderpath + System.IO.Path.DirectorySeparatorChar + "mods.ini"))
            {
                System.IO.File.Delete(modloaderpath + System.IO.Path.DirectorySeparatorChar + "mods.ini");
            }



            Console.WriteLine("Create shortcut...");
            if (writetofile)
            {
                Platform.ErrorLog("Create shortcut...");
            }
            string ddsc = System.IO.Path.DirectorySeparatorChar + "";

            String apppath = "";

            if (Platform.getOS() == Platform.OS.Win)
            {
                apppath = installPath.Split(new string[] { "Scrolls_Data" + System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries) [0];
            }
            if (Platform.getOS() == Platform.OS.Mac)
            {
                apppath = installPath.Split(new string[] { "Data" + System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries) [0] + "MacOS" + ddsc;
            }
            String fpath = installPath.Split(new string[] { "game" + System.IO.Path.DirectorySeparatorChar + "versions" }, StringSplitOptions.RemoveEmptyEntries) [0];

            if (Platform.getOS() == Platform.OS.Mac)
            {
                fpath = installPath.Split(new string[] { "versions" + System.IO.Path.DirectorySeparatorChar + "version-" }, StringSplitOptions.RemoveEmptyEntries) [0];
            }

            string args = "--assetsDir \"" + fpath + "game" + ddsc + "assets" + ddsc + "objects\" --assetIndex \"" + fpath + "game" + ddsc + "assets" + ddsc + "indexes" + ddsc + "index-" + Platform.getVersionNumber() + "-production-win.json\"";

            if (Platform.getOS() == Platform.OS.Mac)
            {
                args = "--assetsDir \"" + fpath + "assets" + ddsc + "objects\" --assetIndex \"" + fpath + "assets" + ddsc + "indexes" + ddsc + "index-" + Platform.getVersionNumber() + "-production-osx.json\"";
            }

            String filetxt  = "";
            String filetxt2 = "";

            switch (Platform.getOS())
            {
            case Platform.OS.Win:
                apppath += "Scrolls.exe";
                fpath   += "summoner.bat";
                filetxt  = "START \"\" \"" + apppath + "\" " + args;
                break;

            case Platform.OS.Mac:
                apppath += "Scrolls";
                fpath    = System.IO.Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString().Replace("Summoner.app" + ddsc + "Contents" + ddsc + "MacOS", "") + "summoner.command";
                filetxt  = "\"" + apppath + "\" " + args;                //+path to scrolls.exe + arguments!
                filetxt2 = "#!/bin/bash\r\n\"" + apppath + "\" " + args; //+path to scrolls.exe + arguments!
                break;

            default:
                break;
            }
            System.IO.File.WriteAllText(fpath, filetxt);

            if (Platform.getOS() == Platform.OS.Mac)              //platform specific patch :D (need this to restart scrolls!)
            {
                //make .command executeable
                new Process {
                    StartInfo = { FileName = "chmod", Arguments = "u+x " + "\"" + fpath + "\"", UseShellExecute = true }
                }.Start();

                fpath = installPath.Split(new string[] { "versions" + System.IO.Path.DirectorySeparatorChar + "version-" }, StringSplitOptions.RemoveEmptyEntries) [0] + "summoner.sh";
                System.IO.File.WriteAllText(fpath, filetxt2);
            }



            Console.WriteLine("Patching...");
            if (writetofile)
            {
                Platform.ErrorLog("Patching...");
            }
            //patch it
            Patcher patcher = new Patcher();

            if (!patcher.patchAssembly(installPath))
            {
                Console.WriteLine("Patching failed");
                if (writetofile)
                {
                    Platform.ErrorLog("Patching failed");
                }
                //don't safe patch at this point. If the "real" patcher fails, we should tell the user instead
                //save-patching is for installs, that get broken by updates, etc, to keep the install until ScrollsModLoader is updated
                Dialogs.showNotification("Patching failed", "Scrolls Summoner was unable to prepare your client, you are likely using an incompatible version. More at scrollsguide.com");
                return;
            }



            Dialogs.showNotification("Patching complete", "Summoner successfully patched your Scrolls installation. Visit scrollsguide.com/summoner for more information. You can now start Scrolls and enjoy the benefits of Summoner. Warning: fullscreen users may have to manually restart the game");
            Console.WriteLine("Done");
            if (writetofile)
            {
                Platform.ErrorLog("Done");
            }
            return;
        }
Exemplo n.º 3
0
        private static byte[] token = new byte[] { 8, 95, 174, 161, 22, 41, 180, 133 };         //public key

        public static bool tryUpdate()
        {
            WebClientTimeOut client = new WebClientTimeOut();
            String           versionMessageRaw;

            try {
                versionMessageRaw = client.DownloadString(new Uri("http://mods.scrollsguide.com/version"));
            } catch (WebException) {
                return(false);
            }

            JsonReader     reader         = new JsonReader();
            VersionMessage versionMessage = (VersionMessage)reader.Read(versionMessageRaw, typeof(VersionMessage));

            int    version     = versionMessage.version();
            String installPath = Platform.getModLoaderPath() + Path.DirectorySeparatorChar;             //;Platform.getGlobalScrollsInstallPath () + Path.DirectorySeparatorChar + "ModLoader" + Path.DirectorySeparatorChar;

            try {
                File.Delete(installPath + "Updater.exe");
            } catch {}

            if (!System.IO.Directory.Exists(installPath))
            {
                System.IO.Directory.CreateDirectory(installPath);
            }

            if (version > ModLoader.getVersion())
            {
                byte[] asm;
                try {
                    asm = client.DownloadData(new Uri("http://mods.scrollsguide.com/download/update"));
                } catch (WebException) {
                    return(false);
                }
                File.WriteAllBytes(installPath + "Updater.exe", asm);
                if (CheckToken(installPath + "Updater.exe", token))
                {
                    try {
                        App.Popups.ShowInfo("Scrolls Summoner is updating", "Please wait while the update is being downloaded");
                        Dialogs.showNotification("Scrolls Summoner is updating", "Please wait while the update is being downloaded");
                    } catch { }

                    if (Platform.getOS() == Platform.OS.Win)
                    {
                        new Process {
                            StartInfo = { FileName = installPath + "Updater.exe", Arguments = "" }
                        }.Start();
                    }
                    else if (Platform.getOS() == Platform.OS.Mac)
                    {
                        Assembly.LoadFrom(installPath + "Updater.exe").EntryPoint.Invoke(null, new object[] { new string[] {} });
                    }
                    return(true);
                }

                try {
                    App.Popups.KillCurrentPopup();
                } catch {}
            }

            return(false);
        }
Exemplo n.º 4
0
 public string FileOpenDialog()
 {
     return(Dialogs.fileOpenDialog());
 }
Exemplo n.º 5
0
        public static String getGlobalScrollsInstallPath()
        {
            if (Platform.GlobalScrollsInstallPath != null)
            {
                return(Platform.GlobalScrollsInstallPath);
            }

            String path = null;

            //if we are already loaded from the game folder, get that instead
            if ((from file in Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).GetFiles()
                 where file.Name.Contains("Assembly-CSharp.dll")
                 select file).Count() > 0)
            {
                Platform.GlobalScrollsInstallPath = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString() + Path.DirectorySeparatorChar;
                Console.WriteLine("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                Platform.ErrorLog("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                return(Platform.GlobalScrollsInstallPath);
            }

            // we are located in ScrollsLauncher folder
            string searchpath = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString() + Path.DirectorySeparatorChar + "game" + Path.DirectorySeparatorChar;
            string dsc        = Path.DirectorySeparatorChar + "";

            if (Platform.getOS() == Platform.OS.Mac)
            {
                searchpath  = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString().Replace("Desktop" + dsc + "Summoner.app" + dsc + "Contents" + dsc + "MacOS", "");
                searchpath += "Library" + dsc + "Application Support" + dsc + "Scrolls" + dsc;
            }

            /*Platform.ErrorLog("path zero step : " + Directory.GetParent (searchpath));
             * Platform.ErrorLog (searchpath + " contains this files:");
             * foreach (FileInfo file in Directory.GetParent (searchpath).GetFiles ())
             * {
             *      Platform.ErrorLog("found file: " + file.FullName);
             * }*/

            Platform.ErrorLog("path zero step : " + Directory.GetParent(searchpath));

            if (Platform.getOS() == Platform.OS.Mac)
            {
                if ((from file in Directory.GetParent(searchpath).GetFiles()
                     where file.Name.Contains("launcher")
                     select file).Count() == 0)
                {
                    //maybe we are in Scrolls folder?
                    searchpath = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString();
                }
            }



            if ((from file in Directory.GetParent(searchpath).GetFiles()
                 where file.Name.Contains("launcher")
                 select file).Count() > 0)
            {
                String folderpath = "";

                folderpath = Directory.GetParent(searchpath).ToString() + Path.DirectorySeparatorChar + "versions";

                Console.WriteLine("path first step : " + folderpath);
                Platform.ErrorLog("path first step : " + folderpath);

                if (Directory.Exists(folderpath))
                {
                    //Console.WriteLine ("path exists");
                    //search newest version
                    String newestVersion = "0";
                    foreach (String pathh in System.IO.Directory.GetDirectories(folderpath))
                    {
                        if (pathh.EndsWith("-production"))                           // change this for test builds!!!
                        {
                            String v = pathh.Split(Path.DirectorySeparatorChar) [pathh.Split(Path.DirectorySeparatorChar).Length - 1];
                            v = v.Replace("version-", "");
                            v = v.Replace("-production", "");                              // change this for test builds!!!

                            if (Convert.ToInt32(v) > Convert.ToInt32(newestVersion))
                            {
                                newestVersion = v;
                            }
                        }
                    }
                    folderpath += Path.DirectorySeparatorChar + "version-" + newestVersion + "-production";

                    //search newest file!
                    Console.WriteLine("path second step : " + folderpath);
                    Platform.ErrorLog("path second step : " + folderpath);

                    String fullnewest = "version-" + newestVersion + "-production-natives-";

                    String timestamp = "0";
                    foreach (String pathh in System.IO.Directory.GetDirectories(folderpath))
                    {
                        String p = pathh.Split(Path.DirectorySeparatorChar) [pathh.Split(Path.DirectorySeparatorChar).Length - 1];
                        if (p.StartsWith(fullnewest))                           // change this for test builds!!!
                        {
                            String v = p.Replace(fullnewest, "");
                            if (Convert.ToInt64(v) > Convert.ToInt64(timestamp))
                            {
                                timestamp = v;
                            }
                        }
                    }

                    if (Platform.getOS() == Platform.OS.Win)
                    {
                        folderpath += Path.DirectorySeparatorChar + fullnewest + timestamp + Path.DirectorySeparatorChar + "Scrolls_Data" + Path.DirectorySeparatorChar + "Managed" + Path.DirectorySeparatorChar;
                    }

                    if (Platform.getOS() == Platform.OS.Mac)
                    {
                        folderpath += Path.DirectorySeparatorChar + fullnewest + timestamp + Path.DirectorySeparatorChar + "MacScrolls.app" + Path.DirectorySeparatorChar + "Contents" + Path.DirectorySeparatorChar + "Data" + Path.DirectorySeparatorChar + "Managed" + Path.DirectorySeparatorChar;
                    }


                    Platform.GlobalScrollsInstallPath = folderpath;
                    Console.WriteLine("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                    Platform.ErrorLog("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                    return(Platform.GlobalScrollsInstallPath);
                }
            }


            switch (Platform.getOS())
            {
            case Platform.OS.Win:
                path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Mojang\\Scrolls\\game\\Scrolls_Data\\Managed\\";
                if (!System.IO.File.Exists(path + "Assembly-CSharp.dll"))
                {
                    Console.WriteLine("Expected Path: " + path);
                    Dialogs.showNotification("Scrolls was not found", "Please select your local install of Scrolls");

                    path = Dialogs.fileOpenDialog();
                    if (path == null)
                    {
                        Dialogs.showNotification("No Selection was made", "Scrolls Summoner was not able to find your local install of Scrolls. Scrolls Summoner will close now");
                        return(null);
                    }
                    if (!System.IO.File.Exists(path + "\\Assembly-CSharp.dll"))
                    {
                        Dialogs.showNotification("Wrong Selection", "The selected file is not a valid Scrolls game folder. Scrolls Summoner will close now");
                        return(null);
                    }
                }

                Platform.GlobalScrollsInstallPath = path;
                Console.WriteLine("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                Platform.ErrorLog("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
                return(Platform.GlobalScrollsInstallPath);

            case Platform.OS.Mac:

                //Apps are bundles (== folders) on MacOS
                if (System.IO.Directory.Exists("/Applications/Scrolls.app"))
                {
                    path = "/Applications/Scrolls.app/Contents/MacOS/game/MacScrolls.app/Contents/Data/Managed/";
                    break;
                }

                // MacOS User needs to tell us the path of their Scrolls.app
                Dialogs.showNotification("Scrolls was not found", "Please select your local install of Scrolls");

                path = Dialogs.fileOpenDialog();
                if (path == null)
                {
                    Dialogs.showNotification("No Selection was made", "Scrolls Summoner was not able to find your local install of Scrolls. Scrolls Summoner will close now");
                    return(null);
                }
                path += "/Contents/MacOS/game/MacScrolls.app/Contents/Data/Managed/";

                if (!System.IO.File.Exists(path + "Assembly-CSharp.dll"))
                {
                    Dialogs.showNotification("Wrong Selection", "The selected file is not a valid Scrolls.app. Scrolls Summoner will close now");
                    return(null);
                }

                break;

            default:
                Console.WriteLine("Unsupported Platform detected");
                return(null);
            }

            Platform.GlobalScrollsInstallPath = path;
            Console.WriteLine("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
            Platform.ErrorLog("GlobalScrollsInstallPath is : " + Platform.GlobalScrollsInstallPath);
            return(Platform.GlobalScrollsInstallPath);
        }
Exemplo n.º 6
0
        public static void standalonePatch()
        {
            Console.WriteLine("Preparing...");

            //get Path of Scrolls Data Folder
            String installPath = Platform.getGlobalScrollsInstallPath();

            if (installPath == null)
            {
                return;
            }

            Console.WriteLine("Creating ModLoader folder...");

            //create modloader folder
            if (!System.IO.Directory.Exists(installPath + "ModLoader"))
            {
                System.IO.Directory.CreateDirectory(installPath + "ModLoader");
            }

            Console.WriteLine("Backup/Reset assembly...");
            //backup original assembly
            if (!System.IO.File.Exists(installPath + "ModLoader" + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll"))
            {
                System.IO.File.Copy(installPath + "Assembly-CSharp.dll", installPath + "ModLoader" + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll");
            }
            else
            {
                //if a backup already exists, it is much more likely that the current assembly is messed up and the user wants to repatch
                System.IO.File.Delete(installPath + "Assembly-CSharp.dll");
                System.IO.File.Copy(installPath + "ModLoader" + System.IO.Path.DirectorySeparatorChar + "Assembly-CSharp.dll", installPath + "Assembly-CSharp.dll");
            }

            Console.WriteLine("Copying ModLoader.dll...");
            //copy modloader for patching
            if (System.IO.File.Exists(installPath + "ScrollsModLoader.dll"))
            {
                System.IO.File.Delete(installPath + "ScrollsModLoader.dll");
            }
            System.IO.File.Copy(System.Reflection.Assembly.GetExecutingAssembly().Location, installPath + "ScrollsModLoader.dll");

            //reset ini
            if (System.IO.File.Exists(installPath + "ModLoader" + System.IO.Path.DirectorySeparatorChar + "mods.ini"))
            {
                System.IO.File.Delete(installPath + "ModLoader" + System.IO.Path.DirectorySeparatorChar + "mods.ini");
            }

            Console.WriteLine("Patching...");
            //patch it
            Patcher patcher = new Patcher();

            if (!patcher.patchAssembly(installPath))
            {
                Console.WriteLine("Patching failed");
                //don't safe patch at this point. If the "real" patcher fails, we should tell the user instead
                //save-patching is for installs, that get broken by updates, etc, to keep the install until ScrollsModLoader is updated
                Dialogs.showNotification("Patching failed", "Scrolls Summoner was unable to prepare your client, you are likely using an incompatible version. More at scrollsguide.com");
                return;
            }

            Dialogs.showNotification("Patching complete", "Summoner successfully patched your Scrolls installation. Visit scrollsguide.com/summoner for more information. You can now start Scrolls and enjoy the benefits of Summoner. Warning: fullscreen users may have to manually restart the game");
            Console.WriteLine("Done");
            return;
        }
Exemplo n.º 7
0
        public static String getGlobalScrollsInstallPath()
        {
            String path = null;

            //if we are already loaded from the game folder, get that instead
            if ((from file in Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).GetFiles()
                 where file.Name.Contains("Assembly-CSharp.dll")
                 select file).Count() > 0)
            {
                return(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString() + Path.DirectorySeparatorChar);
            }

            switch (Platform.getOS())
            {
            case Platform.OS.Win:
                path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Mojang\\Scrolls\\game\\Scrolls_Data\\Managed\\";
                if (!System.IO.File.Exists(path + "Assembly-CSharp.dll"))
                {
                    Console.WriteLine("Expected Path: " + path);
                    Dialogs.showNotification("Scrolls was not found", "Please select your local install of Scrolls");

                    path = Dialogs.fileOpenDialog();
                    if (path == null)
                    {
                        Dialogs.showNotification("No Selection was made", "Scrolls Summoner was not able to find your local install of Scrolls. Scrolls Summoner will close now");
                        return(null);
                    }
                    if (!System.IO.File.Exists(path + "\\Assembly-CSharp.dll"))
                    {
                        Dialogs.showNotification("Wrong Selection", "The selected file is not a valid Scrolls game folder. Scrolls Summoner will close now");
                        return(null);
                    }
                }
                return(path);

            case Platform.OS.Mac:

                //Apps are bundles (== folders) on MacOS
                if (System.IO.Directory.Exists("/Applications/Scrolls.app"))
                {
                    path = "/Applications/Scrolls.app/Contents/MacOS/game/MacScrolls.app/Contents/Data/Managed/";
                    break;
                }

                // MacOS User needs to tell us the path of their Scrolls.app
                Dialogs.showNotification("Scrolls was not found", "Please select your local install of Scrolls");

                path = Dialogs.fileOpenDialog();
                if (path == null)
                {
                    Dialogs.showNotification("No Selection was made", "Scrolls Summoner was not able to find your local install of Scrolls. Scrolls Summoner will close now");
                    return(null);
                }
                path += "/Contents/MacOS/game/MacScrolls.app/Contents/Data/Managed/";

                if (!System.IO.File.Exists(path + "Assembly-CSharp.dll"))
                {
                    Dialogs.showNotification("Wrong Selection", "The selected file is not a valid Scrolls.app. Scrolls Summoner will close now");
                    return(null);
                }

                break;

            default:
                Console.WriteLine("Unsupported Platform detected");
                return(null);
            }

            Console.WriteLine("Install Path: " + path);
            return(path);
        }