Search code examples
zipinno-setup

Creating Zip File in Inno Setup Script


Suppose I want to put a zip file in the installation path after installation. But this zip file is not available to me, so it has to be created in the build process. And a folder must be added to another folder and the zip file must be created from it. For example I have:

  • C:Folder1
  • C:Folder2

And zip file must be:

  • C:Folder1/Folder2

With all the files in respective folder.

I have unfortunately very little experience with Inno-Setup and this particular problem with the folder in another folder pack without changing the source path but a zip file in .exe to do I find nowhere.


Solution

  • Inno Setup cannot create a zip file for you while compiling.

    But you have two options how to delegate the zip creation to an external process

    1. If you are automating complex build process, you will likely be running Inno Setup command-line iscc compiler. So just before running it in your batch build process, run another process/software/tool to create the zip file.

      For some example, see:

    2. If you really want to create the zip file on the fly, while manually building the installer in Inno Setup GUI, you can use preprocessor Exec function to start an process/software/tool to create the zip file before the actual compiling begins.

      For some examples, see:


    As for the actual zip file creation, that's not really Inno Setup question anymore. You will file lot of question about that, for example:
    Batch file script to zip files