tools: add a wrapper script for starting files from file managers and make wine.desktop use it

Jeff Zaroyko jeffzaroyko at gmail.com
Sat Feb 16 20:02:08 CST 2008


Vincent Povirk <madewokherd+d41d <at> gmail.com> writes:

> 
> This is an attempt to solve the problems with double-clicking .exe
> files from file managers.
> 
> The patch adds a script named winestartfile that mimics what happens
> on windows when a file is double-clicked in explorer. It starts the
> file using start.exe with the full path to the file and in the
> directory that contains it.
> 
> It also modifies the wine.desktop shortcut to use that script when
> opening .exe files.
> 
> My previous attempt at this incorrectly ran start without giving a
> full path (so that if a file named start.exe exists in the current
> path, it will take precedence) and probably tried to change too many
> things at once.
> 


I'm writing this here after I pointed out to Vincent on irc that this patch
doesn't exactly live up its name, but I agree with the direction it's going in,
but this patch shouldn't be committed.  I think that a patch of this nature
could directly address and solve this bug, but it's not possible to give windows
explorer behaviour in a shell script alone.

This patch includes the description "Start a file as if it were double-clicked
in windows explorer."

There is a bug currently open which I think the resolution is to run the program
as if it were double-clicked in windows explorer.  See bug 5224
http://bugs.winehq.org/show_bug.cgi?id=5224

Such a patch will need to always quote the application name, as
returned by GetCommandLineA because windows explorer _always_ quotes this. 

Quoting is a requirement to allow it to be parsed correctly _if_ there are
spaces because the string returned by GetCommandLineA is delimited by spaces
outside of quotes "". 

This behaviour can be tested using the example program provided in comment #15
(also attached).

Double clicking on it in explorer (or this discussed patch to facilitate the
same behaviour) GetCommandLineA.exe should print out "GetCommandLineA.exe" if
the behaviour is correct.  If it is incorrect then GetCommandLineA.exe will be
printed.






More information about the wine-patches mailing list