I want to create an installer in Inno Setup which extracts the content of pre created Data.rar
archive. I mean it should treat the contents of the rar archive as files and folders of application.
Asked
Active
Viewed 1,432 times
1

Martin Prikryl
- 188,800
- 56
- 490
- 992

lone_wolf
- 125
- 2
- 9
1 Answers
2
A generic way to use an external extraction utility with Inno Setup:
- create the archive
- embed the archive to the installer
- embed a tool that can extract the archive to the installer
- make the installer extract the archive and the tool to a temporary location on target machine -
{tmp}
- make the installer run the tool to extract the archive
[Files]
Source: "UnRAR.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
Source: "Data.rar"; DestDir: "{tmp}"; Flags: deleteafterinstall nocompression
[Run]
Filename: "{tmp}\UnRAR.exe"; Parameters: "x ""{tmp}\Data.rar"" ""{app}"""
If you want to present a progress of the decompression, you will have to parse the UnRAR output. For an example (on Arc), see How to add .arc decompression to Inno Setup?
Or use UnRAR.dll
, similarly as unarc.dll
is used in Inno Setup - How to add cancel button to decompressing page?
Note that the UnRAR.exe
tool is free and can be used for these purposes. An extract from its license.txt
:
- The UnRAR utility may be freely distributed. It is allowed to distribute UnRAR inside of other software packages.

Community
- 1
- 1

Martin Prikryl
- 188,800
- 56
- 490
- 992