Also recognize ERROR_RESOURCE_DATA_NOT_FOUND for ModuleNotFound.

This commit is contained in:
Ryan Prichard 2016-04-10 17:52:59 -05:00
parent 8a769b19f5
commit 6fba69d602

View File

@ -109,7 +109,10 @@ VS_FIXEDFILEINFO getFixedFileInfo(const std::wstring &path) {
GET_VERSION_DLL_API(VerQueryValueW);
DWORD size = pGetFileVersionInfoSizeW(path.c_str(), nullptr);
if (!size) {
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
// I see ERROR_FILE_NOT_FOUND on Win7 and
// ERROR_RESOURCE_DATA_NOT_FOUND on WinXP.
if (GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_RESOURCE_DATA_NOT_FOUND) {
throw ModuleNotFound();
} else {
throwWindowsError(