.sh and .bat should self-extract an executable stub for the supported platforms #15
Labels
No Label
bug
duplicate
enhancement
good first issue
help wanted
invalid
new-platform
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: suzanne.soy/os-test-framework#15
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
printf
(which is I think part of the POSIX standard) should make it relatively easy to produce a binary stub.For MS-DOS, things are not that easy since not all characters can be printed to a file. The following post lists some possibilities (using
debug
, which is not present on all systems, producing a VBScript, usingecho
(can't handle all characters),set /p
(/p
option not present on older systems) or other built-in commands). I think the best solution would be to useecho
to create a very small binary stub (a.COM
and/or.EXE
) which is capable of sending to STDOUT or to a file the rest of the binary data, based on a (e.g.) base64 output. The extraction would then proceed in three stages:.COM
or.EXE
stub, passing it some base64 (or other base) data, that it writes to a second.COM
or.EXE
file.COM
or.EXE
file, which reads back from the originalos.bat
to produce the finalresult.exe
(and delete all intermediate files subsequently)https://www.experts-exchange.com/questions/26372121/DOS-Batch-file-to-write-Binary.html
There might be a solution using a fixed header that can be printed by MS-DOS
echo
, followed by binary data that matches the entireos.bat
file. The extraction would then consist in printing a tiny header, and usingcopy header.txt+os.bat result.exe
to concatenate them.