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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
8 // this class. | 8 // this class. |
9 | 9 |
10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 dist->GetStateKey().c_str(), KEY_QUERY_VALUE | KEY_WOW64_32KEY); | 703 dist->GetStateKey().c_str(), KEY_QUERY_VALUE | KEY_WOW64_32KEY); |
704 base::string16 uninstall_string; | 704 base::string16 uninstall_string; |
705 if (key.ReadValue(installer::kUninstallStringField, &uninstall_string) == | 705 if (key.ReadValue(installer::kUninstallStringField, &uninstall_string) == |
706 ERROR_SUCCESS) { | 706 ERROR_SUCCESS) { |
707 exe_path = base::FilePath(uninstall_string); | 707 exe_path = base::FilePath(uninstall_string); |
708 } | 708 } |
709 } | 709 } |
710 | 710 |
711 if (base::PathExists(exe_path)) { | 711 if (base::PathExists(exe_path)) { |
712 base::CommandLine cmd(exe_path); | 712 base::CommandLine cmd(exe_path); |
| 713 InstallUtil::AppendModeSwitch(&cmd); |
713 if (!is_per_user) | 714 if (!is_per_user) |
714 cmd.AppendSwitch(installer::switches::kSystemLevel); | 715 cmd.AppendSwitch(installer::switches::kSystemLevel); |
715 cmd.AppendSwitchPath(installer::switches::kRegisterChromeBrowser, | 716 cmd.AppendSwitchPath(installer::switches::kRegisterChromeBrowser, |
716 chrome_exe); | 717 chrome_exe); |
717 if (!suffix.empty()) { | 718 if (!suffix.empty()) { |
718 cmd.AppendSwitchNative( | 719 cmd.AppendSwitchNative( |
719 installer::switches::kRegisterChromeBrowserSuffix, suffix); | 720 installer::switches::kRegisterChromeBrowserSuffix, suffix); |
720 } | 721 } |
721 | 722 |
722 if (!protocol.empty()) { | 723 if (!protocol.empty()) { |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 for (const auto& entry : entries) | 2344 for (const auto& entry : entries) |
2344 entry->AddToWorkItemList(root, items.get()); | 2345 entry->AddToWorkItemList(root, items.get()); |
2345 | 2346 |
2346 // Apply all the registry changes and if there is a problem, rollback | 2347 // Apply all the registry changes and if there is a problem, rollback |
2347 if (!items->Do()) { | 2348 if (!items->Do()) { |
2348 items->Rollback(); | 2349 items->Rollback(); |
2349 return false; | 2350 return false; |
2350 } | 2351 } |
2351 return true; | 2352 return true; |
2352 } | 2353 } |
OLD | NEW |