As part of adding sfx support for my archive format, I made a standalone x64flt3/delta/plzma archiver.
Then I thought that it can be used to bundle multifile apps into a single exe file, just as well.
Loader stub unpacks app archive to a temp folder, then runs first executable there with current commandline.
Temp folder is deleted on exit.
exepack c32|c64|w32|w64 exe-file|directory output-exe-file
c32 = console 32-bit stub (19456 bytes)
c64 = console 64-bit stub (22016 bytes)
w32 = GUI 32-bit stub (won't create a console window for GUI app)
w64 = GUI 64-bit stub
exepack.exe w32 cmp.exe cmp1.exe -- pack a single GUI executable
exepack.exe c32 ..\7zdll_x32 pa32.exe -- pack a directory