Upgrade settings file

This commit is contained in:
Christian Wade 2019-12-13 21:26:04 -08:00
parent 98347e358d
commit 3f5c104935
6 changed files with 36 additions and 6 deletions

View File

@ -1,4 +1,5 @@
using Microsoft.AnalysisServices; using BismNormalizer;
using Microsoft.AnalysisServices;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -20,6 +21,18 @@ namespace AlmToolkit
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
//If new install, see if need to migrate settings file from previous version
try
{
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}
}
catch { }
if (args != null && args.Length > 0) if (args != null && args.Length > 0)
{ {
if (args.Length > 1) if (args.Length > 1)

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.5")] [assembly: AssemblyVersion("4.0.0.7")]
[assembly: AssemblyFileVersion("4.0.0.5")] [assembly: AssemblyFileVersion("4.0.0.7")]

View File

@ -48,7 +48,6 @@ Global
{849693FC-AD82-4323-8A96-D6A0F6D97566}.Release|x64.ActiveCfg = Release|Any CPU {849693FC-AD82-4323-8A96-D6A0F6D97566}.Release|x64.ActiveCfg = Release|Any CPU
{849693FC-AD82-4323-8A96-D6A0F6D97566}.Release|x64.Build.0 = Release|Any CPU {849693FC-AD82-4323-8A96-D6A0F6D97566}.Release|x64.Build.0 = Release|Any CPU
{3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|x64.ActiveCfg = Debug|Any CPU {3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|x64.ActiveCfg = Debug|Any CPU
{3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|x64.Build.0 = Debug|Any CPU {3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Debug|x64.Build.0 = Debug|Any CPU
{3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {3AE5D06F-A054-4AD1-83A9-9F0B8B1FC0B4}.Release|Any CPU.ActiveCfg = Release|Any CPU

View File

@ -12,10 +12,10 @@ namespace BismNormalizer {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
public static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default { public static Settings Default {
get { get {
@ -334,5 +334,17 @@ namespace BismNormalizer {
this["LastBimFileLocation"] = value; this["LastBimFileLocation"] = 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;
}
}
} }
} }

View File

@ -80,5 +80,8 @@
<Setting Name="LastBimFileLocation" Type="System.String" Scope="User"> <Setting Name="LastBimFileLocation" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -85,6 +85,9 @@
<setting name="LastBimFileLocation" serializeAs="String"> <setting name="LastBimFileLocation" serializeAs="String">
<value /> <value />
</setting> </setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
</BismNormalizer.Settings> </BismNormalizer.Settings>
</userSettings> </userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>