| 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/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
| 6 | 6 |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 #include <time.h> | 8 #include <time.h> |
| 9 #include <winuser.h> | 9 #include <winuser.h> |
| 10 | 10 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // Add/Remove Programs dialog. | 320 // Add/Remove Programs dialog. |
| 321 // TODO(robertshield): We could add a shortcut to msiexec /X {GUID} here. | 321 // TODO(robertshield): We could add a shortcut to msiexec /X {GUID} here. |
| 322 if (!installer_state.is_msi()) { | 322 if (!installer_state.is_msi()) { |
| 323 // Uninstall Chrome link | 323 // Uninstall Chrome link |
| 324 FilePath uninstall_link(start_menu_folder_path.Append( | 324 FilePath uninstall_link(start_menu_folder_path.Append( |
| 325 browser_dist->GetUninstallLinkName() + L".lnk")); | 325 browser_dist->GetUninstallLinkName() + L".lnk")); |
| 326 | 326 |
| 327 CommandLine arguments(CommandLine::NO_PROGRAM); | 327 CommandLine arguments(CommandLine::NO_PROGRAM); |
| 328 AppendUninstallCommandLineFlags(installer_state, product, &arguments); | 328 AppendUninstallCommandLineFlags(installer_state, product, &arguments); |
| 329 VLOG(1) << operation << " uninstall link at " << uninstall_link.value(); | 329 VLOG(1) << operation << " uninstall link at " << uninstall_link.value(); |
| 330 if (!file_util::CreateOrUpdateShortcutLink(setup_exe.value().c_str(), | 330 file_util::ShortcutProperties shortcut_properties; |
| 331 uninstall_link.value().c_str(), NULL, | 331 shortcut_properties.set_target(setup_exe.value()); |
| 332 arguments.GetCommandLineString().c_str(), NULL, | 332 shortcut_properties.set_arguments(arguments.GetCommandLineString()); |
| 333 setup_exe.value().c_str(), 0, NULL, | 333 shortcut_properties.set_icon(setup_exe.value(), 0); |
| 334 if (!file_util::CreateOrUpdateShortcutLink( |
| 335 uninstall_link.value().c_str(), shortcut_properties, |
| 334 create_always ? file_util::SHORTCUT_CREATE_ALWAYS : | 336 create_always ? file_util::SHORTCUT_CREATE_ALWAYS : |
| 335 file_util::SHORTCUT_NO_OPTIONS)) { | 337 file_util::SHORTCUT_UPDATE_EXISTING)) { |
| 336 LOG(WARNING) << operation << " uninstall link at " | 338 LOG(WARNING) << operation << " uninstall link at " |
| 337 << uninstall_link.value() << " failed."; | 339 << uninstall_link.value() << " failed."; |
| 338 } | 340 } |
| 339 } | 341 } |
| 340 } | 342 } |
| 341 | 343 |
| 342 void CreateOrUpdateDesktopAndQuickLaunchShortcuts( | 344 void CreateOrUpdateDesktopAndQuickLaunchShortcuts( |
| 343 const InstallerState& installer_state, | 345 const InstallerState& installer_state, |
| 344 const Product& product, | 346 const Product& product, |
| 345 uint32 options) { | 347 uint32 options) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 uint32 shortcut_options = ShellUtil::SHORTCUT_DUAL_MODE; | 565 uint32 shortcut_options = ShellUtil::SHORTCUT_DUAL_MODE; |
| 564 CreateOrUpdateDesktopAndQuickLaunchShortcuts( | 566 CreateOrUpdateDesktopAndQuickLaunchShortcuts( |
| 565 installer_state, chrome, shortcut_options); | 567 installer_state, chrome, shortcut_options); |
| 566 CreateOrUpdateStartMenuAndTaskbarShortcuts( | 568 CreateOrUpdateStartMenuAndTaskbarShortcuts( |
| 567 installer_state, setup_exe, chrome, shortcut_options); | 569 installer_state, setup_exe, chrome, shortcut_options); |
| 568 RegisterChromeOnMachine(installer_state, chrome, false); | 570 RegisterChromeOnMachine(installer_state, chrome, false); |
| 569 } | 571 } |
| 570 } | 572 } |
| 571 | 573 |
| 572 } // namespace installer | 574 } // namespace installer |
| OLD | NEW |