OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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__ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 int string_resource_id, | 50 int string_resource_id, |
51 const std::wstring* const launch_cmd); | 51 const std::wstring* const launch_cmd); |
52 | 52 |
53 // Returns true if this installation path is per user, otherwise returns | 53 // Returns true if this installation path is per user, otherwise returns |
54 // false (per machine install, meaning: the exe_path contains path to | 54 // false (per machine install, meaning: the exe_path contains path to |
55 // Program Files). | 55 // Program Files). |
56 static bool IsPerUserInstall(const wchar_t* const exe_path); | 56 static bool IsPerUserInstall(const wchar_t* const exe_path); |
57 | 57 |
58 // Returns true if this is a Chrome Frame installation (as indicated by the | 58 // Returns true if this is a Chrome Frame installation (as indicated by the |
59 // presence of --chrome-frame on the command line) or if this is running | 59 // presence of --chrome-frame on the command line) or if this is running |
60 // inside of the Chrome Frame dll. | 60 // inside of the Chrome Frame dll. Also returns true if a master.preferences |
| 61 // file containing chrome_frame: true is specified on the command line. |
61 static bool IsChromeFrameProcess(); | 62 static bool IsChromeFrameProcess(); |
62 | 63 |
63 // Returns true if this is running setup process for Chrome SxS (as | 64 // Returns true if this is running setup process for Chrome SxS (as |
64 // indicated by the presence of --chrome-sxs on the command line) or if this | 65 // indicated by the presence of --chrome-sxs on the command line) or if this |
65 // is running Chrome process from the Chrome SxS installation (as indicated | 66 // is running Chrome process from the Chrome SxS installation (as indicated |
66 // by either --chrome-sxs or the executable path). | 67 // by either --chrome-sxs or the executable path). |
67 static bool IsChromeSxSProcess(); | 68 static bool IsChromeSxSProcess(); |
68 | 69 |
69 // Returns true if this setup process is running as an install managed by an | 70 // Returns true if this setup process is running as an install managed by an |
70 // MSI wrapper. This is indicated by the presence of --msi on the command line | 71 // MSI wrapper. There are three things that are checked: |
71 // or the presence of "msi": true in the master preferences file. | 72 // 1) the presence of --msi on the command line |
72 static bool IsMSIProcess(); | 73 // 2) the presence of "msi": true in the master preferences file |
| 74 // 3) the presence of a DWORD value in the ClientState key called msi with |
| 75 // value 1 |
| 76 // NOTE: This method is NOT thread safe. |
| 77 static bool IsMSIProcess(bool system_level); |
| 78 |
| 79 |
| 80 // Sets the boolean MSI marker for this installation if set is true or clears |
| 81 // it otherwise. The MSI marker is stored in the registry under the |
| 82 // ClientState key. |
| 83 static bool SetMSIMarker(bool system_level, bool set); |
73 | 84 |
74 // Adds all DLLs in install_path whose names are given by dll_names to a | 85 // Adds all DLLs in install_path whose names are given by dll_names to a |
75 // work item list containing registration or unregistration actions. | 86 // work item list containing registration or unregistration actions. |
76 // | 87 // |
77 // install_path: Install path containing the registrable DLLs. | 88 // install_path: Install path containing the registrable DLLs. |
78 // dll_names: the array of strings containing dll_names | 89 // dll_names: the array of strings containing dll_names |
79 // dll_names_count: the number of DLL names in dll_names | 90 // dll_names_count: the number of DLL names in dll_names |
80 // do_register: whether to register or unregister the DLLs | 91 // do_register: whether to register or unregister the DLLs |
81 // registration_list: the WorkItemList that this method populates | 92 // registration_list: the WorkItemList that this method populates |
82 // | 93 // |
83 // Returns true if at least one DLL was successfully added to | 94 // Returns true if at least one DLL was successfully added to |
84 // registration_list. | 95 // registration_list. |
85 static bool BuildDLLRegistrationList(const std::wstring& install_path, | 96 static bool BuildDLLRegistrationList(const std::wstring& install_path, |
86 const wchar_t** const dll_names, | 97 const wchar_t** const dll_names, |
87 int dll_names_count, | 98 int dll_names_count, |
88 bool do_register, | 99 bool do_register, |
89 WorkItemList* registration_list); | 100 WorkItemList* registration_list); |
90 | 101 |
91 private: | 102 private: |
92 DISALLOW_EVIL_CONSTRUCTORS(InstallUtil); | 103 DISALLOW_EVIL_CONSTRUCTORS(InstallUtil); |
93 }; | 104 }; |
94 | 105 |
95 | 106 |
96 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 107 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
OLD | NEW |