electron/brightray/common/application_info_win.cc
2016-05-23 15:26:44 +09:00

24 lines
668 B
C++

#include <memory>
#include "common/application_info.h"
#include "base/file_version_info.h"
#include "base/strings/utf_string_conversions.h"
namespace brightray {
std::string GetApplicationName() {
auto module = GetModuleHandle(nullptr);
std::unique_ptr<FileVersionInfo> info(
FileVersionInfo::CreateFileVersionInfoForModule(module));
return base::UTF16ToUTF8(info->product_name());
}
std::string GetApplicationVersion() {
auto module = GetModuleHandle(nullptr);
std::unique_ptr<FileVersionInfo> info(
FileVersionInfo::CreateFileVersionInfoForModule(module));
return base::UTF16ToUTF8(info->product_version());
}
} // namespace brightray