Skip to content

Commit 0d694ab

Browse files
committed
* Fixed autostartup
1 parent 1a6e793 commit 0d694ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MemPlus/Windows/SettingsWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private void LoadProperties()
153153
/// <returns>A boolean to represent whether the program starts automatically or not.</returns>
154154
private static bool AutoStartUp()
155155
{
156-
return Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MemPlus", "").ToString() == AppDomain.CurrentDomain.BaseDirectory;
156+
return Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MemPlus", "").ToString() == System.Reflection.Assembly.GetExecutingAssembly().Location;
157157
}
158158

159159
/// <summary>
@@ -167,7 +167,7 @@ private void SaveProperties()
167167
//General
168168
if (ChbAutoStart.IsChecked != null && ChbAutoStart.IsChecked.Value)
169169
{
170-
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MemPlus", AppDomain.CurrentDomain.BaseDirectory);
170+
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MemPlus", System.Reflection.Assembly.GetExecutingAssembly().Location);
171171
} else if (ChbAutoStart.IsChecked != null && !ChbAutoStart.IsChecked.Value)
172172
{
173173
if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MemPlus","").ToString() != "")

0 commit comments

Comments
 (0)