Reputation: 29
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
Reputation: 73482
var versionInfo = FileVersionInfo.GetVersionInfo(yourExePath);
string fileDescription = versionInfo.FileDescription;
string productName = versionInfo.ProductName;
Upvotes: 2