Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/installer/setup/chrome_frame_quick_enable.cc

Issue 6588003: Add support for the quick-enable-cf command to the installer. This encompase... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_installer_util.gypi ('k') | chrome/installer/setup/install_worker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 9 #include "base/logging.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 24 matching lines...) Expand all
35 machine_state.GetProductState(installer_state.system_install(), 35 machine_state.GetProductState(installer_state.system_install(),
36 BrowserDistribution::CHROME_BROWSER); 36 BrowserDistribution::CHROME_BROWSER);
37 if (chrome_state == NULL) { 37 if (chrome_state == NULL) {
38 LOG(ERROR) << "Chrome Frame quick enable requires Chrome to be installed."; 38 LOG(ERROR) << "Chrome Frame quick enable requires Chrome to be installed.";
39 return CHROME_NOT_INSTALLED; 39 return CHROME_NOT_INSTALLED;
40 } else if (!chrome_state->is_multi_install()) { 40 } else if (!chrome_state->is_multi_install()) {
41 LOG(ERROR) << "Chrome Frame quick enable requires multi-install of Chrome."; 41 LOG(ERROR) << "Chrome Frame quick enable requires multi-install of Chrome.";
42 return NON_MULTI_INSTALLATION_EXISTS; 42 return NON_MULTI_INSTALLATION_EXISTS;
43 } 43 }
44 44
45 // Chrome Frame must not be installed. 45 // Chrome Frame must not be installed (ready-mode doesn't count).
46 const ProductState* cf_state = 46 const ProductState* cf_state =
47 machine_state.GetProductState(installer_state.system_install(), 47 machine_state.GetProductState(installer_state.system_install(),
48 BrowserDistribution::CHROME_FRAME); 48 BrowserDistribution::CHROME_FRAME);
49 // Make sure we check both user and system installations. 49 // Make sure we check both user and system installations.
50 if (!cf_state) { 50 if (!cf_state) {
51 cf_state = machine_state.GetProductState(!installer_state.system_install(), 51 cf_state = machine_state.GetProductState(!installer_state.system_install(),
52 BrowserDistribution::CHROME_FRAME); 52 BrowserDistribution::CHROME_FRAME);
53 } 53 }
54 54
55 if (cf_state != NULL) { 55 if (cf_state != NULL &&
56 !cf_state->uninstall_command().HasSwitch(
57 switches::kChromeFrameReadyMode)) {
56 LOG(ERROR) << "Chrome Frame already installed."; 58 LOG(ERROR) << "Chrome Frame already installed.";
57 return installer_state.system_install() ? 59 return installer_state.system_install() ?
58 SYSTEM_LEVEL_INSTALL_EXISTS : USER_LEVEL_INSTALL_EXISTS; 60 SYSTEM_LEVEL_INSTALL_EXISTS : USER_LEVEL_INSTALL_EXISTS;
59 } 61 }
60 62
61 return FIRST_INSTALL_SUCCESS; 63 return FIRST_INSTALL_SUCCESS;
62 } 64 }
63 65
64 } // end namespace 66 } // end namespace
65 67
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 const Version* opv = chrome_state->old_version(); 115 const Version* opv = chrome_state->old_version();
114 AppendPostInstallTasks(*installer_state, setup_path, new_chrome_exe, opv, 116 AppendPostInstallTasks(*installer_state, setup_path, new_chrome_exe, opv,
115 new_version, temp_path.path(), item_list.get()); 117 new_version, temp_path.path(), item_list.get());
116 118
117 // Before updating the channel values, add Chrome back to the mix so that 119 // Before updating the channel values, add Chrome back to the mix so that
118 // all multi-installed products' channel values get updated. 120 // all multi-installed products' channel values get updated.
119 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, 121 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER,
120 *chrome_state); 122 *chrome_state);
121 AddGoogleUpdateWorkItems(*installer_state, item_list.get()); 123 AddGoogleUpdateWorkItems(*installer_state, item_list.get());
122 124
125 // Add the items to remove the quick-enable-cf command from the registry.
126 AddQuickEnableWorkItems(*installer_state, machine_state,
127 &chrome_state->uninstall_command().GetProgram(),
128 &chrome_state->version(),
129 item_list.get());
130
123 if (!item_list->Do()) { 131 if (!item_list->Do()) {
124 item_list->Rollback(); 132 item_list->Rollback();
125 status = INSTALL_FAILED; 133 status = INSTALL_FAILED;
126 } else { 134 } else {
127 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); 135 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status);
128 VLOG(1) << "Chrome Frame successfully activated."; 136 VLOG(1) << "Chrome Frame successfully activated.";
129 } 137 }
130 } 138 }
131 } 139 }
132 140
133 return status; 141 return status;
134 } 142 }
135 143
136 } // namespace installer 144 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/chrome_installer_util.gypi ('k') | chrome/installer/setup/install_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698