OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file declares utility functions for the installer. The original reason | 5 // This file declares utility functions for the installer. The original reason |
6 // for putting these functions in installer\util library is so that we can | 6 // for putting these functions in installer\util library is so that we can |
7 // separate out the critical logic and write unit tests for it. | 7 // separate out the critical logic and write unit tests for it. |
8 | 8 |
9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <tchar.h> | 13 #include <tchar.h> |
14 #include <windows.h> | 14 #include <windows.h> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/command_line.h" | |
19 #include "base/version.h" | |
20 #include "chrome/installer/util/master_preferences.h" | |
21 #include "chrome/installer/util/util_constants.h" | 18 #include "chrome/installer/util/util_constants.h" |
22 | 19 |
| 20 class BrowserDistribution; |
| 21 class CommandLine; |
| 22 class Version; |
23 class WorkItemList; | 23 class WorkItemList; |
24 class BrowserDistribution; | |
25 | 24 |
26 namespace base { | 25 namespace base { |
27 namespace win { | 26 namespace win { |
28 class RegKey; | 27 class RegKey; |
29 } // namespace win | 28 } // namespace win |
30 } // namespace base | 29 } // namespace base |
31 | 30 |
32 // This is a utility class that provides common installation related | 31 // This is a utility class that provides common installation related |
33 // utility methods that can be used by installer and also unit tested | 32 // utility methods that can be used by installer and also unit tested |
34 // independently. | 33 // independently. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const std::wstring& key_path); | 99 const std::wstring& key_path); |
101 | 100 |
102 // Deletes the registry value named value_name at path key_path under the key | 101 // Deletes the registry value named value_name at path key_path under the key |
103 // given by reg_root. | 102 // given by reg_root. |
104 static bool DeleteRegistryValue(HKEY reg_root, const std::wstring& key_path, | 103 static bool DeleteRegistryValue(HKEY reg_root, const std::wstring& key_path, |
105 const std::wstring& value_name); | 104 const std::wstring& value_name); |
106 | 105 |
107 // Returns zero on install success, or an InstallStatus value otherwise. | 106 // Returns zero on install success, or an InstallStatus value otherwise. |
108 static int GetInstallReturnCode(installer::InstallStatus install_status); | 107 static int GetInstallReturnCode(installer::InstallStatus install_status); |
109 | 108 |
| 109 // Composes |exe_path| and |arguments| into |command_line|. |
| 110 static void MakeUninstallCommand(const std::wstring& exe_path, |
| 111 const std::wstring& arguments, |
| 112 CommandLine* command_line); |
| 113 |
110 private: | 114 private: |
111 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 115 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
112 }; | 116 }; |
113 | 117 |
114 | 118 |
115 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 119 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
OLD | NEW |