http://bugs.winehq.org/show_bug.cgi?id=10618
Summary: dll/kernel32/process.c build_argv returns incorrect argv array for a given command line string Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: wine-kernel AssignedTo: wine-bugs@winehq.org ReportedBy: felix@compsoc.nuigalway.ie
Created an attachment (id=9421) --> (http://bugs.winehq.org/attachment.cgi?id=9421) Additional traces to allow bug to be seen
When building the argv array to send to a new process started by another within wine, the function build_argv in dlls/kernel32/process.c fails to return an array argv correctly.
In the case of msiexec being the target program, this has necessitated a custom command line parse that reconstructs the the correct argv.
Application that highlights this behaviour is the Excel Viewer installer.
The problem was discovered when examining bug 9628 to see why a patch to use the standard command line parser call was reverted in favour of a custom parser internal to msiexec.
You will need to apply the attached patch to be able to see the broken behaviour, it basically adds some additional traces and also increases the debug buffer so that the full command line can be seen when using the debug functions to print.
Steps to reproduce: 1. Apply patch, rebuild wine, and install as necessary. adds TRACES that allow you to see the contents of argv 2. Download the Microsoft Excel Viewer 2003 installer from Microsoft 3. Run the installer with the following environment variable set on the command line "WINEDEBUG=+msiexec,+process" 4. Check for the lines outputting "trace:process:build_argv cmdlineW = ..." command line being sent to new process "trace:process:build_argv resulting argv[]" + a number of lines following outputting the contents of the constructed argv array. "trace:msiexec:main argv[0]..." and a number of lines following.
5. Exit installation dialogs by cancelling 6. Run installation of msi directly by using the command line printed out by the first trace described in step 4. 7. You should see the difference between what is outputted by the trace displaying "trace:msiexec:main argv[0]..." in step 4 and step 6. The argv seen by msiexec in running step 3 should appear exactly the same as step 6.
Results Observed:
Command line run using built area: WINEPREFIX=/tmp/winebug9628/ WINEDEBUG=+msiexec,+process ./wine ~/tmp/xlviewer.exe
output from step 4: 1. "trace:process:build_argv cmdlineW = ..."
trace:process:build_argv cmdlineW = L""c:\windows\system32\msiexec.exe" /I C:\windows\temp\IXP030.TMP\XLVIEW.MSI CDCACHE="2" LAUNCHEDFROMSETUP="1" SETUPEXEPATH="C:\windows\temp\IXP030.TMP\" SETUPEXENAME="SETUP.EXE" /lpiwaeo "C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054)_Task(0001).txt" CDCACHE="0" DWSETUPLOGFILE="C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054).txt" DWMSILOGFILE="C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054)_Task(0001).txt""
2. "trace:process:build_argv resulting argv[]" + following lines
trace:process:build_argv resulting argv[] trace:process:build_argv argv[1] = "c:\windows\system32\msiexec.exe" trace:process:build_argv argv[2] = "/I" trace:process:build_argv argv[3] = "C:\windows\temp\IXP030.TMP\XLVIEW.MSI" trace:process:build_argv argv[4] = "CDCACHE=2" trace:process:build_argv argv[5] = "LAUNCHEDFROMSETUP=1" trace:process:build_argv argv[6] = "SETUPEXEPATH=C:\windows\temp\IXP030.TMP" SETUPEXENAME=SETUP.EXE /lpiwaeo C:\windows\temp\Microsoft" trace:process:build_argv argv[7] = "Office" trace:process:build_argv argv[8] = "Excel" trace:process:build_argv argv[9] = "Viewer" trace:process:build_argv argv[10] = "2003" trace:process:build_argv argv[11] = "Setup(0054)_Task(0001).txt CDCACHE=0 DWSETUPLOGFILE=C:\windows\temp\Microsoft" trace:process:build_argv argv[12] = "Office" trace:process:build_argv argv[13] = "Excel" trace:process:build_argv argv[14] = "Viewer" trace:process:build_argv argv[15] = "2003" trace:process:build_argv argv[16] = "Setup(0054).txt DWMSILOGFILE=C:\windows\temp\Microsoft" trace:process:build_argv argv[17] = "Office" trace:process:build_argv argv[18] = "Excel" trace:process:build_argv argv[19] = "Viewer" trace:process:build_argv argv[20] = "2003" trace:process:build_argv argv[21] = "Setup(0054)_Task(0001).txt"
3. "trace:msiexec:main argv[0]..." and following lines trace:msiexec:main argv[0] = "c:\windows\system32\msiexec.exe" trace:msiexec:main argv[1] = "/I" trace:msiexec:main argv[2] = "C:\windows\temp\IXP030.TMP\XLVIEW.MSI" trace:msiexec:main argv[3] = "CDCACHE=2" trace:msiexec:main argv[4] = "LAUNCHEDFROMSETUP=1" trace:msiexec:main argv[5] = "SETUPEXEPATH=C:\windows\temp\IXP030.TMP" SETUPEXENAME=SETUP.EXE /lpiwaeo C:\windows\temp\Microsoft" trace:msiexec:main argv[6] = "Office" trace:msiexec:main argv[7] = "Excel" trace:msiexec:main argv[8] = "Viewer" trace:msiexec:main argv[9] = "2003" trace:msiexec:main argv[10] = "Setup(0054)_Task(0001).txt CDCACHE=0 DWSETUPLOGFILE=C:\windows\temp\Microsoft" trace:msiexec:main argv[11] = "Office" trace:msiexec:main argv[12] = "Excel" trace:msiexec:main argv[13] = "Viewer" trace:msiexec:main argv[14] = "2003" trace:msiexec:main argv[15] = "Setup(0054).txt DWMSILOGFILE=C:\windows\temp\Microsoft" trace:msiexec:main argv[16] = "Office" trace:msiexec:main argv[17] = "Excel" trace:msiexec:main argv[18] = "Viewer" trace:msiexec:main argv[19] = "2003" trace:msiexec:main argv[20] = "Setup(0054)_Task(0001).txt"
Output from step 6 in running the following command line in the built area: WINEPREFIX=/tmp/winebug9628/ WINEDEBUG=+msiexec,+process ./programs/msiexec/msiexec /I C:\windows\temp\IXP030.TMP\XLVIEW.MSI CDCACHE="2" LAUNCHEDFROMSETUP="1" SETUPEXEPATH="C:\windows\temp\IXP030.TMP\" SETUPEXENAME="SETUP.EXE" /lpiwaeo "C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054)_Task(0001).txt" CDCACHE="0" DWSETUPLOGFILE="C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054).txt" DWMSILOGFILE="C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054)_Task(0001).txt"
Note the only change from the line outputted by the traces were all '"' converted to '"' and using the msiexec in the locally built area.
1. "trace:msiexec:main argv[0]..." and following lines trace:msiexec:main argv[0] = "./programs/msiexec/msiexec.exe.so" trace:msiexec:main argv[1] = "/I" trace:msiexec:main argv[2] = "C:\windows\temp\IXP030.TMP\XLVIEW.MSI" trace:msiexec:main argv[3] = "CDCACHE=2" trace:msiexec:main argv[4] = "LAUNCHEDFROMSETUP=1" trace:msiexec:main argv[5] = "SETUPEXEPATH=C:\windows\temp\IXP030.TMP" trace:msiexec:main argv[6] = "SETUPEXENAME=SETUP.EXE" trace:msiexec:main argv[7] = "/lpiwaeo" trace:msiexec:main argv[8] = "C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054)_Task(0001).txt" trace:msiexec:main argv[9] = "CDCACHE=0" trace:msiexec:main argv[10] = "DWSETUPLOGFILE=C:\windows\temp\Microsoft Office Excel Viewer 2003 Setup(0054).txt"
Which is not the same as previously got when msiexec was called by the setup exe.