Skip to content

Commit

Permalink
fixed manifest download
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed May 15, 2021
1 parent 1574453 commit 9d6474d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

2 changes: 1 addition & 1 deletion ARKBreedingStats/Updater/UpdateModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private static (bool? updateAvailable, string localVersion, string remoteVersion
/// <returns></returns>
internal static async Task<bool> DownloadManifest()
{
return await DownloadManifestFile(ManifestUrl, Path.Combine(FileService.GetJsonPath(FileService.ValuesFolder), FileService.ManifestFileName));
return await DownloadManifestFile(ManifestUrl, FileService.GetPath(FileService.ManifestFileName));
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d6474d

Please sign in to comment.