https://bugs.winehq.org/show_bug.cgi?id=37789
Bug ID: 37789 Summary: cmd.exe /c cannot handle "(" and ")" characters in a full script path name Product: Wine Version: 1.7.33 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: abolte@systemsaviour.com Distribution: ---
Created attachment 50334 --> https://bugs.winehq.org/attachment.cgi?id=50334 Various cmd executions discussed in the report using WINEDEBUG='+cmd'.
Far Cry 4 (which requires at least a 64-bit Windows 7 prefix) fails to call a bash script on launch:
Can't recognise 'C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\GEFirewall.bat /silent' as an internal or external command, or batch script.
Sure enough, calling it manually (even without the /silent argument) results in the same error: $ wine cmd.exe /c 'C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\GEFirewall.bat' Can't recognise 'C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\GEFirewall.bat' as an internal or external command, or batch script.
Suspicious of the ( and ) characters in the URL, I tried copying the GEFirewall.bat to the path 'C:\Program Files\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software' (which doesn't normally exist but I manually created it).
$ wine cmd.exe /c 'C:\Program Files\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\GEFirewall.bat' fixme:netsh:wmain stub: L"netsh" L"firewall" L"add" L"allowedprogram" L"C:\Program Files\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\..\..\bin\FarCry4.exe" L"FarCry4" L"ENABLE" fixme:netsh:wmain stub: L"netsh" L"firewall" L"add" L"allowedprogram" L"C:\Program Files\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software\..\..\bin\IGE_WPF64.exe" L"FarCry4-IGE" L"ENABLE"
The script ran perfectly.
One more test to confirm my sanity:
$ wine explorer.exe 'C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Far Cry 4\Support\Software'
This opened the directory in explorer fine. Only cmd.exe /c ... seems to show this issue.
https://bugs.winehq.org/show_bug.cgi?id=37789
Adam Bolte abolte@systemsaviour.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |abolte@systemsaviour.com
https://bugs.winehq.org/show_bug.cgi?id=37789
--- Comment #1 from Adam Bolte abolte@systemsaviour.com --- This issue still exists in 1.7.53.
https://bugs.winehq.org/show_bug.cgi?id=37789
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|UNCONFIRMED |NEW URL| |http://download.microsoft.c | |om/download/golf99/Trial/1. | |0/WIN98/EN-US/msgolf99.exe CC| |focht@gmx.net Summary|cmd.exe /c cannot handle |Batch files for 32-bit |"(" and ")" characters in a |applications fail to run |full script path name |via 'cmd.exe /c' in 64-bit | |WINEPREFIX ('cmd.exe /c' | |misinterprets '(' and ')' | |characters in full script | |path name) Ever confirmed|0 |1
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming, still present.
I came to this when investigating https://bugs.winehq.org/show_bug.cgi?id=1201#c36
--- snip --- $ WINEDEBUG=+tid,+seh,+relay,+cmd wine start Golf\ '99\ Trial.lnk >>log2.txt 2>&1 ... 002b:trace:cmd:wmain Full commandline 'L"C:\windows\system32\cmd.exe /c "C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat""' 002b:trace:cmd:wmain Command line parm: 'L"C:\windows\system32\cmd.exe /c "C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat""' 002b:trace:cmd:wmain Command line parm: 'L"/c "C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:wmain /c command line: 'L""C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:wmain Set L"=C:" to L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial" ... 002b:trace:cmd:WCMD_ReadAndParseLine Found '(' conditions: curLen(17), inQ(0), onlyWS(0), for(0, In:0, Do:0), if(0, else:0, lwe:0) ... 002b:trace:cmd:WCMD_DumpCommands Parsed line: 002b:trace:cmd:WCMD_DumpCommands 0x132cc0 0 00 (nil) L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat" Redir:L"" 002b:trace:cmd:WCMD_process_commands Executing command: 'L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat"' ... 002b:trace:cmd:WCMD_execute command on entry:L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat" (0x33b3d0) ... 002b:trace:cmd:WCMD_execute Command: 'L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat"' ... 002b:trace:cmd:WCMD_execute param1: L":\Program", param2: L"Files" 002b:trace:cmd:WCMD_run_program Running 'L"C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat"' (0) ... 002b:Call KERNEL32.FindFirstFileW(00332748 L"C:\\Program.*",00332950) ret=7ecc05e7 002b:Ret KERNEL32.FindFirstFileW() retval=ffffffff ret=7ecc05e7 002b:Call KERNEL32.FindClose(ffffffff) ret=7ecc05f8 ... 002b:Call KERNEL32.WideCharToMultiByte(000001b5,00000000,0013b438 L"Can't recognize 'C:\Program Files (x86)\Microsoft Games\Golf '99 Trial\ccsolo.bat' as an internal or external command, or batch script.\r\n",00000089,0013b558,0000ffff,7ecc6888,0033267c) ret=7ecbe338 002b:Ret KERNEL32.WideCharToMultiByte() retval=00000089 ret=7ecbe338 --- snip ---
vs.
--- snip --- 002b:trace:cmd:wmain Full commandline 'L"C:\windows\system32\cmd.exe /c "C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' 002b:trace:cmd:wmain Command line parm: 'L"C:\windows\system32\cmd.exe /c "C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' 002b:trace:cmd:wmain Command line parm: 'L"/c "C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:wmain /c command line: 'L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:wmain First parameter is 'L"C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat"' ... 002b:trace:cmd:wmain Full path name 'L"C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat"' ... 002b:trace:cmd:wmain Found file as 'L"C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat"' ... 002b:trace:cmd:wmain Set L"=C:" to L"C:\Program Files\Microsoft Games\Golf '99 Trial" ... 002b:trace:cmd:WCMD_DumpCommands Parsed line: 002b:trace:cmd:WCMD_DumpCommands 0x132bd0 0 00 (nil) L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat"" Redir:L"" 002b:trace:cmd:WCMD_process_commands Executing command: 'L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:WCMD_execute command on entry:L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat"" (0x33b3d0) ... 002b:trace:cmd:WCMD_execute Command: 'L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' ... 002b:trace:cmd:WCMD_execute param1: L"C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat", param2: L"" 002b:trace:cmd:WCMD_run_program Running 'L""C:\Program Files\Microsoft Games\Golf '99 Trial\ccsolo.bat""' (0) ... 002b:trace:cmd:WCMD_run_program Searching in 'L"C:\Program Files\Microsoft Games\Golf '99 Trial\"' for 'L"ccsolo.bat"' ... 002b:trace:cmd:WCMD_run_program Found as L"C:\Program Files\Microsoft Games\Golf '99 Trial\\ccsolo.bat" 002b:Call KERNEL32.CreateFileW(00332748 L"C:\Program Files\Microsoft Games\Golf '99 Trial\\ccsolo.bat",80000000,00000007,00000000,00000003,00000080,00000000) ret=7eca0ea8 002b:Ret KERNEL32.CreateFileW() retval=00000034 ret=7eca0ea8 ... --- snip ---
Refining the summary to reflect this.
Also adding link to an example 32-bit app which uses batch files for startup.
--- snip --- -=[ ProtectionID v0.6.6.7 DECEMBER]=- (c) 2003-2015 CDKiLLER & TippeX Build 24/12/14-22:48:13 Ready... Scanning -> Z:\home\focht\Downloads\msgolf99.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 25236744 (01811508h) Byte(s) Compilation TimeStamp : 0x3647B542 -> Tue 10th Nov 1998 03:38:42 (GMT) [TimeStamp] 0x3647B542 -> Tue 10th Nov 1998 03:38:42 (GMT) | PE Header | - | Offset: 0x000000F8 | VA: 0x004000F8 | - [TimeStamp] 0x3647B542 -> Tue 10th Nov 1998 03:38:42 (GMT) | Export | - | Offset: 0x00034584 | VA: 0x00434584 | - -> File Appears to be Digitally Signed @ Offset 01810000h, size : 01508h / 05384 byte(s) [File Heuristics] -> Flag #1 : 00000000000000000000000100000100 (0x00000104) [Entrypoint Section Entropy] : 6.37 (section #0) ".text " | Size : 0x307B6 (198582) byte(s) [DllCharacteristics] -> Flag : (0x0000) -> NONE [SectionCount] 4 (0x4) | ImageSize 0x1817000 (25260032) byte(s) [Export] 100% of function(s) (2 of 2) are in file | 0 are forwarded | 2 code | 0 data | 0 uninit data | 0 unknown | [VersionInfo] Company Name : Microsoft Corp. [VersionInfo] Product Name : setup [VersionInfo] Product Version : 1. 0. 0. 1 [VersionInfo] File Description : setup [VersionInfo] File Version : 1. 0. 0. 1 [VersionInfo] Original FileName : setup.exe [VersionInfo] Internal Name : setup [VersionInfo] Version Comments : Setup for Microsoft Golf '99 Trial [VersionInfo] Legal Copyrights : Copyright © 1997 [CompilerDetect] -> Visual C++ 6.0 [!] File appears to have no protection or is using an unknown protection - Scan Took : 4.974 Second(s) [000000FBAh (4026) tick(s)] [499 of 573 scan(s) done]
Scanning -> C:\Program Files\Microsoft Games\Golf '99 Trial\Golfdemo.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 1208320 (0127000h) Byte(s) Compilation TimeStamp : 0x3647AA9E -> Tue 10th Nov 1998 02:53:18 (GMT) [TimeStamp] 0x3647AA9E -> Tue 10th Nov 1998 02:53:18 (GMT) | PE Header | - | Offset: 0x000000E8 | VA: 0x004000E8 | - [File Heuristics] -> Flag #1 : 00000000000000000000000000000000 (0x00000000) [Entrypoint Section Entropy] : 6.58 (section #0) ".text " | Size : 0x3A3E (14910) byte(s) [DllCharacteristics] -> Flag : (0x0000) -> NONE [SectionCount] 4 (0x4) | ImageSize 0x127000 (1208320) byte(s) [VersionInfo] Company Name : Microsoft Corporation [VersionInfo] Product Name : Microsoft(R) Windows NT(R) Operating System [VersionInfo] Product Version : 5.00.1636.1 [VersionInfo] File Description : Golf Demo EXE [VersionInfo] File Version : 5.00.1636.1 [VersionInfo] Original FileName : golfdemo.exe [VersionInfo] Internal Name : golfdemo.exe [VersionInfo] Version Comments : LCompanyName [VersionInfo] Legal Trademarks : B OriginalFilename [VersionInfo] Legal Copyrights : Copyright (C) Microsoft Corp. 1998 [CompilerDetect] -> Visual C++ 6.0 [!] File appears to have no protection or is using an unknown protection - Scan Took : 0.353 Second(s) [000000161h (353) tick(s)] [499 of 573 scan(s) done] --- snip ---
$ sha1sum msgolf99.exe be45600f58ba08e4fc84cf113b4905f09a821a2a msgolf99.exe
$ du -sh msgolf99.exe 25M msgolf99.exe
$ wine --version wine-1.8-rc4
Regards
https://bugs.winehq.org/show_bug.cgi?id=37789
--- Comment #3 from Adam Bolte abolte@systemsaviour.com --- Still exists as of Wine 1.9.4.
https://bugs.winehq.org/show_bug.cgi?id=37789
Anastasius Focht focht@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@gmx.net --- Hello folks,
revisiting, still present.
Adding stable download link via Internet Archive:
https://web.archive.org/web/20070106005217/http://download.microsoft.com/dow...
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-OS...
--- 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