2017-05-18 22:58:12 +00:00
|
|
|
#include "brightray/common/application_info.h"
|
2013-05-21 15:40:49 +00:00
|
|
|
|
2017-05-18 22:29:22 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2013-05-28 19:24:55 +00:00
|
|
|
#include "base/file_version_info.h"
|
2013-08-23 21:01:18 +00:00
|
|
|
#include "base/strings/utf_string_conversions.h"
|
2013-05-28 19:24:55 +00:00
|
|
|
|
2013-05-21 15:40:49 +00:00
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
std::string GetApplicationName() {
|
2013-11-18 00:13:44 +00:00
|
|
|
auto module = GetModuleHandle(nullptr);
|
2016-05-23 06:08:20 +00:00
|
|
|
std::unique_ptr<FileVersionInfo> info(
|
2013-11-18 00:13:44 +00:00
|
|
|
FileVersionInfo::CreateFileVersionInfoForModule(module));
|
2014-06-27 18:02:44 +00:00
|
|
|
return base::UTF16ToUTF8(info->product_name());
|
2013-05-21 15:40:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string GetApplicationVersion() {
|
2013-11-18 00:13:44 +00:00
|
|
|
auto module = GetModuleHandle(nullptr);
|
2016-05-23 06:08:20 +00:00
|
|
|
std::unique_ptr<FileVersionInfo> info(
|
2013-11-18 00:13:44 +00:00
|
|
|
FileVersionInfo::CreateFileVersionInfoForModule(module));
|
2014-06-27 18:02:44 +00:00
|
|
|
return base::UTF16ToUTF8(info->product_version());
|
2013-05-21 15:40:49 +00:00
|
|
|
}
|
|
|
|
|
2013-11-17 23:20:17 +00:00
|
|
|
} // namespace brightray
|