blob: ed631756328d0afda4d0f21cce1adc9d6662ffc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file declares utility functions for the installer. The original reason
// for putting these functions in installer\util library is so that we can
// separate out the critical logic and write unit tests for it.
#ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__
#define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__
#include <string>
#include <windows.h>
#include "base/basictypes.h"
#include "chrome/installer/util/util_constants.h"
#include "chrome/installer/util/version.h"
// This is a utility class that provides common installation related
// utility methods that can be used by installer and also unit tested
// independently.
class InstallUtil {
public:
// Launches given exe as admin on Vista.
static bool ExecuteExeAsAdmin(const std::wstring& exe,
const std::wstring& params,
DWORD* exit_code);
// Reads the uninstall command for Chromium from registry and returns it.
// If system_install is true the command is read from HKLM, otherwise
// from HKCU.
static std::wstring GetChromeUninstallCmd(bool system_install);
// Find the version of Chrome installed on the system by checking the
// Google Update registry key. Returns the version or NULL if no version is
// found.
// system_install: if true, looks for version number under the HKLM root,
// otherwise looks under the HKCU.
static installer::Version* GetChromeVersion(bool system_install);
// This function checks if the current OS is supported for Chromium.
static bool IsOSSupported();
private:
DISALLOW_EVIL_CONSTRUCTORS(InstallUtil);
};
#endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__
|