[Bug 37789] Batch files for 32-bit applications fail to run via 'cmd.exe /c' in 64-bit WINEPREFIX ('cmd.exe /c' misinterprets '(' and ')' characters in full script path name)

WineHQ Bugzilla wine-bugs at winehq.org
Tue Jan 21 13:49:50 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=37789

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://download.microsoft.c |https://web.archive.org/web
                   |om/download/golf99/Trial/1. |/20070106005217/http://down
                   |0/WIN98/EN-US/msgolf99.exe  |load.microsoft.com/download
                   |                            |/golf99/Trial/1.0/WIN98/EN-
                   |                            |US/msgolf99.exe

--- Comment #4 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

revisiting, still present.

Adding stable download link via Internet Archive:

https://web.archive.org/web/20070106005217/http://download.microsoft.com/download/golf99/Trial/1.0/WIN98/EN-US/msgolf99.exe

This also causes Quantum GIS Lisboa 1.8.x to not run post-install steps when
being installed in a 64-bit WINEPREFIX.

Stable link from Internet Archive:

https://web.archive.org/web/20120813121249/http://qgis.org/downloads/QGIS-OSGeo4W-1.8.0-1-Setup.exe

--- snip ---
$ WINEDEBUG=+seh,+relay,+msi,+cmd wine ./QGIS-OSGeo4W-1.8.0-1-Setup.exe
>>log.txt 2>&1
...
005d:Call KERNEL32.CreateProcessA(00000000,02c74a28
"\"C:\\windows\\system32\\cmd.exe\" /c \"C:\\Program Files (x86)\\Quantum GIS
Lisboa\\postinstall.bat\"",00000000,00000000,00000001,00000010,00000000,00000000,0209fc94,0209fcec)
ret=6e9417e6 
...
005d:Ret  KERNEL32.CreateProcessA() retval=00000001 ret=6e9417e6 
...
Full commandline 'L"\"C:\\windows\\system32\\cmd.exe\" /c \"C:\\Program Files
(x86)\\Quantum GIS Lisboa\\postinstall.bat\""' 
...
005f:trace:cmd:wmain Command line parm: 'L"\"C:\\windows\\system32\\cmd.exe\"
/c \"C:\\Program Files (x86)\\Quantum GIS Lisboa\\postinstall.bat\""' 
...
005f:trace:cmd:wmain Command line parm: 'L"/c \"C:\\Program Files
(x86)\\Quantum GIS Lisboa\\postinstall.bat\""' 
...
005f:trace:cmd:wmain /c command line: 'L"\"C:\\Program Files (x86)\\Quantum GIS
Lisboa\\postinstall.bat\""' 
...
005f:trace:cmd:wmain Set L"=C:" to L"C:\\Program Files (x86)\\Quantum GIS
Lisboa"
...
005f:trace:cmd:WCMD_ReadAndParseLine Found '(' conditions: curLen(17), inQ(0),
onlyWS(0), for(0, In:0, Do:0), if(0, else:0, lwe:0)
...
005f:trace:cmd:WCMD_DumpCommands Parsed line: 
...
005f:trace:cmd:WCMD_DumpCommands 00114640 0 00 00000000 L"C:\\Program Files
(x86)\\Quantum GIS Lisboa\\postinstall.bat" Redir:L""
...
005f:trace:cmd:WCMD_process_commands Executing command: 'L"C:\\Program Files
(x86)\\Quantum GIS Lisboa\\postinstall.bat"' 
...
005f:trace:cmd:WCMD_execute command on entry:L"C:\\Program Files (x86)\\Quantum
GIS Lisboa\\postinstall.bat" (0032B31C) 
...
005f:trace:cmd:WCMD_execute Command: 'L"C:\\Program Files (x86)\\Quantum GIS
Lisboa\\postinstall.bat"' 
...
005f:trace:cmd:WCMD_execute param1: L":\\Program", param2: L"Files"
...
005f:trace:cmd:WCMD_run_program Running 'L"C:\\Program Files (x86)\\Quantum GIS
Lisboa\\postinstall.bat"' (0)
...
005f:trace:cmd:WCMD_run_program Searching in 'L"C:\\"' for 'L"Program"' 
...
005f:Call KERNEL32.WideCharToMultiByte(000001b5,00000000,00114d98 L"Can't
recognize 'C:\\Program Files (x86)\\Quantum GIS Lisboa\\postinstall.bat' as an
internal or external command, or batch
script.\r\n",00000082,00bf1d00,0000ffff,0041bb7b,003226cc) ret=0040fe39
005f:Ret  KERNEL32.WideCharToMultiByte() retval=00000082 ret=0040fe39 
...
005f:Call msvcrt.exit(00002331) ret=004013eb 
--- snip ---

As seen from logs, the parsing is broken when the install path contains
parenthesis, such as "C:\\Program Files (x86)\\foobar". Everything else is just
follow-up errors.

You can work around by installing in 32-bit WINEPREFIX ('WINEARCH=win32' ->
"C:\\Program Files\\foobar"). You can inspect log files such as
'postinstall.bat.done' after install in app directory.

For testing the actual installation I found this:

https://gis.stackexchange.com/questions/30982/why-is-qgis-not-launching

--- snip ---
$ wine "c:\Program Files\Quantum GIS Lisboa\bin\nircmd.exe" exec hide
"c:\Program Files\Quantum GIS Lisboa\bin\qgis.bat"
--- snip ---

The app starts (splash screen is briefly shown) and then terminates which is
another cmd bug (for loop processing, bug 32449). Sadly there is still crapload
of cmd bugs after many years.

$ sha1sum QGIS-OSGeo4W-1.8.0-1-Setup.exe 
aec3e83a7d1a09a2e32dc3eeaddb639475b9f150  QGIS-OSGeo4W-1.8.0-1-Setup.exe

$ du -sh QGIS-OSGeo4W-1.8.0-1-Setup.exe 
128M    QGIS-OSGeo4W-1.8.0-1-Setup.exe

$ wine --version
wine-5.0-rc6

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