https://bugs.winehq.org/show_bug.cgi?id=57024
Bug ID: 57024 Summary: msiexec parses quotes in public properties differently from Windows Product: Wine Version: 9.14 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msi Assignee: wine-bugs@winehq.org Reporter: asger@tyilo.com Distribution: ---
Created attachment 76873 --> https://bugs.winehq.org/attachment.cgi?id=76873 test.c
When installing an msi package using msiexec on Windows the following invocation (using cmd) will result in `MY_PROPERTY` being set to `foo"bar`:
``` msiexec /i my_property.msi /qn MY_PROPERTY="foo""bar" ```
When running it through wine the property is set to `foobar` (without the double quote).
To test this I have created a test msi, called `my_property.msi`, that when installed will create the file `my_property.txt` next to `my_property.msi` with the contents of the `MY_PROPERTY` property. (After that the installation will fail.)
Furthermore, to ensure that this is not due to shell handling of the arguments, I have created a c program which invokes msiexec (attached as test.c).
Compiling this test program and running it on Windows results in: ``` C:\test>a.exe C:\test\my_property.msi
C:\test>type my_property.txt foo"bar ```
Doing the same on Linux results in: ``` /tmp/test $ rm -rf ~/.wine /tmp/test $ export WINEARCH=win64 /tmp/test $ winecfg /v win10 /tmp/test $ wine a.exe Z:\tmp\test\my_property.msi /tmp/test $ cat my_property.txt foobar ```
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #1 from asger@tyilo.com --- Created attachment 76874 --> https://bugs.winehq.org/attachment.cgi?id=76874 my_property.msi
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #2 from Hans Leidekker hans@meelstraat.net --- The problem is that msiexec removes all quotes from the command line before passing to msi. It should remove quotes from the package name but not from properties.
https://bugs.winehq.org/show_bug.cgi?id=57024
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |14b718b69bb8d62c3ae84c52d42 | |10e81c1d21208 Resolution|--- |FIXED
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- Fixed with 14b718b69bb8d62c3ae84c52d4210e81c1d21208. Thanks for the bug report.
https://bugs.winehq.org/show_bug.cgi?id=57024
asger@tyilo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|FIXED |---
--- Comment #4 from asger@tyilo.com --- (In reply to Hans Leidekker from comment #3)
Fixed with 14b718b69bb8d62c3ae84c52d4210e81c1d21208. Thanks for the bug report.
You seem to have fixed some cases.
However these cases still fails for me with `wine-9.16-105-g055bddab4f1` (C source code): ``` execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY="foo bar"", NULL); Got `"foo bar"`, should be `foo bar`
execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=""""", NULL); Got ``, should be `"`
execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=""""""", NULL); Got ``, should be `""`
execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY="{""foo"": [1, 2], ""bar"": {""baz"": ""qux""}}"", NULL); No file created, should be `{"foo": [1, 2], "bar": {"baz": "qux"}}` ```
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #5 from Hans Leidekker hans@meelstraat.net --- (In reply to asger from comment #4)
(In reply to Hans Leidekker from comment #3)
Fixed with 14b718b69bb8d62c3ae84c52d4210e81c1d21208. Thanks for the bug report.
You seem to have fixed some cases.
However these cases still fails for me with `wine-9.16-105-g055bddab4f1` (C source code):
execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=\"foo bar\"", NULL); Got `"foo bar"`, should be `foo bar` execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=\"\"\"\"", NULL); Got ``, should be `"` execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=\"\"\"\"\"\"", NULL); Got ``, should be `""` execlp("msiexec", "msiexec", "/i", msi_path, "/qn", "MY_PROPERTY=\"{\"\"foo\"\": [1, 2], \"\"bar\"\": {\"\"baz\"\": \"\"qux\"\"}}\"", NULL); No file created, should be `{"foo": [1, 2], "bar": {"baz": "qux"}}`
Well, there's more than one bug here. The next one is that msiexec adds quotes even when the value is already quoted.
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- Created attachment 77049 --> https://bugs.winehq.org/attachment.cgi?id=77049 patch
This patch fixes the first of your new cases. I checked that for the next two cases msiexec passes the correct command line to msi, so that would be yet another bug but in msi this time.
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #7 from Hans Leidekker hans@meelstraat.net --- The last case is also fixed by this patch.
https://bugs.winehq.org/show_bug.cgi?id=57024
--- Comment #8 from Hans Leidekker hans@meelstraat.net --- Commit 9e6740876dbb6c4053be8b5e33b9db42a63ff6c0 fixes the first and last case you provided. I'm leaving the other two for another day.