Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Unified Diff: chrome/installer/util/install_util.cc

Issue 11685006: [Fixit-Dec-2012] Auto-launch system-level Chrome post user-level Chrome self-destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ++grt Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/uninstall.cc ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util.cc
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index d98a30b5037145aefa3fcc425c4044ab3cbb8e20..ce97417cd034f21fe8c5e2cb79081839afb7382e 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -384,7 +384,22 @@ bool InstallUtil::GetSentinelFilePath(const FilePath::CharType* file,
return false;
if (IsPerUserInstall(exe_path.value().c_str())) {
- *path = exe_path;
+ const FilePath maybe_product_dir(exe_path.DirName().DirName());
+ if (file_util::PathExists(exe_path.Append(installer::kChromeExe))) {
+ // DIR_EXE is most likely Chrome's directory in which case |exe_path| is
+ // the user-level sentinel path.
+ *path = exe_path;
+ } else if (file_util::PathExists(
+ maybe_product_dir.Append(installer::kChromeExe))) {
grt (UTC plus 2) 2013/01/03 17:48:58 nit: 4-space indent relative to file_util above
gab 2013/01/03 18:39:49 Done.
+ // DIR_EXE can also be the Installer directory if this is called from a
+ // setup.exe running from Application\<version>\Installer (see
+ // InstallerState::GetInstallerDirectory) in which case Chrome's directory
+ // is two levels down.
grt (UTC plus 2) 2013/01/03 17:48:58 down -> up?
gab 2013/01/03 18:39:49 Done.
+ *path = maybe_product_dir;
+ } else {
+ NOTREACHED();
+ return false;
+ }
} else {
std::vector<FilePath> user_data_dir_paths;
installer::GetChromeUserDataPaths(dist, &user_data_dir_paths);
« no previous file with comments | « chrome/installer/setup/uninstall.cc ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698