Thank you very much. Uwe suggested a method along these lines:
HMODULE hModule = GetModuleHandle("kernel32"); BOOL Wine = hModule && GetProcAddress(hModule, "wine_get_unix_file_name");
It'd be a good thing to put in a FAQ. I couldn't find it anyway.
--Mike
----- Original Message ----- From: "Paul McNett" p@ulmcnett.com To: "Mike Engelhardt" pmte@concentric.net; wine-devel@winehq.com Sent: Friday, February 28, 2003 10:38 AM Subject: Re: Report after porting a windows app to WINE
On Thursday 27 February 2003 04:29 pm, Mike Engelhardt wrote:
I would like to know if there is a way to determine if my app is running under WINE under runtime. That way I can work around more of these problems without imparing its performance under MS Windows. If you know the answer, please e-mail me directly.
In my app startup, I look for the environmental variable "_". Under Windows, it will likely not even exist. Under Wine, it will tell you something like "/usr/local/bin/wine". I save this to a global variable called _WINE. That way, no matter where I am in my app I can check the value of _WINE to decide which branch to execute. I haven't had to use this yet, and hope not to, but built it in already just in case.
HTH
-- Paul McNett - p@ulmcnett.com Hollister, California, USA