inno-setup

Make installer capable of installing addon files to various applications in Inno Setup


I have a set of files (scenery data of an airport) that should be installed to one of several applications (3 different flight simulators) depending on the target applications being installed. If more than one is installed, the user has to choose into what application the set of files should be installed.

Of course I could write for each application a separate installer but that would make it awkward to maintain and blow up the number of installers since there are many sets of files to install.

Problem is that depending on the chosen application the AppId, the installation destination and other installation values changes.

I intend to write a custom wizard page that is shown immediately after the welcome page to find out which of the target applications are installed and let the user choose the required application in case there are several installed.

My current problem is that the files to copy are not fully the same for each possible application. So I need in the [Files] section the posibility to copy a file to its target location depending on the application selected. I hoped to find a general parameter for the [Files] section that could be used to copy or not. But I could not find one. How could I solve this problem? I also studied [Components] and [Tasks] to find a solution but was not successful.

Thanks for any hint how to solve my problem!


Solution

  • To answer your literal question: Use Check parameter to bind [Files] (and other) section entries to the selection on the custom page.

    Some examples:


    Though you also might consider using a preprocessor to easily maintain and auto-generate multiple installers from same source script.

    For an example, see:
    Compile Inno Setup installer for specific component only