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