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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 2618583005: Remove support for non-browser products from InstallationState and ProductState. (Closed)
Patch Set: sync to position 442664 Created 3 years, 11 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
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/installation_state.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) 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 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 } 158 }
159 159
160 if (uac_foreground_window) { 160 if (uac_foreground_window) {
161 DestroyWindow(uac_foreground_window); 161 DestroyWindow(uac_foreground_window);
162 } 162 }
163 163
164 return success; 164 return success;
165 } 165 }
166 166
167 base::CommandLine InstallUtil::GetChromeUninstallCmd( 167 base::CommandLine InstallUtil::GetChromeUninstallCmd(bool system_install) {
168 bool system_install,
169 BrowserDistribution::Type distribution_type) {
170 ProductState state; 168 ProductState state;
171 if (state.Initialize(system_install, distribution_type)) { 169 if (state.Initialize(system_install))
172 return state.uninstall_command(); 170 return state.uninstall_command();
173 }
174 return base::CommandLine(base::CommandLine::NO_PROGRAM); 171 return base::CommandLine(base::CommandLine::NO_PROGRAM);
175 } 172 }
176 173
177 void InstallUtil::GetChromeVersion(BrowserDistribution* dist, 174 void InstallUtil::GetChromeVersion(BrowserDistribution* dist,
178 bool system_install, 175 bool system_install,
179 base::Version* version) { 176 base::Version* version) {
180 DCHECK(dist); 177 DCHECK(dist);
181 RegKey key; 178 RegKey key;
182 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 179 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
183 LONG result = key.Open(reg_root, 180 LONG result = key.Open(reg_root,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 program_files_path.value().data(), prefix_len) != 314 program_files_path.value().data(), prefix_len) !=
318 CSTR_EQUAL; 315 CSTR_EQUAL;
319 } 316 }
320 317
321 void InstallUtil::ResetIsPerUserInstallForTest() { 318 void InstallUtil::ResetIsPerUserInstallForTest() {
322 std::unique_ptr<base::Environment> env(base::Environment::Create()); 319 std::unique_ptr<base::Environment> env(base::Environment::Create());
323 env->UnSetVar(kEnvProgramFilesPath); 320 env->UnSetVar(kEnvProgramFilesPath);
324 } 321 }
325 322
326 bool InstallUtil::IsMultiInstall(bool system_install) { 323 bool InstallUtil::IsMultiInstall(bool system_install) {
327 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
328 ProductState state; 324 ProductState state;
329 return state.Initialize(system_install, dist) && state.is_multi_install(); 325 return state.Initialize(system_install) && state.is_multi_install();
330 } 326 }
331 327
332 bool CheckIsChromeSxSProcess() { 328 bool CheckIsChromeSxSProcess() {
333 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 329 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
334 CHECK(command_line); 330 CHECK(command_line);
335 331
336 if (command_line->HasSwitch(installer::switches::kChromeSxS)) 332 if (command_line->HasSwitch(installer::switches::kChromeSxS))
337 return true; 333 return true;
338 334
339 // Also return true if we are running from Chrome SxS installed path. 335 // Also return true if we are running from Chrome SxS installed path.
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 // Open the program and see if it references the expected file. 629 // Open the program and see if it references the expected file.
634 base::File file; 630 base::File file;
635 BY_HANDLE_FILE_INFORMATION info = {}; 631 BY_HANDLE_FILE_INFORMATION info = {};
636 632
637 return (OpenForInfo(path, &file) && 633 return (OpenForInfo(path, &file) &&
638 GetInfo(file, &info) && 634 GetInfo(file, &info) &&
639 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && 635 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
640 info.nFileIndexHigh == file_info_.nFileIndexHigh && 636 info.nFileIndexHigh == file_info_.nFileIndexHigh &&
641 info.nFileIndexLow == file_info_.nFileIndexLow); 637 info.nFileIndexLow == file_info_.nFileIndexLow);
642 } 638 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/installation_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698