A few overlapping script fixes

See individual commits for details
- highlights are fixes for #876 and #887 as well as support for packing .exe files
Why not share `GetScriptVariable()`?  The additional variables aren't exposed in `prebuild` or `postbuild` because the corresponding fields are reset to `null` at the correct points.