Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 contains helper functions used by setup. | 5 // This file contains helper functions used by setup. |
| 6 | 6 |
| 7 #ifndef CHROME_INSTALLER_UTIL_HELPER_H_ | 7 #ifndef CHROME_INSTALLER_UTIL_HELPER_H_ |
| 8 #define CHROME_INSTALLER_UTIL_HELPER_H_ | 8 #define CHROME_INSTALLER_UTIL_HELPER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 class BrowserDistribution; | 13 class BrowserDistribution; |
| 14 class CommandLine; | 14 class CommandLine; |
| 15 class FilePath; | 15 class FilePath; |
| 16 | 16 |
| 17 namespace installer { | 17 namespace installer { |
| 18 | 18 |
| 19 // Checks if a distribution is currently installed as part of a multi-install. | |
| 20 bool IsInstalledAsMulti(bool system_install, BrowserDistribution* dist); | |
| 21 | |
| 22 // Retrieves the command line switches for uninstalling the distribution. | |
| 23 // Note that the returned CommandLine object does not include a "program". | |
| 24 // Only the switches should be used. | |
| 25 // Returns true if the product is installed and the uninstall switches | |
| 26 // were successfully retrieved, otherwise false. | |
| 27 bool GetUninstallSwitches(bool system_install, BrowserDistribution* dist, | |
| 28 CommandLine* cmd_line_switches); | |
| 29 | |
| 30 // This function returns the install path for Chrome depending on whether its | 19 // This function returns the install path for Chrome depending on whether its |
| 31 // system wide install or user specific install. | 20 // system wide install or user specific install. |
| 32 // system_install: if true, the function returns system wide location | 21 // system_install: if true, the function returns system wide location |
| 33 // (ProgramFiles\Google). Otherwise it returns user specific | 22 // (ProgramFiles\Google). Otherwise it returns user specific |
| 34 // location (Document And Settings\<user>\Local Settings...) | 23 // location (Document And Settings\<user>\Local Settings...) |
| 35 FilePath GetChromeInstallPath(bool system_install, BrowserDistribution* dist); | 24 FilePath GetChromeInstallPath(bool system_install, BrowserDistribution* dist); |
| 36 | 25 |
| 37 // This function returns the path to the directory that holds the user data, | 26 // This function returns the path to the directory that holds the user data, |
| 38 // this is always inside "Document And Settings\<user>\Local Settings.". Note | 27 // this is always inside "Document And Settings\<user>\Local Settings.". Note |
| 39 // that this is the default user data directory and does not take into account | 28 // that this is the default user data directory and does not take into account |
| 40 // that it can be overriden with a command line parameter. | 29 // that it can be overriden with a command line parameter. |
| 41 FilePath GetChromeUserDataPath(BrowserDistribution* dist); | 30 FilePath GetChromeUserDataPath(BrowserDistribution* dist); |
| 42 | 31 |
| 43 // This is a workaround while we unify Chrome and Chrome Frame installation | 32 // Returns the distribution corresponding to the current process's binaries. |
| 44 // folders. Right now, Chrome Frame can be installed into two different | 33 // In the case of a multi-install product, this will be the CHROME_BINARIES |
| 45 // folders: 1) A special "Chrome Frame" folder next to Chrome's folder | 34 // distribution. |
| 46 // 2) The same folder as Chrome is installed into. | 35 BrowserDistribution* GetBinariesDistribution(bool system_install); |
| 47 // Right now this function will only return Chrome's installation folder | |
| 48 // if Chrome Frame is not already installed or if Chrome Frame is installed | |
| 49 // in multi_install mode. | |
| 50 // If multi_install is false or if CF is installed in single mode, then the | |
| 51 // returned path will be the "Chrome Frame" subfolder of either the user or | |
| 52 // system default installation folders. | |
| 53 FilePath GetChromeFrameInstallPath(bool multi_install, bool system_install, | |
| 54 BrowserDistribution* dist); | |
| 55 | 36 |
| 56 // Returns the app guid under which the current process receives updates from | 37 // Returns the app guid under which the current process receives updates from |
| 57 // Google Update. | 38 // Google Update. |
| 58 std::wstring GetAppGuidForUpdates(bool system_install); | 39 std::wstring GetAppGuidForUpdates(bool system_install); |
| 59 | 40 |
| 41 // Returns the rename command for the current process and populates |app_guid| | |
| 42 // with the location at which it was found. | |
|
robertshield
2011/01/20 23:36:34
app_guid doesn't actually get a location though ri
grt (UTC plus 2)
2011/01/21 05:27:51
This code has been removed.
| |
| 43 std::wstring GetRenameCommand(std::wstring* app_guid); | |
| 44 | |
| 60 } // namespace installer | 45 } // namespace installer |
| 61 | 46 |
| 62 #endif // CHROME_INSTALLER_UTIL_HELPER_H_ | 47 #endif // CHROME_INSTALLER_UTIL_HELPER_H_ |
| OLD | NEW |