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 // 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 exe_path.value().data(), prefix_len, | 312 exe_path.value().data(), prefix_len, |
313 program_files_path.value().data(), prefix_len) != | 313 program_files_path.value().data(), prefix_len) != |
314 CSTR_EQUAL; | 314 CSTR_EQUAL; |
315 } | 315 } |
316 | 316 |
317 void InstallUtil::ResetIsPerUserInstallForTest() { | 317 void InstallUtil::ResetIsPerUserInstallForTest() { |
318 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 318 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
319 env->UnSetVar(kEnvProgramFilesPath); | 319 env->UnSetVar(kEnvProgramFilesPath); |
320 } | 320 } |
321 | 321 |
322 bool InstallUtil::IsMultiInstall(bool system_install) { | |
323 ProductState state; | |
324 return state.Initialize(system_install) && state.is_multi_install(); | |
325 } | |
326 | |
327 bool CheckIsChromeSxSProcess() { | 322 bool CheckIsChromeSxSProcess() { |
328 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 323 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
329 CHECK(command_line); | 324 CHECK(command_line); |
330 | 325 |
331 if (command_line->HasSwitch(installer::switches::kChromeSxS)) | 326 if (command_line->HasSwitch(installer::switches::kChromeSxS)) |
332 return true; | 327 return true; |
333 | 328 |
334 // Also return true if we are running from Chrome SxS installed path. | 329 // Also return true if we are running from Chrome SxS installed path. |
335 base::FilePath exe_dir; | 330 base::FilePath exe_dir; |
336 PathService::Get(base::DIR_EXE, &exe_dir); | 331 PathService::Get(base::DIR_EXE, &exe_dir); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 // Open the program and see if it references the expected file. | 622 // Open the program and see if it references the expected file. |
628 base::File file; | 623 base::File file; |
629 BY_HANDLE_FILE_INFORMATION info = {}; | 624 BY_HANDLE_FILE_INFORMATION info = {}; |
630 | 625 |
631 return (OpenForInfo(path, &file) && | 626 return (OpenForInfo(path, &file) && |
632 GetInfo(file, &info) && | 627 GetInfo(file, &info) && |
633 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 628 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
634 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 629 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
635 info.nFileIndexLow == file_info_.nFileIndexLow); | 630 info.nFileIndexLow == file_info_.nFileIndexLow); |
636 } | 631 } |
OLD | NEW |