Beispiel #1
0
        public async Task When_NoVersionsAvailable_Then_NotNewerVerrsion()
        {
            var githubResponse = JsonConvert.SerializeObject(new List <GithubRelease>());

            A.CallTo(() => _gitbubPrevider.FetchLatestReleases(A <string> ._))
            .Returns(githubResponse);

            var result = await _updateCheck.CheckForUpdates("", 0);

            Assert.That(result.IsNewerVersion, Is.False);
        }
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         var updateCheck = new UpdateCheck("http://myabudhabi.net/latest");
         if (updateCheck.IsValid)
         {
             updateCheck.CheckForUpdates(Log);
         }
     }
     catch (Exception ex)
     {
         Log(ex.Message);
     }
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            BuildInfo.isWindows = Environment.OSVersion.ToString().ToLower().Contains("windows");

            if ((Environment.CommandLine.Length >= 1 || args.Length >= 1) && Environment.CommandLine.Contains("--autostart"))
            {
                if (Directory.Exists(BuildInfo.isWindows ? $"{Environment.CurrentDirectory}\\Beat Saber" : $"{AppDomain.CurrentDomain.BaseDirectory}Beat Saber"))
                {
                    PlayGame.LaunchGame(Environment.CommandLine.Contains("oculus"));
                    Task.Delay(1000);
                    Process.GetCurrentProcess().Kill();
                }
                Con.Log("Game Not installed, running program like normal.");
            }

            if (Environment.CommandLine.Contains("debug"))
            {
                isDebug = true;
                Con.Init();
            }
            Con.BSL_Logo();
            Con.Log("This tool will allow you to easily downgrade your Beat Saber.");
            Con.Log("Brought to you by the", "Beat Saber Legacy Group", ConsoleColor.DarkCyan);
            Con.Space();

            //JSONSetup.Load();

            if (isDebug)
            {
                Con.Log($"Environment Version is v{Environment.Version}");
                Con.Log($"OS is {Environment.OSVersion}");
                Con.Log($"Debug: isWindows = {BuildInfo.isWindows}");
            }

            if (!isDebug)
            {
                UpdateCheck.CheckForUpdates();
            }

            bool showError = false;

            if (BuildInfo.isWindows)
            {
                if (!Directory.Exists(Environment.CurrentDirectory + "\\Resources") || !Directory.Exists(Environment.CurrentDirectory + "\\Depotdownloader"))
                {
                    showError = true;
                }
            }
            else
            {
                if (!Directory.Exists($"{AppDomain.CurrentDomain.BaseDirectory}Resources") || !Directory.Exists($"{AppDomain.CurrentDomain.BaseDirectory}Depotdownloader"))
                {
                    showError = true;
                }
            }

            if (showError)
            {
                Con.Error("Please be sure you have extracted the files before running this!");
                Con.Error("Program will not run until you have extracted all the contents out of the ZIP file.");
                Con.Exit();
            }
            else
            {
                BeginInputOption();
            }
        }
Beispiel #4
0
 public virtual Task Execute(IJobExecutionContext context)
 {
     UpdateCheck.CheckForUpdates();
     return(Task.CompletedTask);
 }