15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file contains helper functions used by setup. 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_INSTALLER_UTIL_HELPER_H_ 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_INSTALLER_UTIL_HELPER_H_ 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector> 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BrowserDistribution; 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace base { 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FilePath; 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace installer { 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This function returns the install path for Chrome depending on whether its 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// system wide install or user specific install. 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// system_install: if true, the function returns system wide location 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// (ProgramFiles\Google). Otherwise it returns user specific 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// location (Document And Settings\<user>\Local Settings...) 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)base::FilePath GetChromeInstallPath(bool system_install, BrowserDistribution* dist); 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the path(s) to the directory that holds the user data (primary and, 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// if applicable to |dist|, alternate). This is always inside a user's local 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// application data folder (e.g., "AppData\Local or "Local Settings\Application 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Data" in %USERPROFILE%). Note that these are the defaults and do not take 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// into account that they can be overriden with a command line parameter. 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |paths| may be empty on return, but is guaranteed not to contain empty paths 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// otherwise. If more than one path is returned, they are guaranteed to be 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// siblings. 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void GetChromeUserDataPaths(BrowserDistribution* dist, 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) std::vector<base::FilePath>* paths); 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the distribution corresponding to the current process's binaries. 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// In the case of a multi-install product, this will be the CHROME_BINARIES 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// distribution. 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)BrowserDistribution* GetBinariesDistribution(bool system_install); 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the app guid under which the current process receives updates from 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Google Update. 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::wstring GetAppGuidForUpdates(bool system_install); 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace installer 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // CHROME_INSTALLER_UTIL_HELPER_H_ 51