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/setup_main.h" | 5 #include "chrome/installer/setup/setup_main.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <msi.h> | 8 #include <msi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 original_state.GetProductState(system_level, | 406 original_state.GetProductState(system_level, |
407 BrowserDistribution::CHROME_BROWSER); | 407 BrowserDistribution::CHROME_BROWSER); |
408 | 408 |
409 if (binaries) { | 409 if (binaries) { |
410 if (products.size() == 1) { | 410 if (products.size() == 1) { |
411 // There are no products aside from the binaries, so there is no update | 411 // There are no products aside from the binaries, so there is no update |
412 // to be applied. This can happen after multi-install Chrome Frame is | 412 // to be applied. This can happen after multi-install Chrome Frame is |
413 // migrated to single-install. This is treated as an update failure | 413 // migrated to single-install. This is treated as an update failure |
414 // unless the binaries are not in-use, in which case they will be | 414 // unless the binaries are not in-use, in which case they will be |
415 // uninstalled and success will be reported (see handling in wWinMain). | 415 // uninstalled and success will be reported (see handling in wWinMain). |
416 LOG(INFO) << "No products to be updated."; | 416 VLOG(1) << "No products to be updated."; |
417 *status = installer::UNUSED_BINARIES; | 417 *status = installer::UNUSED_BINARIES; |
418 installer_state->WriteInstallerResult(*status, 0, NULL); | 418 installer_state->WriteInstallerResult(*status, 0, NULL); |
419 return false; | 419 return false; |
420 } | 420 } |
421 } else { | 421 } else { |
422 // This will only be hit if --multi-install is given with no products, or | 422 // This will only be hit if --multi-install is given with no products, or |
423 // if the app host is being installed and doesn't need the binaries at | 423 // if the app host is being installed and doesn't need the binaries at |
424 // user-level. | 424 // user-level. |
425 // The former case might be due to a request by an orphaned Application | 425 // The former case might be due to a request by an orphaned Application |
426 // Host to re-install the binaries. Thus we add them to the installation. | 426 // Host to re-install the binaries. Thus we add them to the installation. |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 installer::InstallStatus status = installer::FIRST_INSTALL_SUCCESS; | 970 installer::InstallStatus status = installer::FIRST_INSTALL_SUCCESS; |
971 if (base::PathExists(chrome_exe)) { | 971 if (base::PathExists(chrome_exe)) { |
972 Product chrome(chrome_dist); | 972 Product chrome(chrome_dist); |
973 | 973 |
974 // Create the Start menu shortcut and pin it to the taskbar. | 974 // Create the Start menu shortcut and pin it to the taskbar. |
975 ShellUtil::ShortcutProperties shortcut_properties(ShellUtil::CURRENT_USER); | 975 ShellUtil::ShortcutProperties shortcut_properties(ShellUtil::CURRENT_USER); |
976 chrome.AddDefaultShortcutProperties(chrome_exe, &shortcut_properties); | 976 chrome.AddDefaultShortcutProperties(chrome_exe, &shortcut_properties); |
977 shortcut_properties.set_dual_mode(true); | 977 shortcut_properties.set_dual_mode(true); |
978 shortcut_properties.set_pin_to_taskbar(true); | 978 shortcut_properties.set_pin_to_taskbar(true); |
979 ShellUtil::CreateOrUpdateShortcut( | 979 ShellUtil::CreateOrUpdateShortcut( |
980 ShellUtil::SHORTCUT_LOCATION_START_MENU, chrome_dist, | 980 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, chrome_dist, |
981 shortcut_properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS); | 981 shortcut_properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS); |
982 | 982 |
983 // Register Chrome at user-level and make it default. | 983 // Register Chrome at user-level and make it default. |
984 scoped_ptr<WorkItemList> delegate_execute_list( | 984 scoped_ptr<WorkItemList> delegate_execute_list( |
985 WorkItem::CreateWorkItemList()); | 985 WorkItem::CreateWorkItemList()); |
986 installer::AddDelegateExecuteWorkItems( | 986 installer::AddDelegateExecuteWorkItems( |
987 installer_state, chrome_exe.DirName(), Version(), chrome, | 987 installer_state, chrome_exe.DirName(), Version(), chrome, |
988 delegate_execute_list.get()); | 988 delegate_execute_list.get()); |
989 delegate_execute_list->Do(); | 989 delegate_execute_list->Do(); |
990 if (ShellUtil::CanMakeChromeDefaultUnattended()) { | 990 if (ShellUtil::CanMakeChromeDefaultUnattended()) { |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 // Call the newly updated setup.exe with kUncompressedArchive and | 1859 // Call the newly updated setup.exe with kUncompressedArchive and |
1860 // kMigrateChromeFrame to perform the migration. | 1860 // kMigrateChromeFrame to perform the migration. |
1861 LaunchChromeFrameMigrationProcess(*chrome_frame_state, cmd_line, | 1861 LaunchChromeFrameMigrationProcess(*chrome_frame_state, cmd_line, |
1862 installer_directory, system_install); | 1862 installer_directory, system_install); |
1863 } | 1863 } |
1864 | 1864 |
1865 VLOG(1) << "Installation complete, returning: " << return_code; | 1865 VLOG(1) << "Installation complete, returning: " << return_code; |
1866 | 1866 |
1867 return return_code; | 1867 return return_code; |
1868 } | 1868 } |
OLD | NEW |