Version Update: 0.2.0

This commit is contained in:
Sour 2019-07-18 21:26:21 -04:00
parent 3992486fa1
commit cf33b464d8
4 changed files with 32 additions and 7 deletions

View file

@ -14,9 +14,9 @@ EmuSettings::EmuSettings()
uint32_t EmuSettings::GetVersion()
{
//Version 0.1.0
//Version 0.2.0
uint16_t major = 0;
uint8_t minor = 1;
uint8_t minor = 2;
uint8_t revision = 0;
return (major << 16) | (minor << 8) | revision;
}

View file

@ -57,6 +57,8 @@ namespace Mesen.GUI.Forms
base.OnShown(e);
EmuApi.InitDll();
bool showUpgradeMessage = UpdateHelper.PerformUpgrade();
ConfigManager.Config.Video.ApplyConfig();
EmuApi.InitializeEmu(ConfigManager.HomeFolder, Handle, ctrlRenderer.Handle, false, false, false);
@ -89,6 +91,10 @@ namespace Mesen.GUI.Forms
}));
});
if(showUpgradeMessage) {
MesenMsgBox.Show("UpgradeSuccess", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if(ConfigManager.Config.Preferences.AutomaticallyCheckForUpdates) {
UpdateHelper.CheckForUpdates(true);
}

View file

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Mesen-S (Alpha)")]
[assembly: AssemblyTitle("Mesen-S (Beta)")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mesen-S")]
[assembly: AssemblyProduct("Mesen-S (Alpha)")]
[assembly: AssemblyProduct("Mesen-S (Beta)")]
[assembly: AssemblyCopyright("Copyright © 2019 M. Bibaud")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.*")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyVersion("0.2.*")]
[assembly: AssemblyFileVersion("0.2.0.0")]

View file

@ -1,4 +1,5 @@
using Mesen.GUI.Forms;
using Mesen.GUI.Config;
using Mesen.GUI.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
@ -12,6 +13,24 @@ namespace Mesen.GUI.Updates
{
public static class UpdateHelper
{
public static bool PerformUpgrade()
{
Version newVersion = EmuApi.GetMesenVersion();
Version oldVersion = new Version(ConfigManager.Config.Version);
if(oldVersion < newVersion) {
//Upgrade
if(oldVersion <= new Version("0.1.0")) {
ConfigManager.Config.Audio.MasterVolume = 100;
}
ConfigManager.Config.Version = EmuApi.GetMesenVersion().ToString();
ConfigManager.ApplyChanges();
return true;
}
return false;
}
public static void CheckForUpdates(bool silent)
{
Task.Run(() => {