From e81cf74b39bd208ee3442e3259a50db6acbb2f0c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 8 Aug 2017 10:17:03 -0700 Subject: [PATCH] add windows override path and cleanup linux --- brightray/browser/browser_main_parts.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 9bf2e104a94..dc210fca09a 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -4,6 +4,8 @@ #include "brightray/browser/browser_main_parts.h" +#include + #include "base/command_line.h" #include "base/feature_list.h" #include "base/strings/string_number_conversions.h" @@ -90,19 +92,21 @@ void OverrideLinuxAppDataPath() { PathService::Override(DIR_APP_DATA, path); } -// void OverrideWinAppLogsPath() { -// base::FilePath path; -// // should be in c:\program files\myapp\logs ? -// PathService::Override(DIR_APP_DATA, path); -// } +void OverrideWinAppLogsPath() { + std::string appName = GetApplicationName(); + std::string logPath = "%systemdrive%%homepath%\AppData\Roaming\\"; + std::string appLogPath = logPath + appName + "\logs"; + + PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); +} void OverrideLinuxAppLogsPath() { std::string appName = GetApplicationName(); - std::string logPath = "/var/log"; + std::string logPath = "/var/log/"; std::string appLogPath = logPath + appName; - PathService::Override(DIR_APP_LOGS base::FilePath(appLogPath)); + PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); } int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { @@ -184,9 +188,9 @@ void BrowserMainParts::PreEarlyInitialization() { #if defined(OS_LINUX) OverrideLinuxAppLogsPath(); #endif -// #if defined(OS_WIN) -// OverrideWinAppLogsPath(); -// #endif +#if defined(OS_WIN) + OverrideWinAppLogsPath(); +#endif #if defined(USE_X11) views::LinuxUI::SetInstance(BuildGtkUi()); OverrideLinuxAppDataPath();