[idd] install: keep captured output in one encoding

nsExec merges stdout and stderr into one pipe and detects its
encoding once. Emit UTF-16LE on both streams so error output cannot
reinterpret progress messages as CJK text.

Disable CRT buffering on both streams so progress is visible while
service and SetupAPI operations are running.
This commit is contained in:
Geoffrey McRae
2026-08-15 19:12:14 +10:00
parent 5d51567fd5
commit edeff3cce1

View File

@@ -1149,7 +1149,10 @@ failure:
int wmain(int argc, wchar_t **argv) int wmain(int argc, wchar_t **argv)
{ {
_setmode(_fileno(stdout), _O_U16TEXT);
_setmode(_fileno(stderr), _O_U16TEXT); _setmode(_fileno(stderr), _O_U16TEXT);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
if (argc < 2) if (argc < 2)
usage(argv[0]); usage(argv[0]);