Cc: Bcc: Subject: Re: xlviewer install cmdline passed from CreateProcessA to msiexec looks wrong Reply-To: In-Reply-To: 20071124025012.GA27234@compsoc.nuigalway.ie
After doing further debugging I've come to the conclusion that the behaviour found when I was looking at bug 9628 is indeed a bug and have logged a new one accordingly with as much detail as I thought was necessary. http://bugs.winehq.org/show_bug.cgi?id=10618
Basically it turns out that if a program is called via CreateProcessW, the command line used may not result in the same argv being passed to the target program as it was called directly.
In this case there was a difference in the argv seen by msiexec depending on whether it was run directly or called by the setup exe.
Traced the bug to a corner case in the function build_argv in dlls/kernel32/process.c.
Basically it does not detect the end of the argument correctly when dealing with the following text.
SETUPEXEPATH="C:\windows\temp\IXP030.TMP\"
Because of the escaped '', which should be valid since it is part of a directory path, at the end followed by the escaped '"', the function thinks that it has just encountered an escaped '"' instead of the end of the argument.
I'm not 100% sure how to solve this, so I will probably have to run some tests on windows using the CreateProcessW call and study the argv received by the target.
I have a feeling that the rule is probably something like:
If in quotes && text before slashes != whitespace && text after quote == whitespace: then found matching quote
Hopefully I should be able to come up with test cases that will show the truth of this, and then be able to confirm what the function build_argv should be testing to catch cases like this.