diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index bbc06ac6..a1cc788e 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -382,14 +382,16 @@ private void Form1_Load(object sender, EventArgs e) if (DateTime.Now.AddHours(-20) > Properties.Settings.Default.lastUpdateCheck) { bool displayModuleWindow = false; + bool selectDefaultImages = false; if (!Properties.Settings.Default.AlreadyAskedToDownloadSpeciesImageFiles) { Properties.Settings.Default.AlreadyAskedToDownloadSpeciesImageFiles = true; if (!Updater.Updater.IsProgramInstalled) displayModuleWindow = true; + else selectDefaultImages = true; } - CheckForUpdates(true, displayModuleWindow); + CheckForUpdates(true, displayModuleWindow, selectDefaultImages); } _filterListAllowed = true; @@ -1048,7 +1050,8 @@ private void checkForUpdatedStatsToolStripMenuItem_Click(object sender, EventArg CheckForUpdates(); } - private async void CheckForUpdates(bool silentCheck = false, bool displayModuleWindowAlways = false) + private async void CheckForUpdates(bool silentCheck = false, bool displayModuleWindowAlways = false, + bool selectDefaultImages = false) { bool? updaterRunning = await Updater.Updater.CheckForPortableUpdate(silentCheck, UnsavedChanges()); if (!updaterRunning.HasValue) return; // error @@ -1096,8 +1099,8 @@ private async void CheckForUpdates(bool silentCheck = false, bool displayModuleW "No new Version available", MessageBoxButtons.OK, MessageBoxIcon.Information); } - if (!silentCheck || displayModuleWindowAlways) - DisplayUpdateModules(!displayModuleWindowAlways); + if (!silentCheck || displayModuleWindowAlways || selectDefaultImages) + DisplayUpdateModules(!displayModuleWindowAlways, selectDefaultImages); } /// @@ -3495,12 +3498,15 @@ private void extraDataToolStripMenuItem_Click(object sender, EventArgs e) DisplayUpdateModules(); } - private async void DisplayUpdateModules(bool onlyDisplayIfUpdatesAreAvailable = false) + private async void DisplayUpdateModules(bool onlyDisplayIfUpdatesAreAvailable = false, bool selectDefaultImages = false) { using (var modules = new Updater.UpdateModules()) { - if (onlyDisplayIfUpdatesAreAvailable && !modules.UpdateAvailable) + if (!modules.UpdateAvailable && onlyDisplayIfUpdatesAreAvailable) + { + if (selectDefaultImages) InitializeImages(true); return; + } modules.ShowDialog(); if (modules.DialogResult != DialogResult.OK) @@ -3512,10 +3518,15 @@ private async void DisplayUpdateModules(bool onlyDisplayIfUpdatesAreAvailable = MessageBox.Show(result, $"Data downloaded - {Utils.ApplicationNameVersion}", MessageBoxButtons.OK, MessageBoxIcon.Information); - Properties.Settings.Default.SpeciesImagesFolder = modules.GetSpeciesImagesFolder(); - CreatureColored.InitializeSpeciesImageLocation(); + InitializeImages(); + + void InitializeImages(bool useDefaultImages = false) + { + Properties.Settings.Default.SpeciesImagesFolder = modules.GetSpeciesImagesFolder(useDefaultImages); + CreatureColored.InitializeSpeciesImageLocation(); - speciesSelector1.InitializeSpeciesImages(Values.V.species); + speciesSelector1.InitializeSpeciesImages(Values.V.species); + } } } } diff --git a/ARKBreedingStats/Updater/UpdateModules.cs b/ARKBreedingStats/Updater/UpdateModules.cs index 98c33129..4446318c 100644 --- a/ARKBreedingStats/Updater/UpdateModules.cs +++ b/ARKBreedingStats/Updater/UpdateModules.cs @@ -164,11 +164,11 @@ internal async Task DownloadRequestedModulesAsync() return sb.ToString(); } - public string GetSpeciesImagesFolder() + public string GetSpeciesImagesFolder(bool useDefaultImages) { if (!(_checkboxesSelectModule?.Any() ?? false)) return null; - return _checkboxesSelectModule.Where(cb => cb.Checked).Select(cb => cb.Tag as AsbModule) + return _checkboxesSelectModule.Where(cb => useDefaultImages || cb.Checked).Select(cb => cb.Tag as AsbModule) .FirstOrDefault(m => m?.Category == "Species Images")?.LocalPath; } } diff --git a/setup-debug.iss b/setup-debug.iss index 37b72e80..8405f706 100644 --- a/setup-debug.iss +++ b/setup-debug.iss @@ -105,14 +105,14 @@ Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}" Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon [Run] -Filename: "powershell.exe"; Parameters: "-nologo -noprofile -command ""& {{ Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('{tmp}\img.zip', '{localappdata}\{#AppName}\img\'); }"""; Flags: runminimized; StatusMsg: "{cm:InstallImages}"; Tasks: images +Filename: "powershell.exe"; Parameters: "-nologo -noprofile -command ""& {{ Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('{tmp}\speciesImages.zip', '{localappdata}\{#AppName}\images\speciesImages\'); }"""; Flags: runminimized; StatusMsg: "{cm:InstallImages}"; Tasks: images Filename: "{app}\{#AppExeName}"; Flags: nowait postinstall skipifsilent unchecked; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}" [UninstallRun] Filename: "taskkill"; Parameters: "/im ""{#AppExeName}"""; Flags: runhidden [UninstallDelete] -Type: filesandordirs; Name: "{app}\img" +Type: filesandordirs; Name: "{app}\images" [Code] var @@ -163,7 +163,7 @@ begin end; if (CurPageID = wpSelectTasks) then begin if IsTaskSelected('images') then - idpAddFile('https://github.com/cadon/ARKStatsExtractor/raw/master/img.zip', ExpandConstant('{tmp}\img.zip')); + idpAddFile('https://github.com/cadon/ARKStatsExtractor/raw/master/speciesImages/speciesImages.zip', ExpandConstant('{tmp}\speciesImages.zip')); idpDownloadAfter(wpReady); end; Result := True; diff --git a/setup.iss b/setup.iss index a19e7cc8..fa899f77 100644 --- a/setup.iss +++ b/setup.iss @@ -65,8 +65,8 @@ DotNetFrameworkFailed5100=Your computer does not meet the requirements of the .N de.DotNetFrameworkFailed5100=Ihr Computer erfüllt nicht die Voraussetzungen für das .NET Framework. DotNetFrameworkFailedOther=The .NET Framework installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not. de.DotNetFrameworkFailedOther=Die .NET Framework Installation endete mit dem nicht erwarteten Statuscode "%1". Überprüfen Sie alle anderen vom Installationsprogramm angezeigten Meldungen, um festzustellen, ob die Installation erfolgreich abgeschlossen wurde, und falls nicht, brechen Sie die Installation ab und beheben Sie das Problem. -DownloadImages=Download images for some of the species (~13 MB). -de.DownloadImages=Bilder für einige der Dinos herunterladen (~13 MB). +DownloadImages=Download images for some of the species (~17 MB). +de.DownloadImages=Bilder für einige der Dinos herunterladen (~17 MB). CreatureImages=Additional creature images de.CreatureImages=Zusätzliche Dino-Bilder InstallImages=Installing additionally creature images @@ -105,14 +105,14 @@ Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}" Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon [Run] -Filename: "powershell.exe"; Parameters: "-nologo -noprofile -command ""& {{ Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('{tmp}\img.zip', '{localappdata}\{#AppName}\img\'); }"""; Flags: runminimized; StatusMsg: "{cm:InstallImages}"; Tasks: images +Filename: "powershell.exe"; Parameters: "-nologo -noprofile -command ""& {{ Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('{tmp}\speciesImages.zip', '{localappdata}\{#AppName}\images\speciesImages\'); }"""; Flags: runminimized; StatusMsg: "{cm:InstallImages}"; Tasks: images Filename: "{app}\{#AppExeName}"; Flags: nowait postinstall skipifsilent unchecked; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}" [UninstallRun] Filename: "taskkill"; Parameters: "/im ""{#AppExeName}"""; Flags: runhidden [UninstallDelete] -Type: filesandordirs; Name: "{app}\img" +Type: filesandordirs; Name: "{app}\images" [Code] var @@ -163,7 +163,7 @@ begin end; if (CurPageID = wpSelectTasks) then begin if IsTaskSelected('images') then - idpAddFile('https://github.com/cadon/ARKStatsExtractor/raw/master/img.zip', ExpandConstant('{tmp}\img.zip')); + idpAddFile('https://github.com/cadon/ARKStatsExtractor/raw/master/speciesImages/speciesImages.zip', ExpandConstant('{tmp}\speciesImages.zip')); idpDownloadAfter(wpReady); end; Result := True;