blob: 3b9457cceace1cde6363cc06046ee0a641136537 [file] [log] [blame]
[email protected]90509cb2011-03-25 18:46:381// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commitd7cae122008-07-26 21:49:384
tfarinaa31163512015-05-13 22:10:155#ifndef BASE_FILE_VERSION_INFO_H_
6#define BASE_FILE_VERSION_INFO_H_
initial.commitd7cae122008-07-26 21:49:387
thakisd62f54472016-04-04 02:21:108#include <string>
9
[email protected]70910be2011-04-22 23:55:4510#include "build/build_config.h"
thakisd62f54472016-04-04 02:21:1011#include "base/base_export.h"
12#include "base/strings/string16.h"
[email protected]70910be2011-04-22 23:55:4513
14#if defined(OS_WIN)
15#include <windows.h>
thakisd62f54472016-04-04 02:21:1016#endif
[email protected]72c93c702008-08-05 20:00:2617
[email protected]a3ef4832013-02-02 05:12:3318namespace base {
[email protected]f5393332009-06-03 15:01:2919class FilePath;
[email protected]a3ef4832013-02-02 05:12:3320}
[email protected]f5393332009-06-03 15:01:2921
[email protected]4f260d02010-12-23 18:35:4222// Provides an interface for accessing the version information for a file. This
23// is the information you access when you select a file in the Windows Explorer,
24// right-click select Properties, then click the Version tab, and on the Mac
25// when you select a file in the Finder and do a Get Info.
26//
27// This list of properties is straight out of Win32's VerQueryValue
28// <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac
29// version returns values from the Info.plist as appropriate. TODO(avi): make
30// this a less-obvious Windows-ism.
initial.commitd7cae122008-07-26 21:49:3831
mgiuca8137fc22015-05-07 02:20:3132class BASE_EXPORT FileVersionInfo {
initial.commitd7cae122008-07-26 21:49:3833 public:
[email protected]e462cf52010-05-21 23:00:1734 virtual ~FileVersionInfo() {}
[email protected]bcff05a2010-04-14 01:46:4335#if defined(OS_WIN) || defined(OS_MACOSX)
initial.commitd7cae122008-07-26 21:49:3836 // Creates a FileVersionInfo for the specified path. Returns NULL if something
37 // goes wrong (typically the file does not exit or cannot be opened). The
38 // returned object should be deleted when you are done with it.
mgiuca8137fc22015-05-07 02:20:3139 static FileVersionInfo* CreateFileVersionInfo(
[email protected]a3ef4832013-02-02 05:12:3340 const base::FilePath& file_path);
[email protected]7c1e3032010-12-20 18:40:4241#endif // OS_WIN || OS_MACOSX
42
[email protected]70910be2011-04-22 23:55:4543#if defined(OS_WIN)
44 // Creates a FileVersionInfo for the specified module. Returns NULL in case
45 // of error. The returned object should be deleted when you are done with it.
mgiuca8137fc22015-05-07 02:20:3146 static FileVersionInfo* CreateFileVersionInfoForModule(HMODULE module);
[email protected]70910be2011-04-22 23:55:4547#else
48 // Creates a FileVersionInfo for the current module. Returns NULL in case
49 // of error. The returned object should be deleted when you are done with it.
mgiuca8137fc22015-05-07 02:20:3150 static FileVersionInfo* CreateFileVersionInfoForCurrentModule();
[email protected]70910be2011-04-22 23:55:4551#endif // OS_WIN
initial.commitd7cae122008-07-26 21:49:3852
initial.commitd7cae122008-07-26 21:49:3853 // Accessors to the different version properties.
54 // Returns an empty string if the property is not found.
[email protected]476dafb2013-12-03 00:39:2655 virtual base::string16 company_name() = 0;
56 virtual base::string16 company_short_name() = 0;
57 virtual base::string16 product_name() = 0;
58 virtual base::string16 product_short_name() = 0;
59 virtual base::string16 internal_name() = 0;
60 virtual base::string16 product_version() = 0;
61 virtual base::string16 private_build() = 0;
62 virtual base::string16 special_build() = 0;
63 virtual base::string16 comments() = 0;
64 virtual base::string16 original_filename() = 0;
65 virtual base::string16 file_description() = 0;
66 virtual base::string16 file_version() = 0;
67 virtual base::string16 legal_copyright() = 0;
68 virtual base::string16 legal_trademarks() = 0;
69 virtual base::string16 last_change() = 0;
[email protected]bcff05a2010-04-14 01:46:4370 virtual bool is_official_build() = 0;
initial.commitd7cae122008-07-26 21:49:3871};
72
tfarinaa31163512015-05-13 22:10:1573#endif // BASE_FILE_VERSION_INFO_H_