Create Self-Extracting Archives with WinRAR
While distributing files on the internet, it always makes sense to archive them. For one, often they become smaller and hence easier to download. Also, it makes it possible to package multiple files as one. This saves us the hassle of downloading multiple files separately. But there’s often a doubt if the receiver of the files will be able to open the archive. While RAR archives are always smaller than zip, we still can’t use them freely because everyone does not use WinRAR. The solution to this is to create self-extracting archives.
Self-extracting files are executable files which do not need any other software to extract. For the geeky ones, the extraction module required is embedded in the archive itself. So the size of the archive will increase by around 100KB. Here is the tutorial to create a self-extracting executable archive with WinRAR:
Step by Step Tutorial to Creating Self-Extracting Archives
Step I – Select the files/folders to add to the archive. Right click and select WinRAR>Add to archive…
Step II – Select the settings shown in the below screenshot i.e.
- Archive format: RAR
- Compression method: Best
- Archiving options: Create SFX archive
- Archiving options: Create solid archive (not necessary, makes archives smaller if it contains many files)
Step III – Go to the Advanced tab and click on the SFX options… button (optional step). Here you can customize the options related to the self-extracting archive (explained below).
Step IV – Click on OK
Your self-extracting archive is now ready. Keep in mind though that some email providers may not allow you to send .exe files as attachment. In such cases you can use a file sharing service such as Dropbox.
Advanced Options (Tab wise)
General – here you can set the default path where the archive will be extracted. You can create a program setup using WinRAR. If you are creating a setup, then select Create in “Program Files” option.
Setup – Here you can specify a file to run after extraction. Say this is a setup file. Here you can specify the program to run automatically once the setup is complete. You can specify a file to run before the extraction.
Modes – Here you can specify if you want the archive to be extracted to a temporary folder. The silent mode, if set to Hide, then it will prevent the relevant dialog box from being displayed on screen.
Advanced – here you can specify files that will be deleted in the destination folder. You can also add shortcuts to the program. You can choose where these shortcuts will be created, desktop, start menu or startup.
Update – Here you will specify what happens if the extraction path already contains the files being extracted. Whether they will be overwritten or ignored. Also, if the user will be prompted before overwriting any file.
Text and icon – In this tab, you will specify the text that will appear in the extraction window. This is the text the user will see when he runs the SFX archive. In the lower section you can specify a logo and icon for the SFX archive file. If you do not specify any icon, the default icon will be a special WinRAR SFX Archive icon. Keep in mind that only .ico files can be used as icons.
License – once again, if you are creating a setup file, you can put a license agreement in this tab. You can type the text manually or import a text or html file. You can use HTML tags in the License text box. If you type in anything, the user will see a license agreement dialog which he will have to accept. Only then will he be able to extract the archive.
Module – Here you select the module to be included in the self-extracting archive. You can leave it to default or select the 64-bit module. The console modules do not support advanced options.
Once you are done setting all the options, click the OK button.
If you want to create a simple self-extracting archive, you need not fiddle with the advanced options. You can leave them at the default values. However, you can also use them to give instructions to the user of the file or list the contents of the archive.
I hope this tutorial was informative and useful. If you have any doubts, do drop in with your comments.