Unicode installers crash when executed on WinME!
Ideally we should detect this and abort before the crash but things are not that simple. I initially thought we could just display a messagebox after detecting it early in WinMain:
if (sizeof(void*) < 8 && sizeof(TCHAR) > 1 && (INT32) g_WinVer < 0) goto die_UnicodeOnWin9x;
with a jump to my_MessageBox but this does not work 100% because my_MessageBox calls MessageBoxIndirectW and that is a nop. It does exit silently without a crash at least. I suspect that only the plain MessageBoxW function is actually implemented.
Another alternative is to link directly to something that is not exported on WinME:
#if defined(UNICODE) && !defined(_WIN64) if (!g_WinVer) ((castawayparams)(GetConsoleAlias))(); // Link directly to a function not exported on WinME to prevent crash! #endif
The problem with this is that GetConsoleAliasA/W might not exist in kernel32.lib in old SDKs/MinGW?
The crash is not a big deal, these old systems do not have fancy error reporting, it is just a plain error dialog that goes away after one click on a button...
If you don't need WinNT4 support you can add "PESubsysVer 5.0" to your script as a workaround.