Skip to content

Commit

Permalink
Updater URL fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpmartell committed Jul 27, 2024
1 parent a3d4a76 commit d77ec3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LittleWarGameClient/DownloadInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected override bool OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowse
n++;
var ext = Path.GetExtension(downloadItem.SuggestedFileName);
var filenameNoExt = Path.GetFileNameWithoutExtension(downloadItem.SuggestedFileName);
completePath = Path.Join(downloadsDirPath, $"{filenameNoExt}({n}).{ext}");
completePath = Path.Join(downloadsDirPath, $"{filenameNoExt}({n}){ext}");
}
callback.Continue(completePath, showDialog: false);
return true;
Expand Down
3 changes: 2 additions & 1 deletion LittleWarGameClient/GameForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ private void GameForm_Activated(object sender, EventArgs e)
{
CaptureCursor();
ResizeGameWindows();
overlayForm.Visible = true;
if (!overlayForm.IsDisposed)
overlayForm.Visible = true;
}

private void GameForm_FormClosing(object sender, FormClosingEventArgs e)
Expand Down
10 changes: 9 additions & 1 deletion LittleWarGameClient/VersionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public VersionHandler(Settings s)
settings = s;
var productVersion = System.Windows.Forms.Application.ProductVersion.Split('+').First();
CurrentVersion = new Version(productVersion);
#if DEBUG
CurrentVersion = new Version(0,0,0);
#endif
LatestVersionObtained += CheckForUpdate;
PerformCheck();
}
Expand All @@ -56,7 +59,12 @@ internal virtual void CheckForUpdate(object? sender, EventArgs e)
if (LatestVersion != null && RequiresUpdate())
if (DialogResult.OK == MessageBox.Show("An update is available. Press OK to download it and exit the game", "Update", MessageBoxButtons.OKCancel))
{
Process.Start(new ProcessStartInfo($"https://github.com/ivanpmartell/LittleWarGameClient/releases/download/v{LatestVersion}/lwg_client.zip") { UseShellExecute = true });
var updateUrl = $"https://github.com/ivanpmartell/LittleWarGameClient/releases/download/v{LatestVersion}/";
if (Environment.Is64BitProcess)
updateUrl += "lwg_clientx64.zip";
else
updateUrl += "lwg_clientx86.zip";
Process.Start(new ProcessStartInfo(updateUrl) { UseShellExecute = true });
System.Windows.Forms.Application.Exit();
}
settings.SetLastUpdateChecked(DateTime.Now.Date);
Expand Down

0 comments on commit d77ec3a

Please sign in to comment.