Showing changes from revision #1 to #2:
Added | Removed | Changed
This is a self-extracting code download. Simply download onto a RISC OS system, ensure the filetype is set to ‘Utility’ (&FFC) via the Filer menu and then double-click to run it. The contents will be decompressed into the same directory.
If you wish, you can run from the command line by simply running the file and optionally pass a destination directory as a parameter (to avoid decompressing into the same location as the self-extracting archive). E.g.
*Run $.archive/util $.MyStuff.Decompressed
CreateSEC is a tool for creating “self-extracting code”. The idea is that files, directories and applications can be compressed into a single file (an executable program) which when run will decompress itself without needing any extra programs to be available (such as dearchiving applications).
The CreateSEC tool requires !Routines 1.40 or later, which can be downloaded from http://www.7thsoftware.com/.
Simply double-click !CreateSEC and it will load onto the iconbar. Select-click the iconbar icon to open the main window. Drag the file, application or directory that you want to compress to the “Input” writable icon.
To specify the output file, you can either type the name into the “Output” writable icon, or you can drag a directory there and then add a suitable leafname. Do not just drag an output directory there because you risk it being replaced by the output file (if you specified “Force”)!
Clicking on “Run” will start the compression process.
If you select the “Verbose” option, the tool will output verbose status information about the compression operation.
If you select the “Force” option, the tool will delete any object found to match the name entered in “Output” before creating the output file with that name. This is intended to be used to force the replacement of a previously generated output file.
Some points to note:
Self-extracting code can be created as above, but using only the command line.This way is simpler in situations where you do not have a complete !System installed (because the GUI front end for CreateSEC requires some modules which you may not have access to). However, it still requires !Routines to have been ‘seen’ by the Filer.
*CreateSEC <input> <output>
*CreateSEC $.!MyApp $.MyApp/util
The simple way to decompress the self-extracting code file is to first ensure it has the correct filetype. It should be type “Utility” (&FFC). This can be checked and set from the Filer menu or command line.
Next, simply double-click the file to run it. An hourglass may appear as the decompression process is underway. When complete, the decompressed contents of the file will have been placed into the same directory as the file you ran.
You can also decompress these files from the command line simply by running them in the normal way. If you pass a directory as a parameter (the first and only parameter) to the file, it will decompress into that location rather than the same directory as itself.
The data appended onto the end of the self-extracting program is stored in the ROOL Squash data format (“rsqs”). This has been designed specifically to make it simple to both create and decompress these data structures, which are able to hold information about RISC OS files and directories.
one (header block, must be at start of data) zero or more of either: filename block followed by filedata block or: filename block followed by dirdata block HEADER BLOCK 0 "rsqs" 4 offset to next block (bytes from byte following this word) 8.. zero or more extension words (undefined bits should be zero) FILENAME BLOCK 0 "rnam" 4 offset to end of block (bytes from byte following this word) 8 file name (zero terminated, pad with zeros to word boundary) n.. zero or more extension words (undefined bits should be zero) FILEDATA BLOCK 0 "rdat" 4 offset to end of block (bytes from byte following this word) 8 load address 12 exec address 16 attributes 20 squashed data size (bytes) 24 uncompressed data size (bytes) 28.. data (pad with zeros to word boundary) DIRDATA BLOCK 0 "rdir" 4 offset to end of block (bytes from byte following this word) 8 attributes 12 zero or more extension words (undefined bits should be zero)
File format notes: