From d97b0fbf96e7122f515342b8a02fdfd8e799032d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 29 Sep 2020 16:42:27 +0200 Subject: [PATCH] Use a better location for windows crashdumps On Windows, a user's $HOME dir may not exist, or not be writable, also cluttering up the $HOME with crashlogs is not great. --- gtk2_ardour/main.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 3aaa409992..27b4fdbdb2 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -342,12 +342,11 @@ int main (int argc, char *argv[]) #ifdef HAVE_DRMINGW if (true) { - Glib::DateTime tm (g_date_time_new_now_local ()); - string crash_dir = Glib::get_home_dir(); - if (crash_dir.empty ()) { - crash_dir = Glib::get_user_data_dir (); - } + /* %localappdata%\Ardour\CrashLog\ */ + string crash_dir = Glib::build_filename (Glib::get_user_data_dir (), string_compose ("%1%2", PROGRAM_NAME, PROGRAM_VERSION), "CrashLog"); + g_mkdir_with_parents (crash_dir.c_str(), 0700); + Glib::DateTime tm (g_date_time_new_now_local ()); string crash_file = string_compose ("%1-crash-%2.txt", PROGRAM_NAME, tm.format ("%s")); string crash_path = Glib::build_filename (crash_dir, crash_file);