forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_install_details.h
44 lines (32 loc) · 1.71 KB
/
product_install_details.h
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
// Copyright 2016 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.
// Contains functions for determining the product's InstallDetails at runtime.
#ifndef CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_
#define CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_
#include <memory>
#include <string>
namespace install_static {
class PrimaryInstallDetails;
// Creates product details for the current process and sets them as the global
// InstallDetails for the process. This is intended to be called early in
// process startup. A process's "primary" module may be the executable itself or
// may be another DLL that is loaded and initialized prior to executing the
// executable's entrypoint (i.e., chrome_elf.dll).
void InitializeProductDetailsForPrimaryModule();
// Returns true if |parent| is a parent of |path|. Path separators at the end of
// |parent| are ignored. Returns false if |parent| is empty.
bool IsPathParentOf(const wchar_t* parent,
size_t parent_len,
const std::wstring& path);
// Returns true if |path| is within C:\Program Files{, (x86)}.
bool PathIsInProgramFiles(const std::wstring& path);
// Returns the install suffix embedded in |exe_path| or an empty string if none
// is found. |exe_path| is expected be something similar to
// "...\[kProductName][suffix]\Application".
std::wstring GetInstallSuffix(const std::wstring& exe_path);
// Creates product details for the process at |exe_path|.
std::unique_ptr<PrimaryInstallDetails> MakeProductDetails(
const std::wstring& exe_path);
} // namespace install_static
#endif // CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_