Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
- Fixed background self-update checker uses wrong URL.
  • Loading branch information
Leayal committed Nov 19, 2023
1 parent c99018c commit de47778
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 9 deletions.
7 changes: 4 additions & 3 deletions LauncherCore/Classes/BackgroundSelfUpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Text.Json;
using System.IO;
using System.Runtime.InteropServices;
using System.Collections.Frozen;

namespace Leayal.PSO2Launcher.Core.Classes
{
Expand Down Expand Up @@ -36,9 +37,9 @@ public TimeSpan TickTime
}
}

private readonly IReadOnlyDictionary<string, string> files;
private readonly FrozenDictionary<string, string> files;

public BackgroundSelfUpdateChecker(in CancellationToken cancellationToken, HttpClient client, Dictionary<string, string> filelist)
public BackgroundSelfUpdateChecker(in CancellationToken cancellationToken, HttpClient client, FrozenDictionary<string, string> filelist)
{
this.appExit = cancellationToken;
this.files = filelist;
Expand Down Expand Up @@ -89,7 +90,7 @@ private async ValueTask TimerTicked()

private async Task<IReadOnlyDictionary<string, string>> GetFileList()
{
var data = await this.webclient.GetStringAsync("https://leayal.github.io/PSO2-Launcher-CSharp/publish/v6/update.json").ConfigureAwait(false);
var data = await this.webclient.GetStringAsync(Updater.SharedCode.LauncherUpdateManifest).ConfigureAwait(false);
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

using (var document = JsonDocument.Parse(data))
Expand Down
1 change: 0 additions & 1 deletion LauncherCore/GameLauncher.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Leayal.SharedInterfaces;
using Microsoft.Win32.SafeHandles;
using Leayal.SharedInterfaces.Communication;
using System;
using System.Threading;
Expand Down
3 changes: 3 additions & 0 deletions LauncherCore/LauncherCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<None Remove="Resources\_bgimg_dark.png" />
<None Remove="Resources\_bgimg_light.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Updater\SharedCode.cs" Link="SharedCode.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\empty_d4455ebc2bef618f29106da7692ebc1a" />
<EmbeddedResource Include="Resources\ico-item-AlphaReactor.png" />
Expand Down
1 change: 0 additions & 1 deletion LauncherCore/StaticResources.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Security.Principal;

namespace Leayal.PSO2Launcher.Core
{
Expand Down
5 changes: 3 additions & 2 deletions LauncherCore/Windows/MainMenuWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Leayal.Shared;
using System.Windows.Input;
using System.Runtime.CompilerServices;
using System.Collections.Frozen;

namespace Leayal.PSO2Launcher.Core.Windows
{
Expand Down Expand Up @@ -253,8 +254,8 @@ static void AddToDictionary(Dictionary<string, string> d, string p, int o)
AddToDictionary(dictionary, Path.Combine(binDir, "native-x86"), removelen);
}

dictionary.TrimExcess();
var selfupdatecheck = new BackgroundSelfUpdateChecker(this.cancelAllOperation.Token, this.webclient, dictionary);
// dictionary.TrimExcess();
var selfupdatecheck = new BackgroundSelfUpdateChecker(this.cancelAllOperation.Token, this.webclient, dictionary.Count == 0 ? FrozenDictionary<string, string>.Empty : dictionary.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase));
selfupdatecheck.UpdateFound += this.OnSelfUpdateFound;
return selfupdatecheck;
}
Expand Down
2 changes: 1 addition & 1 deletion Updater/BootstrapUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public Task<BootstrapUpdater_CheckForUpdates> CheckForUpdatesAsync(string rootDi
#if DEBUG
jsonData = File.ReadAllText(Path.Combine(rootDirectory, @"..\docs\publish\v8\update.json"));
#else
jsonData = await this.wc.GetStringAsync("https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/update.json");
jsonData = await this.wc.GetStringAsync(SharedCode.LauncherUpdateManifest);
#endif
}
catch
Expand Down
9 changes: 9 additions & 0 deletions Updater/SharedCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Duplicate this file via LINK property in project file instead of importing Updater.dll assembly into LauncherCore (avoid loading Assembly).

namespace Leayal.PSO2Launcher.Updater
{
static class SharedCode
{
public const string LauncherUpdateManifest = "https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/update.json";
}
}
Binary file modified docs/publish/v8/files/BootstrapUpdater.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/LauncherCore.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/LauncherCoreNew.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/LauncherRSS.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/LauncherToolbox.Windows.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/LauncherToolbox.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.PSO2.Modding.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.PSO2.UserConfig.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.PSO2Installer.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.Shared.Windows.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.Shared.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/Leayal.SharedInterfaces.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/SQLite-net.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/WebViewCompat.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/plugins/rss/PSUBlogRSSFeed.dll
Binary file not shown.
Binary file modified docs/publish/v8/files/plugins/rss/WordpressRSSFeed.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/publish/v8/update.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"rep-version":3,"root-url":"https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/files/","root-url-critical":"https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/","files":{"BootstrapUpdater.dll":{"size":118784,"sha1":"E24F02538DF57D718204FCCAEA5085A63D504973"},"ControlzEx.dll":{"size":544768,"sha1":"F25E6F82F6AB63AF841142855DC60652BBDC8E28"},"ICSharpCode.AvalonEdit.dll":{"size":1458176,"sha1":"79DC747913779863CDBD8CB569B9CFA13D782448"},"LauncherCore.dll":{"size":1843200,"sha1":"226F5173E9106DF810DDBD37277EF207DE7B9FFC"},"LauncherCoreNew.dll":{"size":24576,"sha1":"1BA8C35AA9575AD08513B2D231F02BCFBD644B30"},"LauncherRSS.dll":{"size":102400,"sha1":"CB53CD44FCE0C114BF1AC4CDAEF8B45622A5387B"},"LauncherToolbox.dll":{"size":110592,"sha1":"02A3F063E5A0E6FD4A523C4C836E7023DCE73061"},"LauncherToolbox.Windows.dll":{"size":69632,"sha1":"AA68BECFEC4EEA4D672D40D98C63CACCF3D8EF24"},"Leayal.PSO2.Modding.dll":{"size":57344,"sha1":"5EEA79E0236711354B1119DA965016198FB731B4"},"Leayal.PSO2.UserConfig.dll":{"size":32768,"sha1":"7A222E6E505A5817FF14D506944FC5772233E1BB"},"Leayal.PSO2Installer.dll":{"size":20480,"sha1":"CF32E20E272B560538D2EE78171092B39435AFDA"},"Leayal.Shared.dll":{"size":73728,"sha1":"6DBC0A636F186D2DD81B2FC3CEEC0C959819B184"},"Leayal.Shared.Windows.dll":{"size":184320,"sha1":"74C79E6A2D537A46B34E1480359DD6E2F34511F8"},"Leayal.SharedInterfaces.dll":{"size":69632,"sha1":"2F63C942651633D7027F8915B2CC9C0477946FFA"},"MahApps.Metro.dll":{"size":4440064,"sha1":"5A4BB293E77BF8B2E26CB43A65E2015120411621"},"MahApps.Metro.IconPacks.Core.dll":{"size":49152,"sha1":"0A904A80575772C8CDEEE60CBF16EFBF3E8E20B1"},"MahApps.Metro.IconPacks.FontAwesome.dll":{"size":2486272,"sha1":"27C4F6A8CF107CF9B5343F6CA8DD27A680A6D6CA"},"Microsoft.Web.WebView2.Core.dll":{"size":921600,"sha1":"1635B1362F62DC2CC9A3DED60CEBEAA48ED2AC61"},"Microsoft.Web.WebView2.WinForms.dll":{"size":65536,"sha1":"174F3B7256617CF0868977066748543A4A1DE796"},"Microsoft.Xaml.Behaviors.dll":{"size":360448,"sha1":"966508F83C56AA1E1C1F35C19136EC75D0FD4CE0"},"SQLite-net.dll":{"size":397312,"sha1":"651EEA900AEA876595EE49DFE6958207F6BBC2C8"},"SQLitePCLRaw.core.dll":{"size":110592,"sha1":"3E3DBC8573899EBFBD12CAFBE397B7DE076F1940"},"System.Reflection.MetadataLoadContext.dll":{"size":569344,"sha1":"7552C7388CE05CD1657D463DE9EDD57787E66AD9"},"WebViewCompat.dll":{"size":65536,"sha1":"AF832BA771818D0040904FED0608EB2FD659A799"},"native-x64/e_sqlcipher.dll":{"cpu":"x64","size":1852928,"sha1":"3C5F9590D46EB7AAFC2C1EF599C66FFA9FAC4826"},"native-x64/WebView2Loader.dll":{"cpu":"x64","size":162264,"sha1":"3FD613F6C14B484446C71AA651D2CCA2C3515E2C"},"native-x86/e_sqlcipher.dll":{"cpu":"x86","size":1446912,"sha1":"80F0E7DE0B43D235F040880E46AE88E63779D7BD"},"native-x86/WebView2Loader.dll":{"cpu":"x86","size":117208,"sha1":"95C801D6D350A5820607253C7A3B7DF527651575"},"plugins/rss/PSUBlogRSSFeed.dll":{"size":16384,"sha1":"ABCCD7DDDBAFDE2AD970515A6850CD34AEACA8DE"},"plugins/rss/WordpressRSSFeed.dll":{"size":32768,"sha1":"9D12EAE818C43531A16349862A46EC5659882C36"}},"critical-files":null}
{"rep-version":3,"root-url":"https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/files/","root-url-critical":"https://leayal.github.io/PSO2-Launcher-CSharp/publish/v8/","files":{"BootstrapUpdater.dll":{"size":118784,"sha1":"A40C8F8804372EE7A4FF4FC1EAEAC491638B9437"},"ControlzEx.dll":{"size":544768,"sha1":"F25E6F82F6AB63AF841142855DC60652BBDC8E28"},"ICSharpCode.AvalonEdit.dll":{"size":1458176,"sha1":"79DC747913779863CDBD8CB569B9CFA13D782448"},"LauncherCore.dll":{"size":1843200,"sha1":"99D8ED6DADC739D9D8457FAF616A92D2948ADB17"},"LauncherCoreNew.dll":{"size":24576,"sha1":"34B28AE18E5B57F37BFE5DA2ECAAD04EA04A2A9B"},"LauncherRSS.dll":{"size":102400,"sha1":"16E8ADE493C0904738DED9C3BFFFFE00F6071EF7"},"LauncherToolbox.dll":{"size":110592,"sha1":"21228BBE03B41B4B0300CCC3CCF290567151C280"},"LauncherToolbox.Windows.dll":{"size":69632,"sha1":"E316C06552AF8027D50E14E72859C48B2FABA7C0"},"Leayal.PSO2.Modding.dll":{"size":57344,"sha1":"626E399C1BC3D50E88CA017E1D24E52A0CE628D2"},"Leayal.PSO2.UserConfig.dll":{"size":32768,"sha1":"81551A6BE2BD09458F6D58233D0DC81BA67874DA"},"Leayal.PSO2Installer.dll":{"size":20480,"sha1":"680E8D48FA32AD0ABED25B52C40095E7D2BB3873"},"Leayal.Shared.dll":{"size":73728,"sha1":"CF1F5DC139FAA37AC913D0E874FDDBBC9DEC5794"},"Leayal.Shared.Windows.dll":{"size":184320,"sha1":"080D4664C3C7FD05B925AB47DEFA55F2E3701840"},"Leayal.SharedInterfaces.dll":{"size":69632,"sha1":"E743AA36F5322862B6662EE00ED3723C44E28143"},"MahApps.Metro.dll":{"size":4440064,"sha1":"5A4BB293E77BF8B2E26CB43A65E2015120411621"},"MahApps.Metro.IconPacks.Core.dll":{"size":49152,"sha1":"0A904A80575772C8CDEEE60CBF16EFBF3E8E20B1"},"MahApps.Metro.IconPacks.FontAwesome.dll":{"size":2486272,"sha1":"27C4F6A8CF107CF9B5343F6CA8DD27A680A6D6CA"},"Microsoft.Web.WebView2.Core.dll":{"size":921600,"sha1":"1635B1362F62DC2CC9A3DED60CEBEAA48ED2AC61"},"Microsoft.Web.WebView2.WinForms.dll":{"size":65536,"sha1":"174F3B7256617CF0868977066748543A4A1DE796"},"Microsoft.Xaml.Behaviors.dll":{"size":360448,"sha1":"966508F83C56AA1E1C1F35C19136EC75D0FD4CE0"},"SQLite-net.dll":{"size":397312,"sha1":"F2451E86D5B3973CD598ED36B360C66B152ED17C"},"SQLitePCLRaw.core.dll":{"size":110592,"sha1":"3E3DBC8573899EBFBD12CAFBE397B7DE076F1940"},"System.Reflection.MetadataLoadContext.dll":{"size":569344,"sha1":"7552C7388CE05CD1657D463DE9EDD57787E66AD9"},"WebViewCompat.dll":{"size":65536,"sha1":"B1BE4641DB89F8EF13E612AB771944A67179249F"},"native-x64/e_sqlcipher.dll":{"cpu":"x64","size":1852928,"sha1":"3C5F9590D46EB7AAFC2C1EF599C66FFA9FAC4826"},"native-x64/WebView2Loader.dll":{"cpu":"x64","size":162264,"sha1":"3FD613F6C14B484446C71AA651D2CCA2C3515E2C"},"native-x86/e_sqlcipher.dll":{"cpu":"x86","size":1446912,"sha1":"80F0E7DE0B43D235F040880E46AE88E63779D7BD"},"native-x86/WebView2Loader.dll":{"cpu":"x86","size":117208,"sha1":"95C801D6D350A5820607253C7A3B7DF527651575"},"plugins/rss/PSUBlogRSSFeed.dll":{"size":16384,"sha1":"73260BB1256F903FE1E7481FC3DA196B5CDD5D52"},"plugins/rss/WordpressRSSFeed.dll":{"size":32768,"sha1":"EFA627BB629D0A85E38A275876240EA0DDC7C3BF"}},"critical-files":null}

0 comments on commit de47778

Please sign in to comment.