GUI: Auto-migrate settings from previous version if needed
This commit is contained in:
@@ -14,6 +14,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
using Il2CppInspector;
|
using Il2CppInspector;
|
||||||
|
using Il2CppInspector.GUI;
|
||||||
using Il2CppInspector.Model;
|
using Il2CppInspector.Model;
|
||||||
using Il2CppInspector.PluginAPI.V100;
|
using Il2CppInspector.PluginAPI.V100;
|
||||||
using Il2CppInspector.Reflection;
|
using Il2CppInspector.Reflection;
|
||||||
@@ -26,8 +27,8 @@ namespace Il2CppInspectorGUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application, INotifyPropertyChanged
|
public partial class App : Application, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
// Catch unhandled exceptions for debugging startup failures and plugins
|
|
||||||
public App() : base() {
|
public App() : base() {
|
||||||
|
// Catch unhandled exceptions for debugging startup failures and plugins
|
||||||
var np = Environment.NewLine + Environment.NewLine;
|
var np = Environment.NewLine + Environment.NewLine;
|
||||||
|
|
||||||
Dispatcher.UnhandledException += (s, e) => {
|
Dispatcher.UnhandledException += (s, e) => {
|
||||||
@@ -49,6 +50,13 @@ namespace Il2CppInspectorGUI
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Migrate settings from previous version if necessary
|
||||||
|
if (User.Default.UpgradeRequired) {
|
||||||
|
User.Default.Upgrade();
|
||||||
|
User.Default.UpgradeRequired = false;
|
||||||
|
User.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
// Load plugins
|
// Load plugins
|
||||||
PluginManager.EnsureInit();
|
PluginManager.EnsureInit();
|
||||||
}
|
}
|
||||||
|
|||||||
14
Il2CppInspector.GUI/User.Designer.cs
generated
14
Il2CppInspector.GUI/User.Designer.cs
generated
@@ -12,7 +12,7 @@ namespace Il2CppInspector.GUI {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
|
||||||
internal sealed partial class User : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class User : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static User defaultInstance = ((User)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new User())));
|
private static User defaultInstance = ((User)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new User())));
|
||||||
@@ -34,5 +34,17 @@ namespace Il2CppInspector.GUI {
|
|||||||
this["ShowDecompilerWarning"] = value;
|
this["ShowDecompilerWarning"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool UpgradeRequired {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["UpgradeRequired"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UpgradeRequired"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,8 @@
|
|||||||
<Setting Name="ShowDecompilerWarning" Type="System.Boolean" Scope="User">
|
<Setting Name="ShowDecompilerWarning" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
Reference in New Issue
Block a user