mirror of
https://github.com/ckaczor/ChrisKaczor.Wpf.Application.StartWithWindows.git
synced 2026-01-13 17:22:24 -05:00
Fix auto-start path with DLL name
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Microsoft.Win32;
|
|
||||||
|
|
||||||
namespace ChrisKaczor.Wpf.Application
|
namespace ChrisKaczor.Wpf.Application
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ namespace ChrisKaczor.Wpf.Application
|
|||||||
|
|
||||||
public static void SetStartWithWindows(this System.Windows.Application application, string applicationName, bool value)
|
public static void SetStartWithWindows(this System.Windows.Application application, string applicationName, bool value)
|
||||||
{
|
{
|
||||||
var applicationPath = $"\"{Assembly.GetEntryAssembly()!.Location}\"";
|
var applicationPath = $"\"{Environment.ProcessPath}\"";
|
||||||
|
|
||||||
SetStartWithWindows(application, applicationName, applicationPath, value);
|
SetStartWithWindows(application, applicationName, applicationPath, value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user