OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | 5 #include "chrome/installer/launcher_support/chrome_launcher_support.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe); | 109 GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe); |
110 } | 110 } |
111 | 111 |
112 } // namespace | 112 } // namespace |
113 | 113 |
114 base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) { | 114 base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) { |
115 return FindExeRelativeToSetupExe( | 115 return FindExeRelativeToSetupExe( |
116 GetSetupExeForInstallationLevel(level), kChromeExe); | 116 GetSetupExeForInstallationLevel(level), kChromeExe); |
117 } | 117 } |
118 | 118 |
119 base::FilePath GetAnyChromePath() { | 119 base::FilePath GetAnyChromePath(bool is_canary) { |
120 base::FilePath chrome_path; | 120 base::FilePath path; |
121 if (chrome_path.empty()) | 121 if (is_canary) { |
122 chrome_path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); | 122 // TODO(mgiuca): Ask jackhou why this logic is reversed compared to the |
123 if (chrome_path.empty()) | 123 // non-canary path. |
Matt Giuca
2014/10/30 02:54:50
Question for Jack: Is there a reason you prioritiz
jackhou1
2014/10/30 03:59:22
Canary is installed at user level by default.
Matt Giuca
2014/10/30 04:22:58
Thanks, I will update this comment then.
grt (UTC plus 2)
2014/10/30 16:44:53
Not only is it user-level by default, it's always
Vitaly Buka (NO REVIEWS)
2014/10/30 16:46:17
Yes, It's installed. Still, my guess, consistency
grt (UTC plus 2)
2014/10/31 03:29:00
Agreed. This is what I meant with my previous comm
Matt Giuca
2015/01/09 06:17:32
Done.
| |
124 chrome_path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION); | 124 path = GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION); |
125 return chrome_path; | 125 if (path.empty()) |
126 } | 126 path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); |
127 | 127 } else { |
128 base::FilePath GetAnyChromeSxSPath() { | 128 path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); |
Vitaly Buka (NO REVIEWS)
2014/10/30 16:46:17
Could you fall back here to non-canary if canary i
jackhou1
2014/10/31 00:05:54
For app_installer at least, it would be preferable
grt (UTC plus 2)
2014/10/31 03:29:00
If it makes sense for some consumers to take whate
Matt Giuca
2015/01/09 06:17:32
I'd like to hold off on doing this unless there is
grt (UTC plus 2)
2015/01/09 17:45:28
SGTM
| |
129 base::FilePath path = | 129 if (path.empty()) |
130 GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION); | 130 path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION); |
131 if (path.empty()) | 131 } |
132 path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); | |
133 return path; | 132 return path; |
134 } | 133 } |
135 | 134 |
136 } // namespace chrome_launcher_support | 135 } // namespace chrome_launcher_support |
OLD | NEW |