Dave Holden introduces his self-extracting archive creator
MakeSFX is © APDL. All rights reserved. No part of this product may be reproduced in whole or part by any means without written permission of the publisher. Unauthorised hiring, renting, lending, public performance or broadcasting of this product or its parts is prohibited. MakeSFX is supplied under licence for use on one computer at a time. The user may copy the program for backup purposes only. This version of MakeSFX is supplied with RISC World and is Licensed for use only by RISCWorld subscribers.
While every care is taken, the publisher cannot be held responsible for any errors in either this product or documentation for this product, nor for the loss of any data or consequential effects from the use of this package.
This is a program I originally wrote for my own use. It will create a self-extracting archive from any (reasonable) number of files and/or directories. The output from the program is an archive in the form of an 'Absolute' file (type &FF8) which can be Run by simply double-clicking on it. The idea is to allow groups of files, directories, applications. etc. to be grouped into a self extracting archive which can be sent by email etc. and de-archived without the need for any other programs.
This version does not use any compression. This is because it was originally intended to be used to distribute files already compressed. However, as it's a single file it can easily be compressed with !Squash (which you can't really do with multiple files) and everyone has !Squash so they can decompress it before Running it. Alternatively you could compress the files first with !Squash, !SparkFS or !ArcFS and then put the squashed files in the archive.
It is ideal for web sites and others to distribute programs like the read only version of ArcFS, SparkPlug or other de-archiving programs so that users can de-arc the other programs they download. After all, how do you distribute the de-arc'ing tools without putting them in some sort of archive?
Note that both !MakeSFX and the archives it creates are 32 bit neutral.
Creating an SFX
Double-click on !MakeSFX to run it and then click SELECT on the icon. A window will open and you can drag either a file or a directory to this window.
So, the easiest way to make an archive is put everything you want to include into a directory and then drag that directory to the window. The archive will be created and a 'SaveAs' window will open for you to save the archive, which will be an 'Absolute Code' file. That's all there is to it.
Double-click on the archive application and a small window will open with a single Data icon in the middle. Drag that to wherever you want the files to go. They will be re-assembled with sub-directories, correct filetypes, etc. exactly as the original.
There are two possible problems. Firstly the whole archive has to be held in RAM when de-archiving. This can cause difficulties because not only must you obviously have enough RAM to hold the whole archive (not likely to be a problem), but if the archive is bigger than the 'Next' slot set set in the 'Tasks' window the program will just give a 'No writable memory at this address' error. You would think RISC OS would be bright enough to know that it needs to assign a big enough WimpSlot to actually load the program, but apparently it isn't. Now if this was a 'proper' application I could check or adjust the slot size, but I can't do anything because the error happens as the Wimp tries to load the program so there's nothing I can do. I can't even issue a message to tell the user what's happening, and I can't include any sort of !help or instructions file (although there are brief instructions at the start of the file that can be read if the user loads it into a text editor) because the whole point is to have everything in a single file.
So, if you intend to distribute a large(ish) archive you should warn the user that they must open the 'Tasks' window and make sure that the 'Next' allocation is at least as large as the size of the file.
The second problem is that the filetype might get lost or altered in transit. Again, there's nothing I can do about it, you will just have to tell users to set the filetype to &FF8 and then double-click on it.
At present you need enough RAM to hold all the files at once. This could be altered but I haven't bothered because as the de-archiver needs to have enough RAM to hold the entire archive it shouldn't be a problem for the person creating the archive.