From: Paul Betts Date: Sat, 6 Dec 2014 07:01:03 +0000 (-0800) Subject: Determine the Helper name from the App name X-Git-Tag: v0.20.0~8^2~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3d4491a4682a779f21232e08255d6fdaede04cc8;p=electron.git Determine the Helper name from the App name --- diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm index 9795ee45..856f510a 100644 --- a/atom/app/atom_main_delegate_mac.mm +++ b/atom/app/atom_main_delegate_mac.mm @@ -19,18 +19,28 @@ base::FilePath GetFrameworksPath() { .Append("Frameworks"); } +std::string GetApplicationName() { + std::string name = brightray::MainApplicationBundlePath().BaseName().AsUTF8Unsafe(); + return name.substr(0, name.length() - 4/*.app*/); +} + } // namespace void AtomMainDelegate::OverrideFrameworkBundlePath() { - base::mac::SetOverrideFrameworkBundlePath( - GetFrameworksPath().Append("Atom Framework.framework")); + base::FilePath bundlePath = GetFrameworksPath(); + std::string app_name = GetApplicationName(); + + base::mac::SetOverrideFrameworkBundlePath(bundlePath + .Append(app_name + " Framework.framework")); } void AtomMainDelegate::OverrideChildProcessPath() { - base::FilePath helper_path = GetFrameworksPath().Append("Atom Helper.app") + std::string app_name = GetApplicationName(); + + base::FilePath helper_path = GetFrameworksPath().Append(app_name + " Helper.app") .Append("Contents") .Append("MacOS") - .Append("Atom Helper"); + .Append(app_name + " Helper"); PathService::Override(content::CHILD_PROCESS_EXE, helper_path); }