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/chrome_frame_quick_enable.h" | 5 #include "chrome/installer/setup/chrome_frame_quick_enable.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 machine_state.GetProductState(installer_state.system_install(), | 34 machine_state.GetProductState(installer_state.system_install(), |
35 BrowserDistribution::CHROME_BROWSER); | 35 BrowserDistribution::CHROME_BROWSER); |
36 if (chrome_state == NULL) { | 36 if (chrome_state == NULL) { |
37 LOG(ERROR) << "Chrome Frame quick enable requires Chrome to be installed."; | 37 LOG(ERROR) << "Chrome Frame quick enable requires Chrome to be installed."; |
38 return CHROME_NOT_INSTALLED; | 38 return CHROME_NOT_INSTALLED; |
39 } else if (!chrome_state->is_multi_install()) { | 39 } else if (!chrome_state->is_multi_install()) { |
40 LOG(ERROR) << "Chrome Frame quick enable requires multi-install of Chrome."; | 40 LOG(ERROR) << "Chrome Frame quick enable requires multi-install of Chrome."; |
41 return NON_MULTI_INSTALLATION_EXISTS; | 41 return NON_MULTI_INSTALLATION_EXISTS; |
42 } | 42 } |
43 | 43 |
44 // Chrome Frame must not be installed (ready-mode doesn't count). | 44 // Chrome Frame must not be installed. |
45 const ProductState* cf_state = | 45 const ProductState* cf_state = |
46 machine_state.GetProductState(installer_state.system_install(), | 46 machine_state.GetProductState(installer_state.system_install(), |
47 BrowserDistribution::CHROME_FRAME); | 47 BrowserDistribution::CHROME_FRAME); |
48 // Make sure we check both user and system installations. | 48 // Make sure we check both user and system installations. |
49 if (!cf_state) { | 49 if (!cf_state) { |
50 cf_state = machine_state.GetProductState(!installer_state.system_install(), | 50 cf_state = machine_state.GetProductState(!installer_state.system_install(), |
51 BrowserDistribution::CHROME_FRAME); | 51 BrowserDistribution::CHROME_FRAME); |
52 } | 52 } |
53 | 53 |
54 if (cf_state != NULL && | 54 if (cf_state != NULL) { |
55 !cf_state->uninstall_command().HasSwitch( | |
56 switches::kChromeFrameReadyMode)) { | |
57 LOG(ERROR) << "Chrome Frame already installed."; | 55 LOG(ERROR) << "Chrome Frame already installed."; |
58 return installer_state.system_install() ? | 56 return installer_state.system_install() ? |
59 SYSTEM_LEVEL_INSTALL_EXISTS : USER_LEVEL_INSTALL_EXISTS; | 57 SYSTEM_LEVEL_INSTALL_EXISTS : USER_LEVEL_INSTALL_EXISTS; |
60 } | 58 } |
61 | 59 |
62 return FIRST_INSTALL_SUCCESS; | 60 return FIRST_INSTALL_SUCCESS; |
63 } | 61 } |
64 | 62 |
65 } // end namespace | 63 } // end namespace |
66 | 64 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 base::FilePath setup_path(chrome_state->GetSetupPath()); | 99 base::FilePath setup_path(chrome_state->GetSetupPath()); |
102 const Version& new_version = chrome_state->version(); | 100 const Version& new_version = chrome_state->version(); |
103 | 101 |
104 // This creates the uninstallation entry for GCF. | 102 // This creates the uninstallation entry for GCF. |
105 AddUninstallShortcutWorkItems(*installer_state, setup_path, new_version, | 103 AddUninstallShortcutWorkItems(*installer_state, setup_path, new_version, |
106 *cf, item_list.get()); | 104 *cf, item_list.get()); |
107 // Always set the "lang" value since quick-enable always happens in the | 105 // Always set the "lang" value since quick-enable always happens in the |
108 // context of an interactive session with a user. | 106 // context of an interactive session with a user. |
109 AddVersionKeyWorkItems(installer_state->root_key(), cf->distribution(), | 107 AddVersionKeyWorkItems(installer_state->root_key(), cf->distribution(), |
110 new_version, true, item_list.get()); | 108 new_version, true, item_list.get()); |
111 AddChromeFrameWorkItems(machine_state, *installer_state, setup_path, | |
112 new_version, *cf, item_list.get()); | |
113 | 109 |
114 const Version* opv = chrome_state->old_version(); | 110 const Version* opv = chrome_state->old_version(); |
115 AppendPostInstallTasks(*installer_state, setup_path, opv, | 111 AppendPostInstallTasks(*installer_state, setup_path, opv, |
116 new_version, temp_path.path(), item_list.get()); | 112 new_version, temp_path.path(), item_list.get()); |
117 | 113 |
118 // Before updating the channel values, add Chrome back to the mix so that | 114 // Before updating the channel values, add Chrome back to the mix so that |
119 // all multi-installed products' channel values get updated. | 115 // all multi-installed products' channel values get updated. |
120 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, | 116 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, |
121 *chrome_state); | 117 *chrome_state); |
122 AddGoogleUpdateWorkItems(machine_state, *installer_state, | 118 AddGoogleUpdateWorkItems(machine_state, *installer_state, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 BrowserDistribution::CHROME_BINARIES), | 158 BrowserDistribution::CHROME_BINARIES), |
163 true)) { | 159 true)) { |
164 LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; | 160 LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; |
165 } | 161 } |
166 } | 162 } |
167 | 163 |
168 return status; | 164 return status; |
169 } | 165 } |
170 | 166 |
171 } // namespace installer | 167 } // namespace installer |
OLD | NEW |