mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-28 02:50:23 +12:00
[BUG] autostart activate not always working #28
https://github.com/Hofknecht/SystemTrayMenu/issues/28
This commit is contained in:
parent
47bba47ea4
commit
87e00358ed
17
Config.cs
17
Config.cs
|
@ -1,5 +1,4 @@
|
|||
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace SystemTrayMenu
|
||||
|
@ -16,10 +15,22 @@ namespace SystemTrayMenu
|
|||
}
|
||||
}
|
||||
|
||||
public static void UpgradeIfNotUpgraded()
|
||||
{
|
||||
if (!Properties.Settings.Default.IsUpgraded)
|
||||
{
|
||||
// configs located at "%localappdata%\<AssemblyCompany>\"
|
||||
Properties.Settings.Default.Upgrade();
|
||||
Properties.Settings.Default.IsUpgraded = true;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool LoadOrSetByUser()
|
||||
{
|
||||
Properties.Settings.Default.Upgrade(); // configs located at "%localappdata%\<AssemblyCompany>\"
|
||||
bool pathOK = Directory.Exists(Properties.Settings.Default.PathDirectory);
|
||||
bool pathOK = Directory.Exists(
|
||||
Properties.Settings.Default.PathDirectory);
|
||||
|
||||
if (!pathOK)
|
||||
{
|
||||
pathOK = SetFolderByUser();
|
||||
|
|
|
@ -31,5 +31,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.9.1.243")]
|
||||
[assembly: AssemblyFileVersion("0.9.1.243")]
|
||||
[assembly: AssemblyVersion("0.9.1.244")]
|
||||
[assembly: AssemblyFileVersion("0.9.1.244")]
|
||||
|
|
12
Properties/Settings.Designer.cs
generated
12
Properties/Settings.Designer.cs
generated
|
@ -70,5 +70,17 @@ namespace SystemTrayMenu.Properties {
|
|||
this["HotKey"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool IsUpgraded {
|
||||
get {
|
||||
return ((bool)(this["IsUpgraded"]));
|
||||
}
|
||||
set {
|
||||
this["IsUpgraded"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,5 +14,8 @@
|
|||
<Setting Name="HotKey" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="IsUpgraded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
|
@ -211,6 +211,7 @@ namespace SystemTrayMenu
|
|||
messageFilter.MouseLeave += fastLeave.Start;
|
||||
fastLeave.Leave += FadeHalfOrOutIfNeeded;
|
||||
|
||||
Config.UpgradeIfNotUpgraded();
|
||||
if (!Config.LoadOrSetByUser())
|
||||
{
|
||||
cancelAppRun = true;
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
<setting name="HotKey" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="IsUpgraded" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</SystemTrayMenu.Properties.Settings>
|
||||
</userSettings>
|
||||
<!--
|
||||
|
|
Loading…
Reference in a new issue