From f00a0b1a619d6214276ef7cff6c510d836ae6f15 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 24 Jul 2016 11:25:21 +0200 Subject: [PATCH] issue #0002638: Windows installer doesn't create the macro folder --- src/App/Application.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 27ccfe52e6..04a4cd981f 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -2089,6 +2089,19 @@ void Application::ExtractUserPath() // the application due to branding reasons. appData += PATHSEP; mConfig["UserAppData"] = appData; + + // Create the default macro directory + fi.setFile(getUserMacroDir()); + if (!fi.exists() && !Py_IsInitialized()) { + if (!fi.createDirectory()) { + // If the creation fails only write an error but do not raise an + // exception because it doesn't prevent FreeCAD from working + std::string error = "Cannot create directory "; + error += fi.fileName(); + // Want more details on console + std::cerr << error << std::endl; + } + } } #else # error "Implement ExtractUserPath() for your platform."