Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@VERINFO and store apps?

May
12,845
164
WindowsTerminal.exe's properties show something pretty ordinary looking.

1613278211514.png


But @VERINFO gives an empty string for every info level. Any ideas?
 
Hmmm! I can say what's happening but I have no idea why. Following an example from the online help for VerQueryValue, if I

Code:
    struct LANGANDCODEPAGE {
        WORD wLanguage;
        WORD wCodePage;
    } *lpTranslate;

   // filling Buf omitted

    UINT uDataSize;
    b = VerQueryValue(Buf, L"\\VarFileInfo\\Translation", (LPVOID*)&lpTranslate, &uDataSize);
    wprintf(L"VerQueryValue returned %s\n", b ? L"TRUE" : L"FALSE");
    if ( b == TRUE )
    {
        wprintf(L"VQV gave %u bytes of data\nwLanguage = %04x\nwCodePage = %04x\n", uDataSize, lpTranslate[0].wLanguage, lpTranslate[0].wCodePage);
    }

I get

Code:
VerQueryValue returned TRUE
VQV gave 4 bytes of data
wLanguage = 0000
wCodePage = 04b0

That's wrong! Using devenv, I can see "040904b0" in the version resource, and if I print the raw data given by GetFileVersionInfoW, I see also see it.

Code:
?4VS_VERSION_INFO????????StringFileInfo?040904b0LCompanyNameMicrosoft CorporationPFileDescriptionWindowsTerminal.exe>FileVersion1.6.2102.10002@InternalNameWindowsTerminal€.LegalCopyright©Microsoft Corporation.  All rights reserved.POriginalFilenameWindowsTerminal.exeVProductVersion1.6.210210002-release1.6BProductNameWindows TerminalDVarFileInfo$Translation??

No surprise ... if I later ask for (e.g.) ProductVersion like this

Code:
        wsprintf(szQuery, L"\\StringFileInfo\\%04x%04x\\ProductVersion), lpTranslate[i].wLanguage, lpTranslate[i].wCodePage);
        b = VerQueryValueW(Buf, szQuery, &pVoid, &dwQueryData);

it fails. If, instead, I hard-code "040904b0" in the query string, It succeeds. Any ideas?
 
Back
Top