Skip to content

Commit 1434257

Browse files
committed
Remove auto startup position
1 parent 437b1c0 commit 1434257

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

Flow.Launcher/Helper/AutoStartup.cs renamed to Flow.Launcher.Infrastructure/AutoStartup.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
using System.IO;
33
using System.Linq;
44
using System.Security.Principal;
5-
using Flow.Launcher.Infrastructure;
65
using Flow.Launcher.Infrastructure.Logger;
76
using Microsoft.Win32;
87
using Microsoft.Win32.TaskScheduler;
98

10-
namespace Flow.Launcher.Helper;
9+
namespace Flow.Launcher.Infrastructure;
1110

1211
public class AutoStartup
1312
{
@@ -32,7 +31,7 @@ public static bool IsEnabled
3231
var path = key?.GetValue(Constant.FlowLauncher) as string;
3332
return path == Constant.ExecutablePath;
3433
}
35-
catch (Exception e)
34+
catch (System.Exception e)
3635
{
3736
Log.Error("AutoStartup", $"Ignoring non-critical registry error (querying if enabled): {e}");
3837
}
@@ -59,7 +58,7 @@ private static bool CheckLogonTask()
5958

6059
return true;
6160
}
62-
catch (Exception e)
61+
catch (System.Exception e)
6362
{
6463
Log.Error("AutoStartup", $"Failed to check logon task: {e}");
6564
}
@@ -110,7 +109,7 @@ private static void Disable(bool logonTask)
110109
key?.DeleteValue(Constant.FlowLauncher, false);
111110
}
112111
}
113-
catch (Exception e)
112+
catch (System.Exception e)
114113
{
115114
Log.Error("AutoStartup", $"Failed to disable auto-startup: {e}");
116115
throw;
@@ -131,7 +130,7 @@ private static void Enable(bool logonTask)
131130
key?.SetValue(Constant.FlowLauncher, $"\"{Constant.ExecutablePath}\"");
132131
}
133132
}
134-
catch (Exception e)
133+
catch (System.Exception e)
135134
{
136135
Log.Error("AutoStartup", $"Failed to enable auto-startup: {e}");
137136
throw;
@@ -159,7 +158,7 @@ private static bool ScheduleLogonTask()
159158
TaskService.Instance.RootFolder.RegisterTaskDefinition(LogonTaskName, td);
160159
return true;
161160
}
162-
catch (Exception e)
161+
catch (System.Exception e)
163162
{
164163
Log.Error("AutoStartup", $"Failed to schedule logon task: {e}");
165164
return false;
@@ -174,7 +173,7 @@ private static bool UnscheduleLogonTask()
174173
taskService.RootFolder.DeleteTask(LogonTaskName);
175174
return true;
176175
}
177-
catch (Exception e)
176+
catch (System.Exception e)
178177
{
179178
Log.Error("AutoStartup", $"Failed to unschedule logon task: {e}");
180179
return false;

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net7.0-windows</TargetFramework>
@@ -68,6 +68,7 @@
6868
<PackageReference Include="NLog" Version="4.7.10" />
6969
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
7070
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
71+
<PackageReference Include="TaskScheduler" Version="2.11.0" />
7172
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled-->
7273
<!--Bumping to it or higher needs to test and ensure this is no longer a problem-->
7374
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />

Flow.Launcher/App.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,17 @@ private void AutoStartup()
165165
{
166166
// we try to enable auto-startup on first launch, or reenable if it was removed
167167
// but the user still has the setting set
168-
if (_settings.StartFlowLauncherOnSystemStartup && !Helper.AutoStartup.IsEnabled)
168+
if (_settings.StartFlowLauncherOnSystemStartup && !Infrastructure.AutoStartup.IsEnabled)
169169
{
170170
try
171171
{
172172
if (_settings.UseLogonTaskForStartup)
173173
{
174-
Helper.AutoStartup.EnableViaLogonTask();
174+
Infrastructure.AutoStartup.EnableViaLogonTask();
175175
}
176176
else
177177
{
178-
Helper.AutoStartup.EnableViaRegistry();
178+
Infrastructure.AutoStartup.EnableViaRegistry();
179179
}
180180
}
181181
catch (Exception e)

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
<PackageReference Include="NHotkey.Wpf" Version="3.0.0" />
105105
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
106106
<PackageReference Include="SemanticVersioning" Version="3.0.0" />
107-
<PackageReference Include="TaskScheduler" Version="2.11.0" />
108107
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.1" />
109108
</ItemGroup>
110109

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Flow.Launcher.Core;
77
using Flow.Launcher.Core.Configuration;
88
using Flow.Launcher.Core.Resource;
9-
using Flow.Launcher.Helper;
9+
using Flow.Launcher.Infrastructure;
1010
using Flow.Launcher.Infrastructure.UserSettings;
1111
using Flow.Launcher.Plugin;
1212
using Flow.Launcher.Plugin.SharedModels;

0 commit comments

Comments
 (0)