From 9d6474d649667690b1b6e49a0bbe960a1f42357d Mon Sep 17 00:00:00 2001 From: cadon Date: Sun, 16 May 2021 01:28:12 +0200 Subject: [PATCH] fixed manifest download --- ARKBreedingStats/Form1.cs | 6 ++++++ ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/Updater/UpdateModules.cs | 2 +- ARKBreedingStats/Updater/Updater.cs | 2 +- ARKBreedingStats/_manifest.json | 2 +- setup.iss | 1 + 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index a1cc788e..7320349e 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -3500,6 +3500,12 @@ private void extraDataToolStripMenuItem_Click(object sender, EventArgs e) private async void DisplayUpdateModules(bool onlyDisplayIfUpdatesAreAvailable = false, bool selectDefaultImages = false) { + + var manifestFilePath = FileService.GetPath(FileService.ManifestFileName); + if (!File.Exists(manifestFilePath)) + if (!await Updater.Updater.DownloadManifest()) + return; + using (var modules = new Updater.UpdateModules()) { if (!modules.UpdateAvailable && onlyDisplayIfUpdatesAreAvailable) diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index f97b2a92..826fb7ec 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.46.1.0")] +[assembly: AssemblyFileVersion("0.46.2.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/Updater/UpdateModules.cs b/ARKBreedingStats/Updater/UpdateModules.cs index 4446318c..011bd343 100644 --- a/ARKBreedingStats/Updater/UpdateModules.cs +++ b/ARKBreedingStats/Updater/UpdateModules.cs @@ -18,7 +18,7 @@ public UpdateModules() var manifestFilePath = FileService.GetPath(FileService.ManifestFileName); if (!File.Exists(manifestFilePath)) - Task.Run(async () => await Updater.DownloadManifest()); + return; _asbManifest = AsbManifest.FromJsonFile(manifestFilePath); if (_asbManifest?.modules == null) return; diff --git a/ARKBreedingStats/Updater/Updater.cs b/ARKBreedingStats/Updater/Updater.cs index 77cca8ee..839d6a8a 100644 --- a/ARKBreedingStats/Updater/Updater.cs +++ b/ARKBreedingStats/Updater/Updater.cs @@ -189,7 +189,7 @@ private static (bool? updateAvailable, string localVersion, string remoteVersion /// internal static async Task DownloadManifest() { - return await DownloadManifestFile(ManifestUrl, Path.Combine(FileService.GetJsonPath(FileService.ValuesFolder), FileService.ManifestFileName)); + return await DownloadManifestFile(ManifestUrl, FileService.GetPath(FileService.ManifestFileName)); } /// diff --git a/ARKBreedingStats/_manifest.json b/ARKBreedingStats/_manifest.json index dcb6bb0c..cd1f0840 100644 --- a/ARKBreedingStats/_manifest.json +++ b/ARKBreedingStats/_manifest.json @@ -4,7 +4,7 @@ "ARK Smart Breeding": { "Id": "ARK Smart Breeding", "Category": "main", - "version": "0.46.1.0" + "version": "0.46.2.0" }, "SpeciesColorImages": { "Id": "SpeciesColorImages", diff --git a/setup.iss b/setup.iss index fa899f77..174e55f8 100644 --- a/setup.iss +++ b/setup.iss @@ -92,6 +92,7 @@ Source: "{#ReleaseDir}\ja\*"; DestDir: "{app}\ja\"; Flags: ignoreversion; Exclud Source: "{#ReleaseDir}\pl\*"; DestDir: "{app}\pl\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml" Source: "{#ReleaseDir}\ru\*"; DestDir: "{app}\ru\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml" Source: "{#ReleaseDir}\zh\*"; DestDir: "{app}\zh\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml" +Source: "{#ReleaseDir}\_manifest.json"; DestDir: "{localappdata}\{#AppName}\"; Flags: ignoreversion Source: "{#ReleaseDir}\json\*.json"; DestDir: "{localappdata}\{#AppName}\json\"; Flags: ignoreversion Source: "{#ReleaseDir}\json\values\values.json"; DestDir: "{localappdata}\{#AppName}\json\values\"; Flags: ignoreversion Source: "{#ReleaseDir}\json\values\_manifest.json"; DestDir: "{localappdata}\{#AppName}\json\values\"; Flags: ignoreversion