Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/RepoM.App/AutoStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace RepoM.App;
using System.Reflection;
using Microsoft.Win32;

public static class AutoStart
internal static class AutoStart
{
private const string REG_KEY = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";

Expand Down Expand Up @@ -42,6 +42,14 @@ private static string GetValueAsString(RegistryKey? key, string appName)

private static string GetAppPath()
{
return $"\"{Assembly.GetEntryAssembly()!.Location}\"";
var path = Assembly.GetEntryAssembly()!.Location;

// Dirty hack. We need the exe instead of dll (this has probably something to do with the upgrade to net6)
if (path.EndsWith(".dll", StringComparison.CurrentCultureIgnoreCase))
{
path = path[..^4] + ".exe";
}

return $"\"{path}\"";
}
}