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/util/google_update_util.h" | 5 #include "chrome/installer/util/google_update_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return; | 157 return; |
158 base::FilePath exe_path(product_state.GetSetupPath()); | 158 base::FilePath exe_path(product_state.GetSetupPath()); |
159 if (exe_path.empty() || !base::PathExists(exe_path)) { | 159 if (exe_path.empty() || !base::PathExists(exe_path)) { |
160 LOG(ERROR) << "Could not find setup.exe to reenable updates."; | 160 LOG(ERROR) << "Could not find setup.exe to reenable updates."; |
161 return; | 161 return; |
162 } | 162 } |
163 | 163 |
164 base::CommandLine cmd(exe_path); | 164 base::CommandLine cmd(exe_path); |
165 cmd.AppendSwitch(installer::switches::kReenableAutoupdates); | 165 cmd.AppendSwitch(installer::switches::kReenableAutoupdates); |
166 installer::Product product(BrowserDistribution::GetDistribution()); | 166 installer::Product product(BrowserDistribution::GetDistribution()); |
167 product.InitializeFromUninstallCommand(product_state.uninstall_command()); | |
168 product.AppendProductFlags(&cmd); | 167 product.AppendProductFlags(&cmd); |
169 if (system_install) | 168 if (system_install) |
170 cmd.AppendSwitch(installer::switches::kSystemLevel); | 169 cmd.AppendSwitch(installer::switches::kSystemLevel); |
171 if (product_state.uninstall_command().HasSwitch( | 170 if (product_state.uninstall_command().HasSwitch( |
172 installer::switches::kVerboseLogging)) { | 171 installer::switches::kVerboseLogging)) { |
173 cmd.AppendSwitch(installer::switches::kVerboseLogging); | 172 cmd.AppendSwitch(installer::switches::kVerboseLogging); |
174 } | 173 } |
175 | 174 |
176 base::LaunchOptions launch_options; | 175 base::LaunchOptions launch_options; |
177 launch_options.force_breakaway_from_job_ = true; | 176 launch_options.force_breakaway_from_job_ = true; |
178 | 177 |
179 if (base::win::UserAccountControlIsEnabled()) | 178 if (base::win::UserAccountControlIsEnabled()) |
180 base::LaunchElevatedProcess(cmd, launch_options); | 179 base::LaunchElevatedProcess(cmd, launch_options); |
181 else | 180 else |
182 base::LaunchProcess(cmd, launch_options); | 181 base::LaunchProcess(cmd, launch_options); |
183 } | 182 } |
184 | 183 |
185 } // namespace google_update | 184 } // namespace google_update |
OLD | NEW |