Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I extract an embedded archive to disk during the installation process

Tags:

inno-setup

I have an embedded 7Zip archive in my setup script.
Is there a "native" way of extracting the contents to a target folder?
If not any hints on how this could be achieved?

Updated with my implementation. Thanks for the hint TLama

[Files]    
Source: "Documentation.7zip"; DestDir: "{tmp}"    
Source: "7za.exe"; DestDir: "{tmp}"

[Run]
Filename: "{tmp}\7za.exe"; Parameters: "x -o""{app}"" ""{tmp}\Documentation.7zip""";     Flags: runhidden; Description: "{cm:InstallingDocumentation}"; StatusMsg: "{cm:InstallingDocumentationStatus}"

[CustomMessages]
en.InstallingDocumentation=Documentation Files
en.InstallingDocumentationStatus=Installing Documentation Files. This may take several minutes...
like image 884
Tobias R Avatar asked May 13 '13 07:05

Tobias R


2 Answers

No, there is no native way to extract 7zip files from InnoSetup installer. However, you can get a copy of 7zip library, which is redistributable and call it from InnoSetup script's code section.

like image 66
TLama Avatar answered Nov 15 '22 09:11

TLama


Inno doesn't have any native method of extracting files from anything other than it's own archives (which normally compress better than 7Zip).

Inno Setup can however use wildcards for including files to install:

[Files]
Source: "Documentation\*.*"; DestDir: "{app}/Documentation/";

If you have many small files, using the solidcompression flag will improve compression performance and size.

like image 32
Deanna Avatar answered Nov 15 '22 09:11

Deanna