install_util.h revision c2e0dbddbe15c98d52c4786dac06cb8952a8ae6d
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 declares utility functions for the installer. The original reason
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// for putting these functions in installer\util library is so that we can
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// separate out the critical logic and write unit tests for it.
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
111320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <windows.h>
139ab5563a3196760eb381d102cbb2bc0f7abc6a50Ben Murdoch#include <tchar.h>
14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/command_line.h"
17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "base/files/file_path.h"
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/string16.h"
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/win/scoped_handle.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/installer/util/browser_distribution.h"
214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "chrome/installer/util/util_constants.h"
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WorkItemList;
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace base {
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Version;
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This is a utility class that provides common installation related
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// utility methods that can be used by installer and also unit tested
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// independently.
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class InstallUtil {
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Get the path to this distribution's Active Setup registry entries.
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // e.g. Software\Microsoft\Active Setup\Installed Components\<dist_guid>
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static string16 GetActiveSetupPath(BrowserDistribution* dist);
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Attempts to trigger the command that would be run by Active Setup for a
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // system-level Chrome. For use only when system-level Chrome is installed.
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void TriggerActiveSetupCommand();
412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Launches given exe as admin on Vista.
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code);
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Reads the uninstall command for Chromium from registry and returns it.
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If system_install is true the command is read from HKLM, otherwise
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // from HKCU.
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static CommandLine GetChromeUninstallCmd(
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      bool system_install,
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      BrowserDistribution::Type distribution_type);
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Find the version of Chrome installed on the system by checking the
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Google Update registry key. Fills |version| with the version or a
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // default-constructed Version if no version is found.
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // system_install: if true, looks for version number under the HKLM root,
562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  //                 otherwise looks under the HKCU.
572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void GetChromeVersion(BrowserDistribution* dist,
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               bool system_install,
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               base::Version* version);
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Find the last critical update (version) of Chrome. Fills |version| with the
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // version or a default-constructed Version if no version is found. A critical
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // update is a specially flagged version (by Google Update) that contains an
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // important security fix.
652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // system_install: if true, looks for version number under the HKLM root,
662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  //                 otherwise looks under the HKCU.
672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void GetCriticalUpdateVersion(BrowserDistribution* dist,
68c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                       bool system_install,
69c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                       base::Version* version);
702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // This function checks if the current OS is supported for Chromium.
722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static bool IsOSSupported();
732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Adds work items to |install_list|, which should be a
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // NoRollbackWorkItemList, to set installer error information in the registry
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // for consumption by Google Update.  |state_key| must be the full path to an
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // app's ClientState key.  See InstallerState::WriteInstallerResult for more
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // details.
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static void AddInstallerResultItems(bool system_install,
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                      const string16& state_key,
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                      installer::InstallStatus status,
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                      int string_resource_id,
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                      const string16* const launch_cmd,
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                      WorkItemList* install_list);
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Update the installer stage reported by Google Update.  |state_key_path|
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // should be obtained via the state_key method of an InstallerState instance
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // created before the machine state is modified by the installer.
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static void UpdateInstallerStage(bool system_install,
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   const string16& state_key_path,
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   installer::InstallerStage stage);
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns true if this installation path is per user, otherwise returns
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // false (per machine install, meaning: the exe_path contains path to
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Program Files).
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool IsPerUserInstall(const wchar_t* const exe_path);
975d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
985d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Returns true if the installation represented by the pair of |dist| and
995d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // |system_level| is a multi install.
1005d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static bool IsMultiInstall(BrowserDistribution* dist, bool system_install);
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns true if this is running setup process for Chrome SxS (as
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // indicated by the presence of --chrome-sxs on the command line) or if this
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // is running Chrome process from the Chrome SxS installation (as indicated
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // by either --chrome-sxs or the executable path).
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool IsChromeSxSProcess();
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Populates |path| with the path to |file| in the sentinel directory. This is
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the application directory for user-level installs, and the default user
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // data dir for system-level installs. Returns false on error.
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool GetSentinelFilePath(const base::FilePath::CharType* file,
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  BrowserDistribution* dist,
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  base::FilePath* path);
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Deletes the registry key at path key_path under the key given by root_key.
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool DeleteRegistryKey(HKEY root_key, const string16& key_path);
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Deletes the registry value named value_name at path key_path under the key
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // given by reg_root.
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool DeleteRegistryValue(HKEY reg_root, const string16& key_path,
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  const string16& value_name);
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // An interface to a predicate function for use by DeleteRegistryKeyIf and
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // DeleteRegistryValueIf.
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  class RegistryValuePredicate {
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   public:
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    virtual ~RegistryValuePredicate() { }
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    virtual bool Evaluate(const string16& value) const = 0;
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };
1302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The result of a conditional delete operation (i.e., DeleteFOOIf).
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  enum ConditionalDeleteResult {
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    NOT_FOUND,      // The condition was not satisfied.
1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    DELETED,        // The condition was satisfied and the delete succeeded.
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    DELETE_FAILED   // The condition was satisfied but the delete failed.
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Deletes the key |key_to_delete_path| under |root_key| iff the value
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |value_name| in the key |key_to_test_path| under |root_key| satisfies
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |predicate|.  |value_name| may be either NULL or an empty string to test
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the key's default value.
1422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static ConditionalDeleteResult DeleteRegistryKeyIf(
1432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      HKEY root_key,
1442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const string16& key_to_delete_path,
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const string16& key_to_test_path,
1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const wchar_t* value_name,
147f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)      const RegistryValuePredicate& predicate);
148cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
149cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // Deletes the value |value_name| in the key |key_path| under |root_key| iff
150cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // its current value satisfies |predicate|.  |value_name| may be either NULL
151cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // or an empty string to test/delete the key's default value.
152cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  static ConditionalDeleteResult DeleteRegistryValueIf(
153cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)      HKEY root_key,
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const wchar_t* key_path,
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const wchar_t* value_name,
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const RegistryValuePredicate& predicate);
157f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // A predicate that performs a case-sensitive string comparison.
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  class ValueEquals : public RegistryValuePredicate {
1604e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)   public:
1614e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    explicit ValueEquals(const string16& value_to_match)
162cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)        : value_to_match_(value_to_match) { }
163cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    virtual bool Evaluate(const string16& value) const OVERRIDE;
164cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)   protected:
165cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    string16 value_to_match_;
166cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)   private:
167cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    DISALLOW_COPY_AND_ASSIGN(ValueEquals);
1685d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  };
1695d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1705d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Returns zero on install success, or an InstallStatus value otherwise.
1715d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static int GetInstallReturnCode(installer::InstallStatus install_status);
1725d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Composes |program| and |arguments| into |command_line|.
1745d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static void MakeUninstallCommand(const string16& program,
1755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                                   const string16& arguments,
1765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                                   CommandLine* command_line);
1775d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1785d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Returns a string in the form YYYYMMDD of the current date.
1795d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static string16 GetCurrentDate();
1805d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
181cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // A predicate that compares the program portion of a command line with a
182cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // given file path.  First, the file paths are compared directly.  If they do
183cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // not match, the filesystem is consulted to determine if the paths reference
184cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // the same file.
1855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  class ProgramCompare : public RegistryValuePredicate {
186cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)   public:
187cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    explicit ProgramCompare(const base::FilePath& path_to_match);
1885d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    virtual ~ProgramCompare();
1894e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    virtual bool Evaluate(const string16& value) const OVERRIDE;
1904e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)    bool EvaluatePath(const base::FilePath& path) const;
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
192868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)   protected:
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    static bool OpenForInfo(const base::FilePath& path,
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            base::win::ScopedHandle* handle);
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    static bool GetInfo(const base::win::ScopedHandle& handle,
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                        BY_HANDLE_FILE_INFORMATION* info);
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    base::FilePath path_to_match_;
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    base::win::ScopedHandle file_handle_;
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    BY_HANDLE_FILE_INFORMATION file_info_;
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   private:
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    DISALLOW_COPY_AND_ASSIGN(ProgramCompare);
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };  // class ProgramCompare
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(InstallUtil);
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)