OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_INSTALLER_UTIL_PRODUCT_OPERATIONS_H_ |
| 6 #define CHROME_INSTALLER_UTIL_PRODUCT_OPERATIONS_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <set> |
| 10 #include <string> |
| 11 #include <vector> |
| 12 |
| 13 #include "base/file_path.h" |
| 14 |
| 15 class CommandLine; |
| 16 |
| 17 namespace installer { |
| 18 |
| 19 class ChannelInfo; |
| 20 class MasterPreferences; |
| 21 |
| 22 // An interface to product-specific operations that depend on product |
| 23 // configuration. Implementations are expected to be stateless. Configuration |
| 24 // can be read from a MasterPreferences instance or from a product's uninstall |
| 25 // command. |
| 26 class ProductOperations { |
| 27 public: |
| 28 virtual ~ProductOperations() {} |
| 29 |
| 30 // Reads product-specific options from |prefs|, adding them to |options|. |
| 31 virtual void ReadOptions(const MasterPreferences& prefs, |
| 32 std::set<std::wstring>* options) const = 0; |
| 33 |
| 34 // Reads product-specific options from |command|, adding them to |options|. |
| 35 virtual void ReadOptions(const CommandLine& command, |
| 36 std::set<std::wstring>* options) const = 0; |
| 37 |
| 38 // A key-file is a file such as a DLL on Windows that is expected to be in use |
| 39 // when the product is being used. For example "chrome.dll" for Chrome. |
| 40 // Before attempting to delete an installation directory during an |
| 41 // uninstallation, the uninstaller will check if any one of a potential set of |
| 42 // key files is in use and if they are, abort the delete operation. Only if |
| 43 // none of the key files are in use, can the folder be deleted. Note that |
| 44 // this function does not return a full path to the key file(s), only (a) file |
| 45 // name(s). |
| 46 virtual void AddKeyFiles(const std::set<std::wstring>& options, |
| 47 std::vector<FilePath>* key_files) const = 0; |
| 48 |
| 49 // Adds to |com_dll_list| the list of COM DLLs that are to be registered |
| 50 // and/or unregistered. The list may be empty. |
| 51 virtual void AddComDllList(const std::set<std::wstring>& options, |
| 52 std::vector<FilePath>* com_dll_list) const = 0; |
| 53 |
| 54 // Given a command line, appends the set of uninstall flags the uninstaller |
| 55 // for this product will require. |
| 56 virtual void AppendProductFlags(const std::set<std::wstring>& options, |
| 57 CommandLine* uninstall_command) const = 0; |
| 58 |
| 59 // Adds or removes product-specific flags in |channel_info|. Returns true if |
| 60 // |channel_info| is modified. |
| 61 virtual bool SetChannelFlags(const std::set<std::wstring>& options, |
| 62 bool set, |
| 63 ChannelInfo* channel_info) const = 0; |
| 64 |
| 65 // Returns true if setup should create an entry in the Add/Remove list |
| 66 // of installed applications for this product. This does not test for use of |
| 67 // MSI; see InstallerState::is_msi. |
| 68 virtual bool ShouldCreateUninstallEntry( |
| 69 const std::set<std::wstring>& options) const = 0; |
| 70 }; |
| 71 |
| 72 } // namespace installer |
| 73 |
| 74 #endif // CHROME_INSTALLER_UTIL_PRODUCT_OPERATIONS_H_ |
OLD | NEW |