Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Version Update: 0.2.0
  • Loading branch information
SourMesen committed Jul 19, 2019
1 parent 3992486 commit cf33b464d8f9ae98f0816da6b7587c76ed0cf7cd
Showing with 32 additions and 7 deletions.
  1. +2 −2 Core/EmuSettings.cpp
  2. +6 −0 UI/Forms/frmMain.cs
  3. +4 −4 UI/Properties/AssemblyInfo.cs
  4. +20 −1 UI/Updates/UpdateHelper.cs
@@ -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;
}
@@ -57,6 +57,8 @@ protected override void OnShown(EventArgs e)
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 @@ protected override void OnShown(EventArgs e)
}));
});

if(showUpgradeMessage) {
MesenMsgBox.Show("UpgradeSuccess", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

if(ConfigManager.Config.Preferences.AutomaticallyCheckForUpdates) {
UpdateHelper.CheckForUpdates(true);
}
@@ -5,11 +5,11 @@
// 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 @@
// 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")]
@@ -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(() => {

0 comments on commit cf33b46

Please sign in to comment.