Re: Test If Running Under Wine

2005-10-11 Thread Troy Rollo
On Wed, 12 Oct 2005 10:41, cdr wrote:

 This is naive and far from practical. To me, it's self-evident that an
 application will want know which run-time OS it's running under for many
 reasons; it's completely inappropriate for the run-time OS supplier to
 discourage it from doing so.

I wouldn't describe it as completely inappropriate. Aside from the reasons 
usually given, where possible it is preferable to provide the fix for Wine. 
Also, if the application is testing for Wine, why not do a Winelib port?

 It is further my observation that Wine developers are (unfortunately)
 not particularly interested in supporting application builders who
 would like to make their applications run well under Wine;

There are certainly some who are interested in the Winelib side of things.




Re: Test If Running Under Wine

2005-10-11 Thread cdr

Troy Rollo wrote:

Also, if the application is testing for Wine, why not do a Winelib port?


Single sorce to maintain, single binary to distribute.
cdr






Test If Running Under Wine

2005-10-10 Thread Craig macLeod



I am a developer of Win32 applications. We have 
recently found the command ShellExecute when 
trying to browse folders functions differently between Wine and Windows. This is 
mainly because there is no implementation of Windows Explorer unider Wine so the 
command does nothing.

How in our code do we differentiate between Wine 
runs and Windows runs?

The documentation discourages such tests saying we 
should fix Wine.

My boss wants to do minimal changes to our code so 
how do we do a simple test if we are using Wine or not? I have some code to test 
for the existance of explore.exe and if not present then assume we are under 
Linux. Is this sufficiently generic? (foreign languages 
etc)



Re: Test If Running Under Wine

2005-10-10 Thread Mike McCormack


Craig macLeod wrote:

I am a developer of Win32 applications. We have recently found the 
command ShellExecute when trying to browse folders functions differently 
between Wine and Windows. This is mainly because there is no 
implementation of Windows Explorer unider Wine so the command does nothing.
 
How in our code do we differentiate between Wine runs and Windows runs?


You could test for the presence of HKCU\Software\Wine\Wine, but that 
might change later.



The documentation discourages such tests saying we should fix Wine.
 
My boss wants to do minimal changes to our code so how do we do a simple 
test if we are using Wine or not? I have some code to test for the 
existance of explore.exe and if not present then assume we are under 
Linux. Is this sufficiently generic? (foreign languages etc)


It's discouraged because we might change the way things are done later, 
implement and explorer, etc and because we don't want applications to 
expect brokenness by default.  If somebody implements an explorer.exe 
that works in a few months, then your app will have permanently crippled 
itself, even though it might otherwise work.


Why not just run the ShellExecute and let it fail?

Mike




Re: Test If Running Under Wine

2005-10-10 Thread Boaz Harrosh

Craig macLeod wrote:

I have some code to test for the existance of explore.exe and if not 
present then assume we are under Linux. Is this sufficiently generic?


I think that is best. Since you are looking for the specific missing 
fixture, that could be fixed in future versions/Installations. Also you 
might consider suppling with your application installation a most simple 
explorer.exe that does exactly what you need. If it is to display a 
folder, look in codeproject.com they have a sample. Contact me off list 
I have a couple of hours work on top of that sample.


Free Life
Boaz


(foreign languages etc)


I've looked and did not find other names for it. 
%SystemRoot%\explorer.exe is probably it.

You also have the shell= in registry but that is not Necessary it.
also you have the public Window class: ExploreWClass = EXPLORER.EXE 
(look in MSDN)


Free life
Boaz