Search code examples
delphiwinedelphi-xe7

How to detect if Delphi program runs in PlayOnMac


I have a Delphi application which runs smooth in PlayOnMac under MacOS 10.9.5 Yosemite.

It has the feature to minimize the application to TrayBar. Since Mac is not having the concept of TrayBar I would like to disable this feature if the app runs on Mac.

Checking the Windows version is not an option since PlayOnMac really well obfuscates the fact that the host OS is Mac by emulating the Windows APIs and reporting that the OS is Windows XP for example.

How I can detect that the application is running in PlayOnMac?


Solution

  • Because the PlayOnmac engine uses Wine, you can try searching for the wine_get_version and wine_nt_to_unix_file_name methods on the ntdll.dll module using the LoadLibrary and GetProcAddress functions.

    Additionally try these resources.