Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HerpDerpinstine committed Feb 14, 2021
1 parent 2ad7812 commit 8dd8f02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ internal static void LogError(string msg)
TempFileCache.ClearCache();
OperationError();

#if DEBUG
FinishingMessageBox(msg, MessageBoxButtons.OK, MessageBoxIcon.Error);
#else
try
{
string filePath = Directory.GetCurrentDirectory() + $@"\MLInstaller_{DateTime.Now:yy-M-dd_HH-mm-ss.fff}.log";
File.WriteAllText(filePath, msg);
if (Config.HighlightLogLocation)
if (Config.HighlightLogFileLocation)
Process.Start("explorer.exe", $"/select, {filePath}");
#if DEBUG
FinishingMessageBox(msg, MessageBoxButtons.OK, MessageBoxIcon.Error);
#else
FinishingMessageBox($"INTERNAL FAILURE! Please upload the log file \"{filePath}\" when requesting support.", MessageBoxButtons.OK, MessageBoxIcon.Error);
#endif
}
catch (UnauthorizedAccessException)
{
FinishingMessageBox($"Couldn't create log file! Try running the Installer as Administrator or run the Installer from a different directory.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endif
}

internal static void OperationError()
Expand Down

0 comments on commit 8dd8f02

Please sign in to comment.