Skip to content

Commit

Permalink
Fixed updater 2021-12-06_00
Browse files Browse the repository at this point in the history
- For the past hour I have tried to figure out why the program was randomly exiting... To put it simply: The program was pulling the working directory instead of it's own directory. It then checks for every .exe in the parent directory, other than
- Fixed updater not scrolling to bottom with update text.
  • Loading branch information
TCNOco committed Dec 6, 2021
1 parent 4af5da1 commit 8dc480f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions TcNo-Acc-Switcher-Updater/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ private void SetStatusAndLog(string s, string lineBreak = "\n")
{
StatusLabel.Content = s;
LogBox.Text += lineBreak + s;
}), DispatcherPriority.Normal);

_ = Dispatcher.BeginInvoke(new Action(() =>
{
LogBox.ScrollToEnd();
}), DispatcherPriority.Normal);
}
Expand All @@ -177,7 +181,6 @@ private void UpdateProgress(int percent)
}

private Dictionary<string, string> _updatesAndChanges = new();
private readonly string _currentDir = Directory.GetCurrentDirectory();

private readonly string
_updaterDirectory =
Expand Down Expand Up @@ -649,7 +652,7 @@ private void DoUpdate()
ButtonHandler(false, "Started");
SetStatusAndLog("Closing TcNo Account Switcher instances (if any).");
// Check if files are in use
CloseIfRunning(_currentDir);
CloseIfRunning(Directory.GetParent(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? string.Empty)?.FullName);

if (Directory.Exists("wwwroot"))
{
Expand Down

0 comments on commit 8dc480f

Please sign in to comment.