/*-----------------------------------------------------------------------------------*/
/* The following section actually creates the version structure.  They are ignored   */
/* ignored if we are not being invoked by RC.                                        */
/* VERSION.H must be included before including this file.                            */
/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR, and VER_INTERNALNAME_STR  */
/* must be defined before including this file.                                       */
/* If VER_FILEVERSION is not defined, VER_PRODUCTVERSION is used instead.            */
/* If VER_FILEVERSION_STR is not defined, VER_PRODUCTVERSION_STR is used instead.    */
/* If VER_ORIGINALFILENAME_STR is not defined, VER_INTERNALNAME_STR is used instead. */
/*-----------------------------------------------------------------------------------*/

#ifdef RC_INVOKED

#include "vsverstrings.h"

#ifndef VER_FILEVERSION
#define VER_FILEVERSION VER_PRODUCTVERSION
#endif

#ifndef VER_FILEVERSION_STR
#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
#endif

#ifndef VER_ORIGINALFILENAME_STR
#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR
#endif

#if defined(__BUILDMACHINE__)
#if defined(__BUILDDATE__)
#define B2(x,y) " (" #x "." #y ")"
#define B1(x,y) B2(x, y)
#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__)
#else
#define B2(x) " built by: " #x
#define B1(x) B2(x)
#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__)
#endif
#else
#define BUILD_MACHINE_TAG
#endif

#define __QUOTELANGCHAR(x) #x
#define _QUOTELANGCHAR(x, y) __QUOTELANGCHAR(x##y)
#define QUOTELANGCHAR(x, y) _QUOTELANGCHAR(x, y)

#ifndef VER_LANGID
#define VER_LANGID 0x0409
#ifdef VER_LANGID_HEX
#undef VER_LANGID_HEX
#endif
#define VER_LANGID_HEX 0409
#endif

#ifndef VER_LANGID_HEX
#error VER_LANGID_HEX should be defined if VER_LANGID is defined
#endif

// Always UNICODE
#define VER_CODEPAGE 0x04B0
#define VER_LANGCODEPAGE_STR QUOTELANGCHAR(VER_LANGID_HEX, 04b0)

VS_VERSION_INFO VERSIONINFO
FILEVERSION    VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK  VER_FILEFLAGSMASK
FILEFLAGS      VER_FILEFLAGS
FILEOS         VER_FILEOS
FILETYPE       VER_FILETYPE
FILESUBTYPE    VER_FILESUBTYPE
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK VER_LANGCODEPAGE_STR   /* default to LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
    BEGIN
      VALUE "CompanyName",     VER_COMPANYNAME_STR
      VALUE "FileDescription", VER_FILEDESCRIPTION_STR
      VALUE "FileVersion",     VER_FILEVERSION_STR BUILD_MACHINE_TAG
      VALUE "InternalName",    VER_INTERNALNAME_STR
      VALUE "LegalCopyright",  VER_LEGALCOPYRIGHT_STR
      VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR
      VALUE "ProductName",     VER_PRODUCTNAME_STR
      VALUE "ProductVersion",  VER_PRODUCTVERSION_STR
#if defined(VER_OLE_SELF_REGISTER)
      VALUE "OleSelfRegister", "\0"
#endif

    END

  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", VER_LANGID, VER_CODEPAGE
  END
END

#endif
