Chromium Code Reviews| Index: chrome/installer/setup/install.cc |
| diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc |
| index ffd0f2b055db97a726f85846a1b7f13a0c8d5437..625cbb032855d83995128e6d05764c194de9c5b9 100644 |
| --- a/chrome/installer/setup/install.cc |
| +++ b/chrome/installer/setup/install.cc |
| @@ -315,6 +315,10 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts( |
| } |
| } |
| + if (create_always && installer_state.system_install()) { |
|
grt (UTC plus 2)
2012/09/01 03:20:28
nit: remove braces
gab
2012/09/01 22:28:40
Done.
|
| + ForceCreateUserLevelStartMenuShortcut(installer_state, product); |
| + } |
| + |
| // Create/update uninstall link if we are not an MSI install. MSI |
| // installations are, for the time being, managed only through the |
| // Add/Remove Programs dialog. |
| @@ -339,6 +343,42 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts( |
| } |
| } |
| +// TODO(gab): This is a hack that is temporarily required for the Start Menu |
| +// (now Start Screen) shortcut to show up on Win8. This will be removed when I'm |
| +// done refactoring ShellUtil as part of http://goo.gl/Az889. |
| +void ForceCreateUserLevelStartMenuShortcut( |
| + const InstallerState& installer_state, |
| + const Product& product) { |
| + BrowserDistribution* browser_dist = product.distribution(); |
| + const string16 product_name(browser_dist->GetAppShortCutName()); |
| + const string16 product_desc(browser_dist->GetAppDescription()); |
| + const FilePath chrome_exe( |
| + installer_state.target_path().Append(installer::kChromeExe)); |
| + |
| + FilePath start_menu_user_level; |
|
grt (UTC plus 2)
2012/09/01 03:20:28
start_menu_user_level -> user_start_menu or per_us
gab
2012/09/01 22:28:40
Done.
|
| + if (!PathService::Get(base::DIR_START_MENU, &start_menu_user_level)) { |
| + LOG(ERROR) << "Failed to get user-level start menu path."; |
|
grt (UTC plus 2)
2012/09/01 03:20:28
i like DFATAL here since failure is extremely unex
gab
2012/09/01 22:28:40
Sure, although this makes the code differ more fro
|
| + return; |
| + } |
| + start_menu_user_level = start_menu_user_level.Append(product_name); |
| + file_util::CreateDirectory(start_menu_user_level); |
|
grt (UTC plus 2)
2012/09/01 03:20:28
y u no handle result? i suppose you could argue t
gab
2012/09/01 22:28:40
Again, keeping the same behavior as its copy-paste
grt (UTC plus 2)
2012/09/02 14:18:19
On its own, this isn't a good enough reason. The
|
| + |
| + const FilePath chrome_link( |
| + start_menu_user_level.Append(product_name + L".lnk")); |
| + |
| + const uint32 options = (ShellUtil::SHORTCUT_CREATE_ALWAYS | |
| + ShellUtil::SHORTCUT_DUAL_MODE); |
| + |
| + VLOG(1) << "Creating shortcut to " << chrome_exe.value() << " at " |
| + << chrome_link.value(); |
| + if (!ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(), |
| + chrome_link.value(), string16(), product_desc, chrome_exe.value(), |
| + browser_dist->GetIconIndex(), options)) { |
| + LOG(ERROR) << "Creating shortcut at " << chrome_link.value() |
| + << " failed."; |
|
grt (UTC plus 2)
2012/09/01 03:20:28
nit: indentation (does this fit on the previous li
gab
2012/09/01 22:28:40
good eyes sir
|
| + } |
| +} |
| + |
| void CreateOrUpdateDesktopAndQuickLaunchShortcuts( |
| const InstallerState& installer_state, |
| const Product& product, |