How to set up smartphones and PCs. Informational portal
  • home
  • Security
  • Self-extracting archive. Preparing to create SFX

Self-extracting archive. Preparing to create SFX

A self-extracting (SFX, from SelF-eXtracting) archive is an archive to which an executable program module is attached, which allows you to extract files yourself without involving an archiver program. An SFX archive is especially useful when you need to send it to someone, but you are not sure that the recipient has the right archiver.

To create a new SFX archive, when creating an archive, enable the "Create SFX archive" option in the dialog box for entering the archive name and parameters (Fig.5).

If you need to create an SFX archive from an already existing regular archive, you should enter the archive and call the "Convert archive(s) to SFX" command in the "Operations" menu (or press the "SFX" button).

When executing the "Convert archive(s) to SFX" command, a window appears prompting you to select the type of SFX module. By default, the Default.sfx module is used, which is associated with the Russian-language Windows interface. Other SFX modules are used only in rare special cases.

Extracting files from an SFX archive is done automatically by simply launching the archive file in the Windows environment (double-click, like a normal program). The destination folder for the extracted files is specified in a special window that appears after the archive file is launched. The folder name can be entered manually or selected from the folder tree. If the entered destination folder does not exist, it will be pre-created before the extraction starts.

Along with this method, WinRAR allows you to extract files from an SFX archive in the usual way, as from a regular archive. If you do not want to run the SFX archive (for example, if there are no guarantees that it does not contain viruses), then you can view this archive in the normal mode or extract the necessary files from it.

The exercise. In the current folder createSFX-archiveWinRARWith nameMyArch3 and put some group of files in it. Log outWinRAR. Not enteringWinRAR, unzip the archiveMyArch3 and put its contents in a new folderFiles3.

Multi-volume archive

A multi-volume archive is an archive divided into several separate parts. It is used when placing a large archive on several floppy disks or other removable media. Volumes are parts of an archive, each of them can be in the form of a separate file on a separate medium. Volumes are only supported in RAR format, creating ZIP volumes in WinRAR is not possible.

To obtain a multi-volume archive, when creating an archive, enter a specific value in the "Split into volumes in size (in bytes)" field in the dialog box for entering the archive name and parameters (Fig. 5).

By default, the volume size is entered in bytes, but can also be specified in kilobytes, thousands of bytes, megabytes, and millions of bytes. To do this, after the numerical value, put one of the following alphabetic identifiers (all letters are Latin):

k - kilobytes (multiplier 1024);

m - megabytes (1 MB = 1048576 bytes);

M - millions of bytes (multiplier 1,000,000);

g - gigabytes (1 GB = 1073741824 bytes);

G - billions of bytes (multiplier 1,000,000,000).

The volume size can also be selected from the drop-down list associated with the specified field, where previously used values ​​are placed. If you want to fill the free space on removable disks as much as possible, you should select the "Autodetect" item in the list.

Created archive volumes receive names like: 'archive_name.partN.rar', where N is the serial number of the volume.

Multi-volume archives can also be self-extracting and continuous. The first SFX volume has an extension other than ".rar", for example DOS SFX volumes use the extension ".exe".

Already created multi-volume archives do not allow changes; you cannot add, update or delete files to them.

To unpack a multi-volume archive, you must start extracting from the first volume. If the volumes are on non-removable media (for example, on a hard disk), then you must first rewrite all the volumes into one folder.

The exercise. Select a file (preferably a large one) and use the "Show Info" command to estimate the possible total volumeNarchive of this file. Create a multi-volume archive for this file, specifying the volume size asN/3.

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 multivolume 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 ordinary 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 that consists of several parts called volumes. Multi-volume archives are used when the amount 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 1457664 bytes among the options for splitting. It was this volume that the named floppy disks had.

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

Some software developers make their applications available for download as multi-volume archives. For example, along with the whole installation file, the popular accounting program "Legal Taxpayer" is available for download in this form. This approach is convenient for an unstable Internet channel. Indeed, in the event of a connection break, 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 in the event of a connection failure, but we will talk about them some other time.

Multi-volume archives can also be successfully used for simply splitting a large file. As I already mentioned in the article, some files have a high compression ratio and their volume does not decrease much when archived. But nothing prevents us from dividing such a file into parts.

It is on the example of one of these files that I will tell you how to create multi-volume and SFX archives.

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

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

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

Any of the archive file formats available in 7-Zip 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 already available options.

At the top right, you see the "Create SFX Archive" option. In order for the archive to be self-extracting, it is enough to mark this option with a checkmark.

Unfortunately, the 7z format is limited, so it can be either 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, for now I will choose a self-extracting archive. We put a birdie, click OK and wait for the end of the procedure.

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 want to get a multi-volume self-extracting archive without fail?

For this purpose, the RAR format is ideal, which can be obtained using the WinRAR application.

The procedure for creating such an archive is very similar to the one we have just discussed. We just right-click on the desired file and select the option to add to the archive.

This is how the archive creation window looks like.

Agree, very similar to the 7-Zip interface. In the same way, the size of the volume is selected or hammered by hand. There is also an option to create an SFX archive.

The scope of SFX is not limited to applications that do not require installation. You can easily pack 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 be launched. 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, the packaging of Adobe Reader 7.0 is considered. Despite the fact that since relatively recently the application can be installed without any problems, only SFX allows you to install the application completely discreetly.

Preparing to create SFX

Regardless of what you use to create the SFX, there will be no difference in preparation. If you just want to pack a folder of files, then no preparation is required. But applications sometimes have to be unpacked. In the case of Adobe Reader 7, Install Shield with Basic MSI is used, and all this is also packed into 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 could 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, at the end, all the files we need will be located. Now you can rename Adobe Reader 7.0.msi in, let's say Adobe7.msi and start packing into SFX archive. We will look at creating SFX archives using

WinRAR

WinRAR is an archiver that needs no introduction. It has a wide range of options for creating keyless SFX. With it, you can create a silent (silent) installer that will unpack the contents of SFX into a specified folder, execute a pre-specified command, and at the end of the installation can delete the unpacked files. Among other things, WinRAR can add items to the Start menu, place shortcuts on the desktop, and set the archive icon of your choice. I will consider only the basic features of the program, and you can easily figure out the rest with the help of help.

So, by running the archiver, we go to the folder where the Adobe administrative installation is located. Select all files

and click Add

We name the archive as desired, mark the creation of SFX and select the maximum compression level. Now we need to configure the SFX parameters. To do this, on the tab Additionally click SFX Options.

On the tab General specify the command for unpacking

and go to tab Modes:

Here we specify unpacking to a temporary folder (which will automatically delete unpacked files at the end of the installation), hidden mode and overwriting all files.

By going to the tab A comment, we see all the parameters that we just configured through the GUI. In principle, it was possible to immediately go to this tab and type a comment manually or download it from a pre-prepared text file.

Note Since we are packing an application that has its own installer, unpacking to a temporary folder is quite justified (TempMode parameter). If you just want to unpack the files to the folder you need, then on the General tab you need to specify the path (you can use system variables), and accordingly, do not use TempMode.

That's all. Now it remains to click OK a couple of times and after a while we will have SFX, which will install Acrobat Reader completely invisibly.

Advantages: absolutely inconspicuous (silent) installation, the ability to unpack files to a specified folder, the ability to add items to the Start menu and shortcuts to the desktop, select an icon for the archive.
Disadvantages: costs $30.

7-Zip

7-Zip is a free archiver distributed under the GNU LGPL license. If you are not familiar with it, then you can find more information on the 7-Zip website. With it, you can create keyless SFX, although the process of creating them is somewhat longer than with WinRAR.

First we need to pack the contents of our folder into 7-Zip archive. This can be done through the 7-Zip file manager. By running it, we go to the folder where the administrative installation of Adobe is located. In the same folder, you need to put the StartX.exe file (I will explain its purpose below). Select all files

and click Add

We name the archive as desired (say, Adobe7.7z), select the 7-Zip format, the maximum compression level and click OK. The output is a file Adobe7.7z, from which we have to make SFX.

Now we need to create a configuration file for SFX. It can be done in Notepad. The only but obligatory condition is that it must be encoded in UTF-8. In our case, it will look like this:

;[email protected]@!UTF-8!

;[email protected]@!

It looks complicated, but now everything will become clear. The first and last lines simply mark the beginning and end of the configuration file. The middle line is the command that will be executed after unpacking the archive. The command itself is enclosed in quotes and placed after RunProgram=. Utility StartX.exe is the equivalent of the START console command and supports the same switches. Its presence is required to install the MSI package extracted from 7-Zip SFX. If you try to do something like RunProgram="Adobe7.msi /qn", the launch will fail. The two backslashes (\) simply precede the quotes inside the command.

Save the config file with the name config.txt to the same folder where Adobe7.7z, and proceed to the final stage of creating SFX.

From the 7-Zip installation folder you need to take the SFX module 7zS.sfx and copy it to files Adobe7.7z And config.txt. You can compress a module with the . This will reduce the module size from about 131 kb to 58 kb. This is done by the team

upx --best 7zS.sfx

It is enough to do this once, and you can use the compressed module in the future.

Note. Please note that some anti-virus programs erroneously treat an SFX module compressed with UPX as a virus. If you need to ensure successful decompression of an SFX archive under any conditions, do not compress the module with UPX.

Now that all three files are collected in one folder ( adobe7.7z, config.txt And 7zS.sfx), you need to run the following command from the command line

COPY /b 7zs.sfx + config.txt + adobe7.7z adobe7.exe

After a moment, a file will appear in the folder adobe7.exe. This is our SFX. Its launch initializes unpacking the archive into a temporary folder, launching a command from the configuration file, and deleting the unpacked files after the installation is complete.

Modified SFX module for 7-Zip

The original 7-Zip SFX module does not make it possible to make unpacking completely invisible. During the unpacking process, the user sees the following dialog box

and can even abort the installation by pressing the Cancel button. This problem can be avoided by using the SFX module, which was modified by OSZone conference participant Oleg Shcherbakov aka Oleg_Sch . You can download the modified module from the author's page, where you will also find help and source code. The help describes all the new features and examples of use (there is a lot of interesting stuff). So on this page I will limit myself to just an example of a configuration file that will completely hide the unpack dialog.

;[email protected]@!UTF-8!
RunProgram="StartX.exe /WAIT \"msiexec /i Adobe7.msi /qn\""
GUIMode="2"
;[email protected]@!

Actually, the modified module does not need the StartX utility, and RunProgram="Adobe7.msi /qn" could be dispensed with.

Curiously, in this case 7-Zip showed better compression than WinRAR. The size of 7-Zip SFX (even with the StartX.exe utility) turned out to be 20893 kb against 23825 kb for WinRAR SFX. However, the disadvantage of the native 7-Zip SFX module is the inability to configure keyless decompression of SFX to a given folder. Oleg's modified module allows you to specify the unpacking folder in the configuration file and saves 7-Zip from this shortcoming.

Advantages: free, high compression ratio; and with a modified SFX module, absolutely inconspicuous (silent) installation and the ability to unpack files to a specified folder, add items to the Start menu and shortcuts to the desktop, and many other functions are available.
Disadvantages: there is no option to select an icon for the archive (it is planned to be fixed in future versions of the modified Oleg module).

Self-extracting archive (SFX archive)- a file that consists of an archive and an executable code for unpacking it. Therefore, to unpack such an archive, you do not need additional programs such as WinRar, haozip, 7-Zip. In this article, we'll look at how you can create self-extracting archive using programs such as HaoZip and 7-Zip.

WE CREATE SELF-PACKING ARCHIVE (SFX archive) FROM HELP HAOZIP

First you need to download and install haozip. Download haozip You can follow the links at the end of the article. After downloaded haozip it needs to be installed. The installation process is intuitive, so we will not stop at this stage. If something is not clear, then the issues of installing programs are discussed in the article: how to install a program on a computer?

Now let's start creating. On the file or folder from which we want to create self-extracting archive(SFX archive) right-click and select "Add to archive ..." in the menu that opens. A window called "Archive" opens. In it, in the "Archive format" field, specify the item "7Z", and in the archiving parameters, check the box next to "Create SFX archive (only for 7Z)". See screenshot:

After you have done the above steps correctly, click OK. Creation will begin self-extracting archive or SFX archive:


After the completion of the creation process self-extracting archive or SFX archive, an archive will appear with the same name as the original file/folder. Screenshot:


In the screenshot, we see that initially there was a file in pdf format, from which they created self-extracting archive or SFX-archive in exe format. To unpack such an archive, just double-click on it, the "SFX file" window will open:


In this window, in the “Destination Folder” item, the folder where the file will be extracted is indicated - drive C, the Program Files folder. To specify a different folder for unpacking the archive, click on the "Browse" button. If you have dealt with these settings, then click on the “Install” button. The file extraction process will begin. Screenshot:


So how to create self-extracting archive or SFX archive using HaoZip, I think it's understandable.

WE CREATE SELF-PACKING ARCHIVE (SFX archive) FROM HELP 7-Zip

7-Zip is in the downloaded archive, it also needs to be installed. Once the installation is complete, the 7-Zip File Manager window will open. It looks like this:


Now click on the Computer icon in the 7-Zip File Manager window and specify the file / folder from which you want to create self-extracting archive(SFX archive). See screenshot:


Click "Add" and a window called "Add to archive" will open:


In this window, specify the 7z archive format and check the box next to "Create SFX archive". Now we press OK. 7-Zip will start creating self-extracting archive or SFX archive. Screenshot:


The result of the work: the file "site.exe" - self-extracting archive(SFX archive):


Now let's look at how to unpack the file we created. self-extracting archive. Double-click to run the archive, a window will open:

The "Extract to" field contains the path to unpack files from self-extracting archive. If necessary, you can specify another location for unpacking files. To do this, click on the button and specify a different path for unpacking files. Click "Extract" and unpacking the archive will begin.

Let's finish with this. Your feedback, questions, please write on the forum. We wish you success!!!

Hello dear readers!

Sooner or later, everyone is faced with the need to create an archive. Don't know how to do it? Then I will tell you.

In this article, I would like to explain how to create a self-extracting archive, which is also called an SFX archive. It is a special folder consisting of an archive and an executable code with which it is unpacked.

If you think that some special knowledge is needed to create it, then you are mistaken. In fact, this is done very easily and simply.

In this article, you will learn how to create it using the most popular software products.

Software products Winrar and Winzip

Files with the .exe extension are probably constantly encountered by you (installation files of software products).

Their main advantage is not only that they are self-extracting, but also that their installation does not require any additional applications. For their formation, as a rule, WinZip or WinRar is used.

One of the above archivers is probably already on your PC, so you can immediately get down to business. The scheme of work with both WinZip and WinRar is the same. I will take the last archiver as an example.

Right-click on the folder you wish to archive. In the context menu, select "Add to archive ...".

You will see the settings window. In it, select "Make SFX" and specify the address where it will be placed. If you want to create an archive file with a password, then open the "Advanced" tab and set it.

Click the “OK” button and the shaping process will begin. After a certain period of time, you will see an SFX archive at the specified address.

To extract files from the archive, just double-click on it with the left mouse button. In the window that opens, specify the destination and select "Extract".

7-Zip archiver

If you don't have WinZip or WinRar on your PC, you can use the free 7-Zip program. You can download it on the official website of the developer. Download and install it.

After installation, the File Manager window will appear in front of you. There you need to specify the folder or file that you want to archive. Click on the "Add to archive..." command. In the window that appears, you need to specify the 7z format and check the box next to "Create SFX archive". Click on "OK" and watch how the application does its job. The result of the work will be a folder with the extension .exe.

How to unpack it now? And very simple! First run the file by double-clicking the mouse. In the window that appears, in the column called "Extract to", specify the path along which the contents will be unpacked. To specify the desired directory, click on "...". Click "Extract" and watch the process.

That's all, dear friends! As you can see, everything is done very easily and simply!

Finally, I want to give you one piece of advice: if you want to master the computer and the Internet perfectly, then sign up for the course « genius geek» ! Experienced, highly qualified teachers will explain to you all computer "wisdom" in a simple and understandable language, teach you how to use various computer programs and the Internet.

Sincerely! Abdullin Ruslan

Top Related Articles