How can an app detect it's running under WINE?
prupe at myrealbox.com
Fri Oct 25 10:18:11 CDT 2002
On 25 Oct 2002, alby at exln.com wrote:
> However, I would feel better if I could detect I am running under WINE
> and gracefully disable some functionalities that are not yet fully
> supported; is there any way to achieve this?
I look at this the same way I do those browser-sniffing scripts many
websites use. As an Opera user I get really annoyed when I run into a site
that kicks me out for no reason other than its user agent string. "If not
IE and not NS, go away." Maybe this made sense when Opera was at version
2, but not now at version 6-going-on-7. Almost every time the site works
fine if I just bypass the silly check.
My suggestion is whenever possible check for features, not version strings.
Just call the API and if it fails, then gracefully disable whatever
functionality. When some future version of Wine supports that API, it will
just start working without any further effort on your part. An added
benefit is that whichever Wine developer is implementing that feature will
have your app to test with. Also have some sympathy for the poor Wine
developer tearing his hair out trying to figure out why your app behaves
differently in Wine vs. Windows no matter how perfect his shiny new
DX12/DCOM/HAL/TANSTAAFL implementation is. :)
Paul Rupe "She smiled, in the end."
p r u p e @ m y r e a l b o x . c o m
| Oppose government police-ware on your PC!
| Stop the Consumer Broadband and Digital Television Promotion Act!
More information about the wine-devel