Hello again, dear readers. Not so long ago I told you about and today we will return to this topic again. This time we will talk about multi-volume and SFX archives.

I'll start with the SFX archives. So what is it?

The abbreviation SFX comes from the English name self-extracting archive and is nothing more than a self-extracting archive that can be unpacked without the help of an archiver.

Unlike regular archives, a self-extracting (or, if you prefer, self-extracting) archive has an EXE extension, which means it is a regular executable file. You just need to run it and specify the unpacking path. The procedure for extracting data from the archive will be performed automatically.

I will teach you how to create SFX archives using 7-Zip and WinRAR archivers. The first is interesting to us because it is distributed completely freely (I remind you that I try to use tools in my descriptions that do not require additional costs from users), while the second has an advantage when it comes to multi-volume self-extracting archives, but more on that later.

A multi-volume archive is an archive consisting of several parts called volumes. Multi-volume archives are used in cases where the volume of packed data is too large and the use of a regular archive becomes unacceptable for some reason.

For example, not so long ago, multi-volume archives were actively used when it was necessary to cram large amounts of data onto 3.5-inch floppy disks. Despite the fact that today these media are almost never used anywhere, modern archivers that provide for splitting the archive into volumes have a volume of 1,457,664 bytes among the splitting options. This is exactly the volume of these floppy disks.

Also, the use of multi-volume archives is very convenient for transmitting large amounts of information by e-mail.

Some developers software place their applications for download in the form of multi-volume archives. For example, along with the entire installation file, the popular accounting program “Legal Taxpayer” is available for download in this form. This approach is convenient when the Internet channel is unstable. After all, in the event of a connection failure, it is more convenient to re-download a couple of relatively small volumes than to re-download a large installation file.

However, there are tools that allow you to continue downloading files if the connection is lost, but we’ll talk about them some other time.

Multi-volume archives can be successfully used simply for cutting large file. As I mentioned in the article, some files have high degree compression and archiving do not significantly reduce their volume. But nothing prevents us from dividing such a file into parts.

Using the example of one of these files, I will tell you how to create multi-volume and SFX archives.

As a sample, I took a disk image in ISO format, which, although it has a high compression ratio, nevertheless takes up quite a lot of space. Namely 654636 kilobytes. I'm intentionally listing the size in kilobytes because that's how it appears in Windows Explorer.

First, let's look at creating the types of archives that interest us using the free 7-Zip archiver. As I did earlier, you can work with archives from the archiver interface or using the contextual Windows menu. I will focus on the second option, since, in my opinion, it is the simplest for a novice user.

So, let's click right click mouse on the file that we want to place in the archive, after which in the context menu that appears, select the 7-Zip item and in the function menu that opens, perform the “Add to archive” action.

From those available in 7-Zip for creating formats archive files Anything can be divided into parts. As for self-extracting archives, here we are only interested in 7z format archives, so I will focus on this format.

Take a look at the archive creation options window.

As you can see, at the bottom left there is a line “Split into volumes”. Here you can set the sizes of parts of a multi-volume archive manually or select one of the existing options.

At the top right you see the “Create SFX archive” option. To make the archive self-extracting, just check this option.

Unfortunately, the capabilities of the 7z format are limited, so it can either be multi-volume or self-extracting. If you choose to create an SFX archive, the split option will immediately become inactive. Of the two possible options I'll choose a self-extracting archive for now. Check the box, click OK and wait for the procedure to complete.

Take a look at the result.

As you can see, an executable file has appeared next to the image file. This is the finished SFX archive.

But what if we definitely want to get a multi-volume self-extracting archive?

The RAR format is ideal for this purpose and can be obtained using the WinRAR application.

The procedure for creating such an archive is very similar to what we just discussed. In the same way we right-click on the required file and select the option to add to archive.

This is what the archive creation window looks like.

Agree, it is very similar to the 7-Zip interface. The volume size is selected or entered by hand in the same way. There is also an option to create an SFX archive.

, a computer program that combines an archive and executable code for unpacking it. Such archives, unlike regular ones, do not require a separate program to unpack them (obtaining the source files from which they were created), if the executable code can be executed on the specified operating system. This is convenient when it is not known whether the user to whom the archive is being transferred has the appropriate unpacking program.

The main way to use self-extracting archives is to create programs to install software without using package management systems.

The executable code attached to the archive can be a full-fledged unpacking program. Since there is a possibility of execution of the unpacker code, a self-extracting archive or a file disguised as one can be used to distribute malware.

Examples

Examples of programs capable of creating self-extracting archives:

7-Zip
  • Non-customizable SFX archives 7z for Microsoft Windows.
  • There is a third-party custom module - also for Windows.
ARJ
  • For various platforms.
p7zip
  • 7zCon.sfx - non-configurable, for a user-specified platform; supports viewing, automatic file overwriting, integrity checking and encrypted archives.
PKZIP
  • Only in registered versions starting from 2.70.
RAR and WinRAR
  • It is possible to create custom self-extracting RAR archives (and ZIP in WinRAR) with Russian and English interfaces. The archive is configured by specifying a comment or in the “Advanced SFX Parameters” window. The icon can be changed.
zipSfx
  • Customizable, supports ZIP format. The setup is done by preparing text file and subsequent “gluing” of files.
SFX Creator
  • Creating custom self-extracting archives for Microsoft Windows with a choice of compressor (ZLIB, BZIP2, LZMA).
  • The archive is configured through the program's graphical interface.

The program is intended exclusively for creating multifunctional SFX archives/installer packages and has a wide range of capabilities.

CAB

StuffIt and WinZip can also create such archives in their own formats for the corresponding platforms.

Additionally, there are programs that create archives as UNIX shell scripts. This is often used to create commercial software installers for UNIX-like OSes. Examples: makeself and the older shar.

Compatibility

Since a program for one platform usually cannot run on other platforms, unpacking a self-extracting archive created for one system on other systems may be difficult.

Self-extracting archives in some formats (for example RAR and ZIP) can be extracted as regular (not SFX) archives using a self-extracting program.

It is possible to create code that will be supported without additional programs by several operating systems(for example DOS and OS/2), as well as standard means in one OS and additional funds in another (for example using Python or shell).

An archive with Win32 code may require additional steps after unpacking using Wine on a UNIX-like system - in particular, setting the permissions bits.

Often when working on automatic installation applications, there is a need to create a keyless self-extracting archive (in the future I will use “SFX”, it’s shorter). As a rule, SFX archives can significantly save space on a CD. For example, if an application does not require installation, then it can be placed in $OEM$\Progs and it will be automatically copied to Program Files. However, a similar goal can be achieved by packaging the application in SFX, which will unpack the contents into the desired folder.

The scope of SFX is not limited to applications that do not require installation. You can easily package an application packaged with one of the common installers and configure SFX in such a way that after unpacking the installation of the application with the necessary keys will start. Another advantage of SFX archives is that in some cases they make it possible not only to automate, but also to completely hide the installation process and progress from the end user. For example, consider packaging Adobe Reader 7.0. Despite the fact that relatively recently the application can be installed with the appropriate keys without any problems, only SFX allows you to install the application completely unnoticed.

Preparing to create SFX

Regardless of what you use to create SFX, there will be no difference in preparation. If you just want to pack a folder with files, then no preparation is required. But sometimes applications have to be unpacked. In the case of Adobe Reader 7, Install Shield with Basic MSI is used, and all this is also packaged in a certain FEAD Optimizer. You need to run the Adobe executable file, wait until FEAD Optimizer finishes unpacking and find the folder with the file Adobe Reader 7.0.msi(it can be in %ProgramFiles%\Adobe, for example). Now you need to run the file setup.exe with the /a switch to create an administrative installation. In the dialog box that appears, you need to specify the folder in which, upon completion, all the files we need will be located. Now you can rename Adobe Reader 7.0.msi in, say, Adobe7.msi and start packing it into an SFX archive. We will look at creating SFX archives using

WinRAR

The program was written specifically to solve the problem of creating a full-fledged SFX archive and has great capabilities for creating keyless SFX. With its help, you can create both a silent installer and an installer with graphical interface.

SFX Creator program features:

  • Support for all (or almost all) variable system/user directories
  • Selecting the compression type (LZMA - this type compression is used in the archiver 7-Zip), BZIP2, ZLIB
  • Creating shortcuts to files
  • Importing REG files after unpacking the files
  • Running applications before and after extracting your files
  • Performing operations in the registry (writing/deleting parameters, deleting keys)
  • Performing file operations (copying/deleting files, creating/deleting directories)
  • Ability to create an uninstall program (with convenient addition of information to the Add or Remove Programs applet)
  • Ability to set your own icon on the SFX archive
  • Ability to add file version information
  • Possibility to execute native functions, written in NSIS language before and after unpacking files
  • The ability to check for installed software before unpacking your files and perform certain actions if you are not satisfied with the result of the check (for example, if the software version is lower than required, you can stop the installation and/or show a message to the user)
  • Ability to unpack your files to a directory specified in a registry key
  • Registering libraries when unpacking files (and the ability to unregister when uninstalling an application)
  • Possibility to show the user an informational message upon startup/completion
  • You can create an unpacker (almost an installer package) with a graphical interface. You are offered to use 2 types of interface to choose from
  • Option to show your image before starting the file extraction process
  • When creating a GUI project, you can add an image display to the background

Everyone has probably at least once encountered a self-extracting sfx archive with the *.exe extension, and the icon for this file can be like WInRAR archive. The self-extracting archive contains the sfx (SelF-eXtracting) executable module, which can independently extract the contents of the archive without the need to launch or even have an archiver program on the computer. Next, we will look at how to create a self-extracting sfx archive using WinRAR.

The WinRAR archiver can work with an sfx archive as with a regular rar archive, i.e. can extract files from it, add or remove files from the sfx archive. Creating an sfx archive can be as easy as creating a regular rar archive; you just need to check one box in the settings.

To create a self-extracting archive, first you need to start archiving the file with WInRAR using any in a convenient way with a window call "Archive name and parameters". For example, open WinRAR, find required file and start creating an archive by clicking the button in the menu "Add". Now, to create an sfx archive with the file extension *.exe you need to go to the settings "Archive Options" check the box “Create SFX archive”. If you wish, you can go to the tab "Additionally" and pressing the button "SFX Options..." make additional settings.

After pressing the button "OK" a self-extracting sfx archive will be created.

With the same ease, you can convert any existing rar archive into an sfx archive. To do this, you need to find it in the WinRAR program, select it and click the appropriate item "Convert archive(s) to SFX" on the menu "Operations" or open information about this archive by clicking on the menu item "Information", go to tab "SFX", select item "Add new SFX module" and press "OK".

Hello my dear reader.
Well, now it’s time to write something new, otherwise it’s all holidays, holidays….
The topic has been brewing for a very long time and follows from my previous articles, i.e., how to package a single *. exe file from files and batch files.
If you haven’t read it yet, I highly recommend reading it and also learning about it.
So what is SFX?
SFX is an abbreviation for the English words “Self Extractor” - self-extracting, i.e., to unpack such an archive, an archiver is not required and it is presented as a single program file with the extension “*.exe”. In order for such an archive to be unpacked, you need to run this file and specify the path where you want to unpack our files. Some archivers, for example WinRAR, support additional parameters for SFX archives, which is why it is best to use WinRAR for such tasks, since after unpacking you will need to perform some actions, and WinRAR allows you to do this fully.

Pre-launch preparation

So, first, let’s download the win rar archiver onto your computer, if you don’t already have it, and install it.
That's all the preparation, nothing more is required except your hands and keyboard, you can start packaging our first SFX archive.

Creating an archive and specifying parameters

Let's assume that we have a folder on drive “C” called “setup”, in which there are already prepared files for quiet installation. Let's agree that these are the files install.exe and install.bat with the following content:

@echo off
start /wait install.exe /verysilent
echo program installed, please press any key for close window
@pause > nul
exit

If you don't already know what this code means, here you go.
In order to pack the files, open our “C:\Setup” folder.
Select both files using CTRL + a, or with the mouse, if you are suddenly so used to it :-), open the context menu using the Application key, shift + f10, or by right-clicking the mouse, and select “Add to archive”, or first “WinRAR”, and then “Add to archive” if you have included attachments context menus when installing the archiver.
After selecting this item, the “Archive name and parameters” window will open.
In the first editor we will be asked to enter the name of the archive, initially the name will be “Name of the source folder + extension”, and then “setup.rar. Let’s go through the Tab key to the “Archive format” grouping, I recommend putting ZIP. After selecting a different format, the extension in the name will also be changed. In the next Compression Method combo box, we can choose how much the data will be compressed. You can set the compression type to the maximum because programs compress poorly anyway, so it’s good if the archive turns out to be smaller than the original files.
Next, we get to the “Archiving Options” group and check the “Create SFX archive” checkbox. Now our file name, you can go back and look, has been changed to setup.exe.
Now we need to set some additional SFX parameters, to do this, go to the “Advanced” tab, and click the “SFX Parameters” button there.
This will open the Advanced SFX Options window. On the first tab “General”, you are asked to specify the path for unpacking, and if you enter something there, an option will appear to choose whether to create this folder in “Program Files”, or in the current folder of the archive, i.e., from where the archive is unpacked .
Since none of the options suits us, leave the field blank.
The next tab is “Installation”, here some of the parameters we need are set.
So, the first input field: execute after unpacking, we write our body file:

The second field, which must be completed before unpacking, is left blank.
Switch to the next tab - “Modes”.
Here we’ll immediately check the “Extract to temporary folder” checkbox so that our archive is unpacked into the temporary files folder.
Next, we reach the “Information output mode” group and select the “Hide all” radio button.
Now, when unpacking, a window indicating the path will not be displayed, but the archive will be automatically unpacked, after which the install.bat file will be launched.
The next tab is “Advanced”, but on at this stage there is nothing interesting for us there, you can skip it and go straight to the “Update” tab.
Here we will get to the “Overwrite mode” grouping, and check the radio button “Overwrite all files without prompting”. Now there won’t be any requests for sure :-).
We find and click the “OK” button, after which we get into the “Archive name and parameters” window, yes, exactly where we were, on the “Advanced” tab, remember?
Now in this window you can click the “OK” button and wait until the files are archived, after which the new file with the name "setup.exe".
Let's launch it and check!
Works? that is great. Today you learned how to create simple SFX archives using the WinRAR program. Liked? Then here's your homework: in the tab we missed in SFX options, you can add a shortcut to files. Pack any EXE file, set it to unpack to a random folder in Program Files, and create a shortcut for it on your desktop! Can you handle it? Well then, go ahead!
And now it’s time to say “That’s it for today” and go drink delicious tea and cookies!
Easy archives for you :-).
See you again!
.