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/helper.h" | 5 #include "chrome/installer/util/helper.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/installer/util/browser_distribution.h" | 10 #include "chrome/installer/util/browser_distribution.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 int key = system_install ? base::DIR_PROGRAM_FILES : base::DIR_LOCAL_APP_DATA; | 26 int key = system_install ? base::DIR_PROGRAM_FILES : base::DIR_LOCAL_APP_DATA; |
27 #endif | 27 #endif |
28 if (PathService::Get(key, &install_path)) { | 28 if (PathService::Get(key, &install_path)) { |
29 install_path = install_path.Append(dist->GetInstallSubDir()); | 29 install_path = install_path.Append(dist->GetInstallSubDir()); |
30 install_path = install_path.Append(kInstallBinaryDir); | 30 install_path = install_path.Append(kInstallBinaryDir); |
31 } | 31 } |
32 return install_path; | 32 return install_path; |
33 } | 33 } |
34 | 34 |
35 BrowserDistribution* GetBinariesDistribution(bool system_install) { | 35 BrowserDistribution* GetBinariesDistribution(bool system_install) { |
36 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | |
37 ProductState state; | 36 ProductState state; |
38 | 37 |
39 // If we're part of a multi-install, we need to poll using the multi-installer | 38 // If we're part of a multi-install, we need to poll using the multi-installer |
40 // package's app guid rather than the browser's or Chrome Frame's app guid. | 39 // package's app guid rather than the browser's. If we can't read the app's |
41 // If we can't read the app's state from the registry, assume it isn't | 40 // state from the registry, assume it isn't multi-installed. |
42 // multi-installed. | 41 if (!state.Initialize(system_install) || !state.is_multi_install()) |
43 if (state.Initialize(system_install, dist) && state.is_multi_install()) { | 42 return BrowserDistribution::GetDistribution(); |
44 return BrowserDistribution::GetSpecificDistribution( | 43 return BrowserDistribution::GetSpecificDistribution( |
45 BrowserDistribution::CHROME_BINARIES); | 44 BrowserDistribution::CHROME_BINARIES); |
46 } else { | |
47 return dist; | |
48 } | |
49 } | 45 } |
50 | 46 |
51 std::wstring GetAppGuidForUpdates(bool system_install) { | 47 std::wstring GetAppGuidForUpdates(bool system_install) { |
52 return GetBinariesDistribution(system_install)->GetAppGuid(); | 48 return GetBinariesDistribution(system_install)->GetAppGuid(); |
53 } | 49 } |
54 | 50 |
55 } // namespace installer. | 51 } // namespace installer. |
OLD | NEW |