Warn about in-place downgrades

This commit is contained in:
pizzaboxer 2024-08-27 12:53:03 +01:00
parent bac13eb507
commit 9a412ea17b
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
4 changed files with 33 additions and 0 deletions

View File

@ -220,8 +220,10 @@ namespace Bloxstrap
Locale.Set(Settings.Prop.Locale);
#if !DEBUG
if (!LaunchSettings.UninstallFlag.Active)
Installer.HandleUpgrade();
#endif
LaunchHandler.ProcessLaunchArgs();
}

View File

@ -340,6 +340,18 @@ namespace Bloxstrap
if (MD5Hash.FromFile(Paths.Process) == MD5Hash.FromFile(Paths.Application))
return;
if (currentVer is not null && existingVer is not null && Utilities.CompareVersions(currentVer, existingVer) == VersionComparison.LessThan)
{
var result = Frontend.ShowMessageBox(
Strings.InstallChecker_VersionLessThanInstalled,
MessageBoxImage.Question,
MessageBoxButton.YesNo
);
if (result != MessageBoxResult.Yes)
return;
}
// silently upgrade version if the command line flag is set or if we're launching from an auto update
if (!App.LaunchSettings.UpgradeFlag.Active && !isAutoUpgrade)
{
@ -466,6 +478,9 @@ namespace Bloxstrap
App.FastFlags.Save();
}
if (currentVer is null)
return;
if (isAutoUpgrade)
{
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");

View File

@ -1276,6 +1276,17 @@ namespace Bloxstrap.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to The version of Bloxstrap you&apos;ve launched is older than the version you currently have installed.
///Issues may occur and your settings may be altered. A reinstall is recommended.
///Are you sure you want to continue?.
/// </summary>
public static string InstallChecker_VersionLessThanInstalled {
get {
return ResourceManager.GetString("InstallChecker.VersionLessThanInstalled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Will drop you into the desktop app once everything&apos;s done.
/// </summary>

View File

@ -1142,4 +1142,9 @@ If not, then please report this exception to the maintainers of this fork. Do NO
<data name="Menu.UnsavedChanges" xml:space="preserve">
<value>You have unsaved changes. Are you sure you want to close without saving?</value>
</data>
<data name="InstallChecker.VersionLessThanInstalled" xml:space="preserve">
<value>The version of Bloxstrap you've launched is older than the version you currently have installed.
Issues may occur and your settings may be altered. A reinstall is recommended.
Are you sure you want to continue?</value>
</data>
</root>