diff --git a/Wabbajack.Common/Utils.cs b/Wabbajack.Common/Utils.cs index de12e992..ed87903d 100644 --- a/Wabbajack.Common/Utils.cs +++ b/Wabbajack.Common/Utils.cs @@ -497,24 +497,7 @@ namespace Wabbajack.Common public static string ExceptionToString(this Exception ex) { - var sb = new StringBuilder(); - while (ex != null) - { - sb.AppendLine(ex.Message); - var st = new StackTrace(ex, true); - foreach (var frame in st.GetFrames()) - sb.AppendLine( - $"{frame.GetFileName()}:{frame.GetMethod().Name}:{frame.GetFileLineNumber()}:{frame.GetFileColumnNumber()}"); - ex = ex.InnerException; - } - - - return sb.ToString(); - } - - public static void CrashDump(Exception e) - { - File.WriteAllText($"{DateTime.Now.ToString("yyyyMMddTHHmmss_crash_log.txt")}", ExceptionToString(e)); + return ex.ToString(); } public static IEnumerable DistinctBy(this IEnumerable vs, Func select) diff --git a/Wabbajack.Lib/Installer.cs b/Wabbajack.Lib/Installer.cs index e26b0d00..70d636bd 100644 --- a/Wabbajack.Lib/Installer.cs +++ b/Wabbajack.Lib/Installer.cs @@ -400,7 +400,21 @@ namespace Wabbajack.Lib void CopyFile(string from, string to, bool use_move) { if (File.Exists(to)) + { + var fi = new FileInfo(to); + if (fi.IsReadOnly) + fi.IsReadOnly = false; File.Delete(to); + } + + if (File.Exists(from)) + { + var fi = new FileInfo(from); + if (fi.IsReadOnly) + fi.IsReadOnly = false; + } + + if (use_move) File.Move(from, to); else