http://bugs.winehq.org/show_bug.cgi?id=35254
Bug ID: 35254 Summary: Freemake Video Converter 4.1 installer complains about running Freemake processes (builtin 'findstr' stub app always returns "match") Product: Wine Version: 1.7.9 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: programs Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Classification: Unclassified
Hello folks,
continuation of bug 32937
Code of extracted batch file 'CheckRunningInstance.cmd':
--- snip --- tasklist | findstr "FreemakeAC | FreemakeVD | FreemakeMB | FreemakeVC | FreemakeYC" --- snip ---
Relevant part of trace log:
--- snip --- 0052:Call KERNEL32.CreateProcessW(00000000,00995cec L""C:\windows\system32\cmd.exe" /C ""C:\users\focht\Temp\is-PQPUK.tmp\CheckRunningInstance.cmd""",00000000,00000000,00000000,04000000,00000000,00966a5c L"C:\users\focht\Temp\is-PQPUK.tmp",0033f9e0,0033f9d0) ret=004ac6a1 ... 005c:Call KERNEL32.__wine_kernel_init() ret=7bc5a036 0052:Ret KERNEL32.CreateProcessW() retval=00000001 ret=004ac6a1 ... 005c:Call KERNEL32.CreateProcessW(00329964 L"C:\windows\system32\tasklist.EXE",00145f28 L"tasklist ",00000000,00000000,00000001,00000000,00000000,00000000,00329920,00329e24) ret=7ed031b2 ... 005e:Call KERNEL32.__wine_kernel_init() ret=7bc5a036 005c:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7ed031b2 ... 005e:Starting process L"C:\windows\system32\tasklist.exe" (entryproc=0x7edfd7b8) 005e:fixme:tasklist:wmain stub: L"tasklist" 005e:Call KERNEL32.ExitProcess(00000000) ret=7edfd846 ... 005c:Ret KERNEL32.WaitForSingleObject() retval=00000000 ret=7ed03270 005c:Call KERNEL32.GetExitCodeProcess(0000004c,7edc7ce0) ret=7ed0328b 005c:Ret KERNEL32.GetExitCodeProcess() retval=00000001 ret=7ed0328b ... 005c:Call KERNEL32.CreateProcessW(00329964 L"C:\windows\system32\findstr.EXE",00145f28 L"findstr "FreemakeAC | FreemakeVD | FreemakeMB | FreemakeVC | FreemakeYC"",00000000,00000000,00000001,00000000,00000000,00000000,00329920,00329e24) ret=7ed031b2 ... 0060:Call KERNEL32.__wine_kernel_init() ret=7bc5a036 005c:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7ed031b2 ... 005c:Call KERNEL32.WaitForSingleObject(0000004c,ffffffff) ret=7ed03270 ... 0060:Starting process L"C:\windows\system32\findstr.exe" (entryproc=0x7edfd7b8) 0060:fixme:findstr:wmain stub: L"findstr" L"FreemakeAC | FreemakeVD | FreemakeMB | FreemakeVC | FreemakeYC" 0060:Call KERNEL32.ExitProcess(00000000) ret=7edfd846 ... 005c:Ret KERNEL32.WaitForSingleObject() retval=00000000 ret=7ed03270 005c:Call KERNEL32.GetExitCodeProcess(0000004c,7edc7ce0) ret=7ed0328b 005c:Ret KERNEL32.GetExitCodeProcess() retval=00000001 ret=7ed0328b ... 005c:Call KERNEL32.ExitProcess(00000000) ret=7ed07262 ... 0052:Ret user32.MsgWaitForMultipleObjects() retval=00000000 ret=004af027
0052:Call KERNEL32.GetExitCodeProcess(0000007c,0033fb8c) ret=004af038 0052:Ret KERNEL32.GetExitCodeProcess() retval=00000001 ret=004af038 ... 0052:Call user32.MessageBoxW(00010196,00644fec L"Setup has detected that one or more of Freemake programs are currently running.\r\n\r\nPlease close all instances of Freemake running programs now, then click OK to continue, or Cancel to exit.",0065b51c L"Setup",00000021) ret=0047c446 ... --- snip ---
Wine builtin 'tasklist' and 'findstr' are stub apps that return exit code 0 - regardless what was passed in (because they do nothing as of now). This gets propagated through cmd.exe exit code to caller (GetExitCodeProcess).
cmd.exe -> 0 findstr.exe -> 0 tasklist.exe -> 0
The problem is that Windows 'findstr' uses inverted logic. Match -> exit code = 0 No match -> exit code = 1
Wine 'findstr' always returns 0 hence the installer takes this a process list match and complains.
Source: http://source.winehq.org/git/wine.git/blob/3ce21826c87434e9aea6fad5e62bd37b3...
--- snip --- 23 int wmain(int argc, WCHAR *argv[]) 24 { 25 int i; 26 27 WINE_FIXME("stub:"); 28 for (i = 0; i < argc; i++) 29 WINE_FIXME(" %s", wine_dbgstr_w(argv[i])); 30 WINE_FIXME("\n"); 31 32 return 0; 33 } --- snip ---
It shouldn't be too hard to implement a minimal string/pattern matching.
Another way is to change the default behaviour to "no match" (return 1). I'm not sure if it breaks apps that currently depend on stub "match" behaviour.
$ sha1sum FreemakeVideoConverterSetup.exe 20cbd93a0041da2eeef6350f6426407df660858d FreemakeVideoConverterSetup.exe
$ du -sh FreemakeVideoConverterSetup.exe 1.3M FreemakeVideoConverterSetup.exe
$ wine --version wine-1.7.9-209-gb231b4b
Regards