This is an oldie but goody… the gist is that even latest Windows 10 still ships with working IExpress.exe which is a self extracting exe builder! Who knew.
In my case, very handy for bundling a batch file and it’s dependencies into a single exe for a buddy.
For the record, I started out with 7zip’s SFX facility and eventually got it working but it’s a bit more clunky… besides the steps required to build an auto launch exe, you’ll get a mildly undesirable “Program Compatibility Assistant” “This program might not have installed correctly” warning… the IExpress generated exe doesn’t seem to have this issue.
Launching IExpress.exe without any args will present the wizard which will walk you through building a “SED” config file with several commonly desired “setup.exe” options like user confirmation prompt, etc… importantly, this includes specifying a batch file you wish to be launched after extract.
Handy batch for recreating exe whenever you update your script:
- The program to be launched can indeed be a .BAT/.CMD
- The IExpress SED wizard will hard code paths, just edit afterwards and remove to be relative. It works.
- This would of course work for PowerShell or any other script that can be launched via its runner, either bundled in the EXE or native, e.g. ScriptCS