[Bug 35134] New: Shroud of the Avatar: Forsaken Virtues installer waits indefinitely for cmd.exe during execution of batch files (argv[0] is not 'cmd.exe')

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Dec 15 13:55:40 CST 2013


http://bugs.winehq.org/show_bug.cgi?id=35134

            Bug ID: 35134
           Summary: Shroud of the Avatar: Forsaken Virtues installer waits
                    indefinitely for cmd.exe during execution of batch
                    files (argv[0] is not 'cmd.exe')
           Product: Wine
           Version: 1.7.8
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cmd
          Assignee: wine-bugs at winehq.org
          Reporter: focht at gmx.net
    Classification: Unclassified

Hello folks,

the unwrapped installer spawns 'cmd.exe' to execute some batch files.
CreateProcessAsUserW() is used which just passes appname and cmdline to
CreateProcessW().

'appname' -> "C:\\windows\\system32\\cmd.exe"
'cmdline' -> "/C
\"C:\\users\\focht\\Temp\\{3CD9F337-4F1D-41C4-A1E4-86453C48EDC4}.bat\""

--- snip ---
$ WINEDEBUG=+tid,+seh,+relay,+cmd wine ./SotAInstaller.exe >>log.txt 2>&1
...
0024:Call KERNEL32.CreateProcessW(001481f8
L"C:\\windows\\system32\\msiexec.exe",001483f8 L" /i 
\"C:\\users\\focht\\Application Data\\Portalarium\\Shroud of the Avatar
0.1.0\\install\\8E829DF\\ShroudPatchClientInstaller.msi\" 
AI_SETUPEXEPATH=\"Z:\\home\\focht\\Downloads\\SotAInstaller.exe\"
SETUPEXEDIR=\"Z:\\home\\focht\\Downloads\\\" EXE_CMD_LINE=\"/exenoupdates 
/exelang 0 /noprereqs  
",00000000,00000000,00000000,00000020,00000000,00000000,0033f8d0,0033f918)
ret=0040f458
...
002b:Call KERNEL32.__wine_kernel_init() ret=7bc599ec
0024:Ret  KERNEL32.CreateProcessW() retval=00000001 ret=0040f458 
...
0039:Call advapi32.CreateProcessAsUserW(000000dc,00b54e98
L"C:\\windows\\system32\\cmd.exe",00b55388 L"/C
\"C:\\users\\focht\\Temp\\{3CD9F337-4F1D-41C4-A1E4-86453C48EDC4}.bat\"",00000000,00000000,00000001,08000000,00000000,00000000,00d5dc18,00d5dca8)
ret=0051c6ab
0039:fixme:advapi:CreateProcessAsUserW 0xdc L"C:\\windows\\system32\\cmd.exe"
L"/C \"C:\\users\\focht\\Temp\\{3CD9F337-4F1D-41C4-A1E4-86453C48EDC4}.bat\""
(nil) (nil) 1 0x08000000 (nil) (null) 0xd5dc18 0xd5dca8 - semi- stub
...
003b:Call KERNEL32.__wine_kernel_init() ret=7bc599ec
0039:Ret  advapi32.CreateProcessAsUserW() retval=00000001 ret=0051c6ab
0039:Call KERNEL32.OpenProcess(00100000,00000000,0000003a) ret=0051c6d9
0039:Ret  KERNEL32.OpenProcess() retval=000000e0 ret=0051c6d9
0039:Call KERNEL32.WaitForSingleObject(000000e0,ffffffff) ret=0051c6e8
...
003b:Starting process L"C:\\windows\\system32\\cmd.exe" (entryproc=0x7ed07208) 
...
003b:trace:cmd:wmain Full commandline 'L"/C
\"C:\\users\\focht\\Temp\\{3CD9F337-4F1D-41C4-A1E4-86453C48EDC4}.bat\""'
003b:trace:cmd:wmain Command line parm:
'L"\"C:\\users\\focht\\Temp\\{3CD9F337-4F1D-41C4-A1E4-86453C48EDC4}.bat\""' 
...
003b:trace:cmd:wmain Set L"=Z:" to L"Z:\\home\\focht\\Downloads" 
...
003b:Call KERNEL32.WriteFile(00000010,00129540,00000024,0033ab10,00000000)
ret=7ed0063d
Microsoft Windows 5.1.2600 (1.7.8)
...
003b:Call KERNEL32.WriteFile(00000010,00129540,0000001a,0033a4d0,00000000)
ret=7ed0063d

Z:\home\focht\Downloads>
...
--- snip ---

For whatever reason 'cmd' expects the first argument of the command line to be
the executable name.
With the executable name missing from 'argv[0]', '/C' is eaten (opt_c remains
FALSE) and batch execution never takes place -> hangs on console input.

Source:
http://source.winehq.org/git/wine.git/blob/dd0b719a3a1419f34774fc4cd921f3378d8c237b:/programs/cmd/wcmdmain.c#l2364

--- snip ---
2329 int wmain (int argc, WCHAR *argvW[])
2330 {
...
2364     cmdLine = GetCommandLineW();
2365     WINE_TRACE("Full commandline '%s'\n", wine_dbgstr_w(cmdLine));
2366     args = 1; /* start at first arg, skipping cmd.exe itself */
...
--- snip ---

$ sha1sum SotAInstaller.exe 
5163cd5d92cb6c8a50e5b8169ca428afdf2b76b7  SotAInstaller.exe

$du -sh SotAInstaller.exe 
12M    SotAInstaller.exe

$ wine --version
wine-1.7.8-220-g0bef543

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list