Universal DOOM – a single EXE for DOS 6, and Windows 95 to Windows 10
github.com
github.com
I played around with that here: https://github.com/sjmulder/netwake
It’s a simple utility but it works on Windows 3.11 (with Win32s) and up, but supporting high DPI, font scaling, and theming on Windows versions that support it.
I publish a universal msvcrt.lib that lets you use “standard C functions” without dependencies or static linking, but I’m quite sure it wouldn’t support Windows 3.x!
I'm worried that people won't heed this warning.
The universal lib is interesting for future work (the compiler inlined the few things I needed). For Win32s support generating a position-independent executable was the only problematic bit, but that's not an issue for libraries.
I never took it anywhere, but I think the way to go would be a "polyglot" script that could be interpreted by different script engines (sh/bat) that would then pick the correct executable for the given OS. This would require the user to change the file extension as well as download multiple executable files so I don't necessarily like this solution from an elegance stand point.
What that gives you is a stable entry point into python code. From there, you can run whatever platform specific code you want.
(I'm not aware of it, but maybe there a similar system in windows)
"Fat" CFM/PEF binaries existed on classic Mac OS, but used a completely different mechanism that only supported 68k and PowerPC code. And if you wanted to support a Classic II, that rules out a Carbon application bundle too.
About the widest range I can imagine for a single executable is a hybrid CFM/PEF/Carbon executable, which might be able to run on anything from a classic 68k mac up to Mac OS 10.6 (through Rosetta).
But if you can make that work, you can also add classic PowerPC support, by jumping to it via a 68K CODE stub and perhaps from a separate PEF fragment stored in a section in the Mach-O that would be ignored on current macOS.
Did the initial versions of osx recognize fat binaries or was that explicitly introduced later?
Windows 95 compatibility might be neat, but it's probably better if it used the SDL2-based Chocolate Doom 3.0.1.
[0] https://www.chocolate-doom.org/wiki/index.php/FAQ#Can_Chocol...
/s
From the intro...
> DOS and Windows .exe files both start with a common header (the DOS "MZ" header), which might suggest that you can run programs for one OS on the other one. However, this is complicated by a few facts: DOS support was dropped in Windows a long time ago (DOS binaries don't load on Windows 10, for example), and DOS programs use a completely different execution environment.
> This repo builds a single .exe file with a "polyglot" MZ header which allows it to load one program (the original DOOM) when running inside DOS, and a different program (a custom static build of Chocolate DOOM) when running on Windows.
tl;dr: Yes, it was originally by design, but very rarely used in practice (most use the default text you mentioned), and isn’t exactly straightforward in some tooling (but not hard either, as evidenced by the simple Python script here).
On the other hand, for some small-sized demos DOS stubs were completely discarded to make room. I recall many Farbrausch demos had a hard-coded "stub" that simply reads "farbrausch".
I'm assuming the Registry keys and the like are from the statically linked in libs.