0

I need to get the versionInfo of a windows executable with a Python script running on MacOS. Since Winapi is not available on MacOS, I found that the way to do is via powershell commands. Installed it via brew as described here. pwsh is running after that.

using Get-Item or Get-ItemProperty with the exe on MacOS does return a value but the ProductionVersion and FileVersion are empty:

PS /Users/test>$m = Get-Item /Users/test/test.exe       
PS /Users/test>echo  $m                                                                                                

    Directory: /Users/test

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-----          04/29/2021    14:14        1045616 test.exe

PS /Users/test> $m.VersionInfo

ProductVersion   FileVersion      FileName
--------------   -----------      --------
                                 /Users/test/test.exe

running the same command on the same file on Windows does return both values.

What am I doing wrong? Is there an alternative for using winapi on MacOS to work with win exe?

Ido A
  • 87
  • 1
  • 1
  • 8
  • So, I believe there is no way a macOS can get a Windows exe version. It was answered here: https://superuser.com/questions/1004403/find-exe-file-version-of-a-file-in-osx – Karolina Ochlik May 20 '21 at 09:01
  • thanks @GrzegorzOchlik, that is exactly where I found to use the Powershell option :) but the results are empty strings :/ – Ido A May 20 '21 at 09:03

0 Answers0