Ejemplo n.º 1
0
        private void exitBtn_Click(object sender, EventArgs e)
        {
            var installHandler = new InstallHandler();

            installHandler.Uninstall(false);
            Environment.Exit(Environment.ExitCode);
        }
Ejemplo n.º 2
0
 public InstallPresenter(IInstallView view, FOGameInfo game, InstallHandler installHandler, LogoManager logoManager, string scriptPath, string tempPath)
 {
     this.view = view;
     this.game = game;
     this.scriptPath = scriptPath;
     this.installHandler = installHandler;
     this.logoManager = logoManager;
     this.tempPath = tempPath;
 }
Ejemplo n.º 3
0
        protected override void OnStop()
        {
            var proxy          = new ProxyHandler();
            var threadHandler  = new ThreadHandler();
            var installHandler = new InstallHandler();

            threadHandler.StopRequestThread();
            proxy.Stop();
            installHandler.Uninstall(true);
        }
Ejemplo n.º 4
0
        protected override void OnStart(string[] args)
        {
            var proxy          = new ProxyHandler();
            var threadHandler  = new ThreadHandler();
            var installHandler = new InstallHandler();

            proxy.Start();
            threadHandler.StartRequestThread();
            installHandler.Install();
        }
Ejemplo n.º 5
0
        private void proxyToggleBtn_Click(object sender, EventArgs e)
        {
            var proxy          = new ProxyHandler();
            var threadHandler  = new ThreadHandler();
            var installHandler = new InstallHandler();

            if (ProxyHandler.IsRunning)
            {
                threadHandler.StopRequestThread();
                proxy.Stop();
                installHandler.Uninstall(true);
                runProxyLbl.Text = @"Proxy not running";
            }
            else
            {
                proxy.Start();
                threadHandler.StartRequestThread();
                installHandler.Install();
                runProxyLbl.Text = @"Proxy running";
            }
        }
Ejemplo n.º 6
0
        public static void OpenInstall()
        {
            Logger.LogInformation("Loading Install...");

            var installkey = BuildConfig.GetKey("install");

            if (!EncodingHandler.CEKeys.TryGetValue(installkey, out EncodingCEKeyPageTable enc))
            {
                Logger.LogCritical($"Encoding missing Install {installkey.ToString()}");
                return;
            }

            LocalIndexEntry idxInfo = LocalIndexHandler?.GetIndexInfo(enc.EKeys[0]);

            if (idxInfo != null)
            {
                var path = Path.Combine(BasePath, "Data", "data", string.Format("data.{0:D3}", idxInfo.Archive));
                InstallHandler = new InstallHandler(DataHandler.Read(path, idxInfo));
            }
            else
            {
                string key  = enc.EKeys[0].ToString();
                string path = Path.Combine(Settings.SystemFilesPath, key);
                path = Helper.FixOutputPath(path, "data");

                if (!File.Exists(path))
                {
                    string url = "/data/" + key.Substring(0, 2) + "/" + key.Substring(2, 2) + "/" + key;
                    if (!DataHandler.Download(url, path))
                    {
                        Logger.LogCritical($"Unable to download Install {key}.");
                    }
                }

                InstallHandler = new InstallHandler(DataHandler.ReadDirect(path));
            }
        }
Ejemplo n.º 7
0
        public static void Close()
        {
            RootHandler?.NewFiles.Clear();

            Settings = null;

            BuildInfo   = null;
            Versions    = null;
            CDNs        = null;
            BuildConfig = null;
            CDNConfig   = null;

            LocalIndexHandler = null;
            CDNIndexHandler   = null;
            DownloadHandler   = null;
            InstallHandler    = null;

            EncodingHandler?.Dispose();
            RootHandler?.Dispose();

            // force GC
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Ejemplo n.º 8
0
 public static void testInstall(InstallHandler script, Version version)
 {
     Implementation.testInstall(script, version);
 }
Ejemplo n.º 9
0
 public static void testInstall(InstallHandler installImplementation, Version version, bool isPush)
 {
     Implementation.testInstall(installImplementation, version, isPush);
 }
Ejemplo n.º 10
0
 public ServerManager(FOServerJson foServerJson, InstallHandler installHandler)
 {
     this.query = new FOServerQuery(foServerJson, new NLogWrapper("FOQuery"));
     this.installHandler = installHandler;
 }
Ejemplo n.º 11
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            JsonFetcher jsonFetch = new JsonFetcher(new NLogWrapper("FOQuery"));
            FOJsonDeserializer jsonDeserialize = new FOJsonDeserializer();

            this.view.UpdateStatusBar("Downloading data...");

            var jsonNode = jsonFetch.DownloadJson(this.settings.InstallUrl);
            this.installHandler = new InstallHandler(jsonDeserialize.GetInstallData(jsonNode), settings.Games, settings.Dependencies);
            this.logger.Debug("Installhandler initialized.");
            this.logoManager = new LogoManager(this.settings.Paths.Logos, this.settings.LogoUrl);
            this.logger.Debug("Logos initialized.");
            this.serverManager = new ServerManager(
                new FOServerJson(settings.ConfigUrl, settings.StatusUrl, settings.CombinedUrl, new NLogWrapper("FOQuery")),
                this.installHandler);
            this.logger.Debug("Servermanager initialized.");
            this.VerifyInstalledGames();
            this.logger.Debug("Verified installed games.");
            this.view.UpdateStatusBar("Updating game list...");
            this.UpdateGameList();
            this.logger.Debug("Games updated.");
        }