// VersionInfo.cpp: implementation of the CVersionInfo class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "bindinstall.h"
#include "VersionInfo.h"
#include <winver.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
{
// See if the given file exists
if(hFile == INVALID_HANDLE_VALUE)
{
return;
}
// Extract the file info
if(viSize == 0)
{
m_status = GetLastError();
}
else
{
m_versionInfo = new char[viSize];
// Get the block of version info from the file
{
if(m_versionInfo)
{
delete [] m_versionInfo;
}
return;
}
// Now extract the sub block we are interested in
{
if(m_versionInfo)
{
delete [] m_versionInfo;
}
return;
}
// And finally the version info is ours
// If we got here, all is good
}
}
{
m_fixedInfo = NULL;
if(m_versionInfo)
{
delete [] m_versionInfo;
}
}
{
return(QueryStringValue("FileVersion"));
}
{
return(QueryStringValue("ProductVersion"));
}
{
return(QueryStringValue("Comments"));
}
{
return(QueryStringValue("FileDescription"));
}
{
return(QueryStringValue("InternalName"));
}
{
return(QueryStringValue("LegalCopyright"));
}
{
return(QueryStringValue("LegalTrademarks"));
}
{
return(QueryStringValue("OriginalFilename"));
}
{
return(QueryStringValue("ProductName"));
}
{
return(QueryStringValue("SpecialBuild"));
}
{
return(QueryStringValue("PrivateBuild"));
}
{
return(QueryStringValue("CompanyName"));
}
#ifdef NOTUSED
{
{
return(TRUE);
}
return(CopyFileNoVersion(originalFile));
}
#endif
{
int x = 7;
}
{
if(m_versionInfo)
{
ver <<= 32;
}
return(ver);
}
{
if(m_versionInfo)
{
ver <<= 32;
}
return(ver);
}
{
if(m_versionInfo)
{
fDate <<= 32;
}
return(fDate);
}
{
if(m_versionInfo)
{
return(m_fixedInfo->dwFileFlagsMask);
}
return(0);
}
{
if(m_versionInfo)
{
return(m_fixedInfo->dwFileFlags);
}
return(0);
}
{
if(m_versionInfo)
{
return(m_fixedInfo->dwFileOS);
}
return(VOS_UNKNOWN);
}
{
if(m_versionInfo)
{
return(m_fixedInfo->dwFileType);
}
return(VFT_UNKNOWN);
}
{
if(m_versionInfo)
{
return(m_fixedInfo->dwFileSubtype);
}
return(VFT2_UNKNOWN);
}
{
if(m_versionInfo)
{
// This code page value is for American English. If you change the resources to be other than that
// You probably should change this to match it.
return((char *)viBlob);
}
return("Not Available");
}