user3061673
user3061673

Reputation: 29

how can i get fileversioninfo from 64 bits process C#

I need to get the following information about FileVersionInfo.FileDescription and FileVersionInfo.ProductName for a 64-bit process, is this possible?

When is a 32-bit process I get this way, as if in this, but when is a 64-bit process could not get a way to get this information.

if (32BitProcess)
{
    descricaoArquivo = Process.MainModule.FileVersionInfo.FileDescription;
    nomePrograma = Process.MainModule.FileVersionInfo.ProductName;
}
else
{
    nomePrograma = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location);
    descricaoArquivo = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().FullName);
}

Upvotes: 3

Views: 919

Answers (1)

Sriram Sakthivel
Sriram Sakthivel

Reputation: 73482

var versionInfo = FileVersionInfo.GetVersionInfo(yourExePath);
string fileDescription = versionInfo.FileDescription;
string productName = versionInfo.ProductName;

Upvotes: 2

Related Questions