On Mon Feb 2 16:56:14 2026 +0000, eric pouech wrote:
retested carefully, and exit code is not propagated (sorry for the false hope) you should simplify a bit though with (untested in full) ```shell echo 'start /wait /b msiexec /p some.msi INSTALLDIR="C:\Path with spaces\data"' | wine cmd /k ``` (`cmd` doesn't propagate last errorlevel, while `cmd /k `does...) Sorry for the late answer... I found some interesting things for this issue. I'm not absolutely sure this is not intended, but I see that all proxy programs (including `cmd /k "..."` or `start "..."`) preserve the quotes, which leads to double-escaping. The entire msiexec parser is built around the case without quotes, it adds escaping itself. It treat args in `cmdline` as a string without quotes, and does not check whether the quotes are already in place.
I inserted a dump of the input arguments along the call chain and eventually reached `__wine_main()` in "dlls/ntdll/unix/loader.c" (characters `«…»` are also quotes in some languages): ``` for ( int i = 1; i < argc; i++ ) printf( "__wine_main: argv[%i] == «%s»\n", i, main_argv[ i ] ); ``` I made dumps of `msiexec.exe` output when called via several methods with the same parameters. Note the quotes in "\_\_wine_main() argv[5] ==" in logs below. Similar output with "unbalanced quotes" in: - Shell input like `wine msiexec "/i" "Z:\\tmp\\winehq-57024_my_property.msi" "/qn" 'MY_PROPERTY="C:\\Program Files\\MyApp"'` - `echo 'msiexec' | wine cmd /k` - `echo 'start /wait msiexec' | wine cmd /k` - `cmd /k "msiexec"` in \*.bat file - `start /wait "msiexec"` in \*.bat file: ``` __wine_main() argv[0] == «/tmp/winehq-build/loader/wine» __wine_main() argv[1] == «C:\windows\system32\msiexec.exe» __wine_main() argv[2] == «/i» __wine_main() argv[3] == «Z:\tmp\winehq-57024_my_property.msi» __wine_main() argv[4] == «/qn» __wine_main() argv[5] == «MY_PROPERTY="C:\\Program Files\\MyApp"» fixme:msiexec:process_args cmdline == L"\"C:\\windows\\system32\\msiexec.exe\" /i Z:\\tmp\\winehq-57024_my_property.msi /qn \"MY_PROPERTY=\\\"C:\\\\Program Files\\\\MyApp\\\"\"" trace:msiexec:WinMain argvW[1] = L"/i" trace:msiexec:WinMain argvW[2] = L"Z:\\tmp\\winehq-57024_my_property.msi" trace:msiexec:WinMain argvW[3] = L"/qn" trace:msiexec:WinMain argvW[4] = L"\"MY_PROPERTY=\\\"" trace:msiexec:WinMain argvW[5] = L"C:\\\\Program" trace:msiexec:WinMain argvW[6] = L"Files\\\\MyApp\\\"\"" trace:msiexec:build_properties properties -> L" \"MY_PROPERTY=\\\"" warn:msi:msi_parse_command_line unbalanced quotes ``` But the log differs when calling: - `msiexec` via `execvp()` (and similar WinAPI functions? Checked with [generaltest_execvp-user-defined-prop.c](/uploads/e871021d437a8c04fc4a91f866f91661/generaltest_execvp-user-defined-prop.c), see below) - `msiexec` from \*.bat file directly: ``` __wine_main() argv[0] == «/tmp/winehq-build/loader/wine» __wine_main() argv[1] == «msiexec» __wine_main() argv[2] == «/i» __wine_main() argv[3] == «Z:\tmp\winehq-57024_my_property.msi» __wine_main() argv[4] == «/qn» __wine_main() argv[5] == «MY_PROPERTY=C:\Program Files\MyApp» fixme:msiexec:process_args cmdline == L"msiexec /i Z:\\tmp\\winehq-57024_my_property.msi /qn MY_PROPERTY=\"C:\\Program Files\\MyApp\"" trace:msiexec:WinMain argvW[1] = L"/i" trace:msiexec:WinMain argvW[2] = L"Z:\\tmp\\winehq-57024_my_property.msi" trace:msiexec:WinMain argvW[3] = L"/qn" trace:msiexec:WinMain argvW[4] = L"MY_PROPERTY=\"C:\\Program Files\\MyApp\"" trace:msiexec:build_properties properties -> L" MY_PROPERTY=\"C:\\Program Files\\MyApp\"" ``` So the first difference is in the `__wine_main()` 5th arg: ``` Shell and proxy programs : __wine_main() argv[5] == «MY_PROPERTY="C:\\Program Files\\MyApp"» execvp() or *.bat direct call: __wine_main() argv[5] == «MY_PROPERTY=C:\Program Files\MyApp» ``` <br> <br> Program with `execvp()`: [generaltest_execvp-user-defined-prop.c](/uploads/e871021d437a8c04fc4a91f866f91661/generaltest_execvp-user-defined-prop.c). On Windows I compile it via Cygwin without any special flags: ``` x86_64-w64-mingw32-gcc.exe generaltest_execvp-user-defined-prop.c -o generaltest_execvp.exe -Wall -Wextra -Wpedantic ``` "winehq-57024_my_property.msi" can be found in [bug 57024, comment 1](https://bugs.winehq.org/show_bug.cgi?id=57024#c1). The program has extra output of its own input arguments. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9943#note_129997