Index: chrome/installer/util/shell_util.cc |
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc |
index 71a34de3de14f09658ddb2481d4370fbd4f19086..be6cb91a521384c593ba4ec1de6bbe7cda5d518a 100644 |
--- a/chrome/installer/util/shell_util.cc |
+++ b/chrome/installer/util/shell_util.cc |
@@ -136,7 +136,7 @@ class RegistryEntry { |
string16 delegate_command(ShellUtil::GetChromeDelegateCommand(chrome_exe)); |
// For user-level installs: entries for the app id and DelegateExecute verb |
// handler will be in HKCU; thus we do not need a suffix on those entries. |
- string16 app_id(dist->GetBrowserAppId()); |
+ string16 app_id(ShellUtil::GetAppId(dist, chrome_exe)); |
string16 delegate_guid; |
// TODO(grt): remove HasDelegateExecuteHandler when the exe is ever-present; |
// see also install_worker.cc's AddDelegateExecuteWorkItems. |
@@ -663,7 +663,7 @@ void RemoveBadWindows8RegistrationIfNeeded( |
// suffix. |
const string16 installation_suffix( |
ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe)); |
- const string16 app_id(dist->GetBrowserAppId()); |
+ const string16 app_id(ShellUtil::GetAppId(dist, chrome_exe)); |
// <root hkey>\Software\Classes\<app_id> |
string16 key(ShellUtil::kRegClasses); |
@@ -1074,6 +1074,17 @@ string16 ShellUtil::GetApplicationName(BrowserDistribution* dist, |
return app_name; |
} |
+string16 ShellUtil::GetAppId(BrowserDistribution* dist, |
+ const string16& chrome_exe) { |
+ string16 app_id(dist->GetBaseAppId()); |
+ string16 suffix; |
+ if (InstallUtil::IsPerUserInstall(chrome_exe.c_str()) && |
+ !GetUserSpecificRegistrySuffix(&suffix)) { |
+ NOTREACHED(); |
+ } |
+ return app_id.append(suffix); |
+} |
+ |
bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, |
int shell_change, |
const string16& chrome_exe, |
@@ -1432,24 +1443,25 @@ bool ShellUtil::UpdateChromeShortcut(BrowserDistribution* dist, |
const string16& icon_path, |
int icon_index, |
uint32 options) { |
- string16 chrome_path = FilePath(chrome_exe).DirName().value(); |
+ const FilePath chrome_path(FilePath(chrome_exe).DirName()); |
- FilePath prefs_path(chrome_path); |
- prefs_path = prefs_path.AppendASCII(installer::kDefaultMasterPrefs); |
- installer::MasterPreferences prefs(prefs_path); |
+ installer::MasterPreferences prefs( |
+ chrome_path.AppendASCII(installer::kDefaultMasterPrefs)); |
if (FilePath::CompareEqualIgnoreCase(icon_path, chrome_exe)) { |
prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex, |
&icon_index); |
} |
+ const string16 app_id(GetAppId(dist, chrome_exe)); |
+ |
return file_util::CreateOrUpdateShortcutLink( |
chrome_exe.c_str(), |
shortcut.c_str(), |
- chrome_path.c_str(), |
+ chrome_path.value().c_str(), |
arguments.c_str(), |
description.c_str(), |
icon_path.c_str(), |
icon_index, |
- dist->GetBrowserAppId().c_str(), |
+ app_id.c_str(), |
ConvertShellUtilShortcutOptionsToFileUtil(options)); |
} |