tools/wineshelllink: do not execute applications directly, use 'start' utility instead

Kirill K. Smirnov lich at math.spbu.ru
Sun Dec 23 13:23:57 CST 2007


>> -Exec=env WINEPREFIX="${WINEPREFIX:-$HOME/.wine}" wine "$path" $args
>> +Exec=env WINEPREFIX="${WINEPREFIX:-$HOME/.wine}" wine start "$path" $args
>This is not correct. If console needs to be created for those apps and there 
>isn't one, then Wine should do it when starting an app.

  This is correct. "wine start" is the right way to start complicated (which 
use AllocConsole/FreeConsole and HWND) console applications (bug #10827 and 
bug #10867).

  I do not understand how to detect lack of console even for applications 
called from desktop shortcut. Dumb IO console is always present AFAIK. I 
tried to following:

Create simple console application.
#include <stdio.h>

int main(void)
{
        FILE *f = fopen("ia.txt", "w");
        int ret;

        ret = fprintf(stdout, "qqq\n");
        fprintf(f, "%d\n", ret);
        fclose(f);
        return 0;
}

compiled it as windows console app and run it:
1) $ wine a.exe
2) $ wine start a.exe
3) create a desktop shortcut and click on it.

1'), 2'), 3') compiled the same app as a UNIX app and run it via desktop 
shortcut.
In all cases results are the same: successful output to stdout (res=4).

This makes me think that stdio handles are always present.  I may be wrong, 
just let me know.

--
Kirill



More information about the wine-devel mailing list