Skip to content

Commit

Permalink
8.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sefinek24 committed Mar 12, 2024
1 parent d3f315c commit dfe52c1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Stella.Launcher/1. Stella Mod Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
<AssemblyVersion>7.9.7.0</AssemblyVersion>
<FileVersion>7.9.7.0</FileVersion>
<Version>7.9.7.0</Version>
<AssemblyVersion>8.0.0.1</AssemblyVersion>
<FileVersion>8.0.0.1</FileVersion>
<Version>8.0.0.1</Version>
<StartupObject>StellaModLauncher.Program</StartupObject>
<ApplicationIcon>data\images\icons\nahida.ico</ApplicationIcon>
<BaseOutputPath>..\Build\</BaseOutputPath>
Expand Down
7 changes: 4 additions & 3 deletions Stella.Launcher/Forms/Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,15 @@ private async void Main_Shown(object sender, EventArgs e)
int found = await CheckForUpdates.Analyze().ConfigureAwait(true);
switch (found)
{
case 2:
return;
case 666:
WindowState = FormWindowState.Minimized;
return;
}

MessageBox.Show($@"OK: {found}");
await Task.Run(() =>
{
while (UpdateIsAvailable) Task.Delay(1000).Wait();
}).ConfigureAwait(true);


// Updated?
Expand Down
6 changes: 6 additions & 0 deletions Stella.Launcher/Scripts/Forms/MainForm/Labels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static void ShowStartGameBtns()

public static void ShowProgressbar()
{
// Default._webView21!.Visible = false;

Default._progressBar1!.Show();
Default._preparingPleaseWait!.Show();

Expand All @@ -45,6 +47,8 @@ public static void ShowProgressbar()

public static void HideProgressbar(string? successText, bool error)
{
// Default._webView21!.Visible = true;

Default._progressBar1!.Hide();
Default._progressBar1.Value = 0;
Default._preparingPleaseWait!.Hide();
Expand Down Expand Up @@ -72,6 +76,8 @@ public static void HideProgressbar(string? successText, bool error)

public static void FailedToLoad()
{
// Default._webView21!.Visible = false;

Default._version_LinkLabel!.Text = @"v-.-.-.-";
Default._checkForUpdates_LinkLabel!.Text = @"---";
Default._progressBar1!.Value = 100;
Expand Down
2 changes: 1 addition & 1 deletion Stella.Launcher/Scripts/Helpers/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static class BufferHelper
*/
public static byte[] Get()
{
int bufferCfg = Program.Settings.ReadInt("Launcher", "BufferValue", 65536);
int bufferCfg = Program.Settings.ReadInt("Launcher", "BufferValue", 1048576);
return new byte[bufferCfg];
}
}
32 changes: 21 additions & 11 deletions Stella.Launcher/Scripts/Remote/CheckForUpdates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace StellaModLauncher.Scripts.Remote;

internal static class CheckForUpdates
{
public static int FoundUpdates = 0;

public static async Task<int> Analyze()
{
Default._checkForUpdates_LinkLabel!.LinkColor = Color.White;
Expand Down Expand Up @@ -81,6 +79,8 @@ public static async Task<int> Analyze()
await DownloadResources.Run(data?.Version!, remoteDbResourcesVersion, remoteResourcesDate).ConfigureAwait(true);
return 1;
}

Default.UpdateIsAvailable = false;
}


Expand Down Expand Up @@ -119,10 +119,14 @@ public static async Task<int> Analyze()
if (Secret.IsStellaPlusSubscriber)
{
int found = await CheckForUpdatesOfBenefits.Analyze().ConfigureAwait(true);
MessageBox.Show($@"CheckForUpdatesOfBenefits: {found}");
switch (found)
{
case 0:
Default.UpdateIsAvailable = false;
break;
case 1:
Default.UpdateIsAvailable = true;

Default._checkForUpdates_LinkLabel.LinkColor = Color.Cyan;
Default._checkForUpdates_LinkLabel.Text = Resources.Default_UpdatingBenefits;
Default._updateIco_PictureBox!.Image = Resources.icons8_download_from_the_cloud;
Expand Down Expand Up @@ -150,7 +154,7 @@ public static async Task<int> Analyze()
Default._updateIco_PictureBox!.Image = Resources.icons8_available_updates;

Default._version_LinkLabel!.Text = $@"v{(Program.AppVersion == Program.AppFileVersion ? Program.AppVersion : $"{Program.AppFileVersion}-alpha")}";

// if (actionOnClick) Default._webView21!.Visible = true;
Default.UpdateIsAvailable = false;
Program.Logger.Info($"Not found any new updates. AppVersion v{Program.AppVersion}; ProductVersion v{Program.AppFileVersion};");

Expand All @@ -159,15 +163,15 @@ public static async Task<int> Analyze()
Labels.ShowStartGameBtns();
return 0;
}
catch (Exception e)
catch (Exception ex)
{
Default.UpdateIsAvailable = false;

Default._checkForUpdates_LinkLabel.LinkColor = Color.Red;
Default._checkForUpdates_LinkLabel.Text = Resources.Default_OhhSomethingWentWrong;
Utils.UpdateStatusLabel(e.Message, Utils.StatusType.Error);
Utils.UpdateStatusLabel(ex.Message, Utils.StatusType.Error);

Program.Logger.Error(string.Format(Resources.Default_SomethingWentWrongWhileCheckingForNewUpdates, e));
Program.Logger.Error(string.Format(Resources.Default_SomethingWentWrongWhileCheckingForNewUpdates, ex));
Labels.HideProgressbar(null, true);
return -1;
}
Expand All @@ -176,16 +180,22 @@ public static async Task<int> Analyze()
public static async void CheckUpdates_Click(object? sender, LinkLabelLinkClickedEventArgs e)
{
if (Secret.IsStellaPlusSubscriber) Music.PlaySound("winxp", "hardware_insert");
Default._webView21!.Visible = false;

int update = await Analyze().ConfigureAwait(true);

if (update == -1)
switch (update)
{
Music.PlaySound("winxp", "hardware_fail");
return;
case -1:
Default._webView21!.Visible = false;
Music.PlaySound("winxp", "hardware_fail");
return;
case 0:
Default._webView21!.Visible = true;
break;
}

if (update != 0) return;

if (Secret.IsStellaPlusSubscriber) Music.PlaySound("winxp", "hardware_remove");

Default._checkForUpdates_LinkLabel!.LinkColor = Color.LawnGreen;
Expand Down
5 changes: 3 additions & 2 deletions Stella.Launcher/Scripts/Remote/NormalRelease.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Diagnostics;
using ByteSizeLib;
using CliWrap.Builders;
using StellaModLauncher.Forms;
Expand All @@ -12,7 +11,9 @@ namespace StellaModLauncher.Scripts.Remote;
internal static class NormalRelease
{
public static readonly string SetupPathExe = Path.Combine(Path.GetTempPath(), "Stella-Mod-Update.exe");
private static readonly string DownloadUrl = Debugger.IsAttached ? "http://127.0.0.1:5180/Stella-Mod-Setup.exe" : "https://github.com/sefinek24/Genshin-Impact-ReShade/releases/latest/download/Stella-Mod-Setup.exe";

// private static readonly string DownloadUrl = Debugger.IsAttached ? "http://127.0.0.1:5180/Stella-Mod-Setup.exe" : "https://github.com/sefinek24/Genshin-Impact-ReShade/releases/latest/download/Stella-Mod-Setup.exe";
private static readonly string DownloadUrl = "https://github.com/sefinek24/Genshin-Impact-ReShade/releases/latest/download/Stella-Mod-Setup.exe";

public static async Task Run(string? remoteVersion, DateTime remoteVerDate, bool beta)
{
Expand Down

0 comments on commit dfe52c1

Please sign in to comment.