问题
I am working on an application which uses a very large size of data files. My client wants to zip those data files separately from the setup exe then the installer should unzip them before starting the installation. Is that possible by inno? I don't have much experience in Pascal so any help will be much appreciated.
回答1:
No built in Pascal scripting support for uncompression
Although Inno Setup internally has many uncompress routines to support the various ways it can compress the files during compiling. None of these are published to the Pascal Scripting language.
It is still possible to do this, but you must build a DLL to perform the unzipping step. Then use this DLL in your uninstall.
If you don't compress you could use this method:
In the [Files]
of your Inno Setup script you can reference files that are not contained in your setup, by using the external
flag.
[Files]
Source: "data1.dat" DestDir: "{app}" Flags: external;
This would copy data1.dat located in the same directory as your Setup.exe to your application installation directory.
An alternative to consider
Build a separate Inno Setup Script for the Data Files. Give this script to your clients so they can run this using the Compiler, instead of a Zip program.
It will compress the data like ZIP would, although the default is lzma2/max
. This install could then be chained through the [Run]
section to install directly after the application was installed.
2nd Alternative to consider
Based on your comment I understand your problem a bit better.
You could build all the MP3 files into a single installation setup. You could group the MP3 files using the [Components]
section. This allows the user to select which group of files they want to install. The [Files]
Section supports wild cards so you can specify all the files in a single directory to make the script easier to maintain.
InnoSetup is built to handle large installations by setting up ways to break up the setup.exe into multiple files.
[Setup]
DiskSpanning=Yes
DiskSliceSize=XXX
SlicesPerDisk=XXX
SolidCompression=no (Default but it not recommended to be set 'YES' with Huge installs)
来源:https://stackoverflow.com/questions/5997666/unpack-data-files-before-starting-inno-setup