Skip to content

Unable to get FileVersionInfo data from exe #110235

Open
@codecat

Description

@codecat

Description

When looking at the System.Diagnostics.FileVersionInfo output for the TeamViewer Quicksupport executable, I get all empty strings for fields like ProductName and LegalCopyright, while they do in fact exist, according to Windows Explorer:

Image

Reproduction Steps

This code will get a path to TeamViewerQS_x64.exe (see description above for download link), and print to console some of the properties from the file version info.

// Get path to downloads folder and TeamViewerQS_x64.exe
var userPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var downloadsPath = Path.Combine(userPath, "Downloads");
var exePath = Path.Combine(downloadsPath, "TeamViewerQS_x64.exe");

// Get file version info and print to console
var fvi = FileVersionInfo.GetVersionInfo(exePath);
Console.WriteLine($"version major = {fvi.ProductMajorPart}");
Console.WriteLine($"version minor = {fvi.ProductMinorPart}");
Console.WriteLine($"product name = \"{fvi.ProductName}\"");
Console.WriteLine($"copyright = \"{fvi.LegalCopyright}\"");

Expected behavior

The expected output of the example code above should be (according to Windows Explorer):

version major = 15
version minor = 60
product name = "TeamViewer QS"
copyright = "TeamViewer"

Actual behavior

The actual output of the example code is:

version major = 15
version minor = 60
product name = ""
copyright = ""

Interesting to note is the version integers are correct.

Regression?

No response

Known Workarounds

No response

Configuration

I tried this on Windows 11, both .Net 8.0.400 and .Net 9.0.100. It also happens on Windows 10.

Other information

Considering the version integers are correct, perhaps this is some kind of string encoding issue? It appears that the TeamViewer QuickSupport exe is a compiled NSIS program, which may be relevant in helping to narrow this down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions