tags:

views:

12

answers:

1

I would like to control a subset of files and only allow some of them to be installed if run with a command line switch for instance.

Is this possible?

For example

if (some condition)
    install full set of files
else
    Install other set of files

Alternatively I can just run another installer but then I have to pass the file/path location to that second installer. There is also the issue of bundling that second installer with the first one. I think that part is not that difficult though

+2  A: 

Yes, it is even rather easy. There are several ways to do this, all of which depend on Pascal scripting.

Method 1

  • You can use the GetCmdTail, ParamCount, and ParamStr functions to obtain the entire or parts of the command-line.

  • Then you can use the Check parameter on separate files. Hence, each file will be installed if and only if the called function returns true.

Andreas Rejbrand
Great. I guess I have to install the latest version...
Tim
@Tim: As you might have guessed, I intended to write a **Method 2** also. I wanted to use the command-line to select which *components* to be on and which to be off. But although there is a `IsComponentSelected` function (http://www.jrsoftware.org/ishelp/topic_isxfunc_iscomponentselected.htm), there seems not to be a `SetComponentSelected` procedure...
Andreas Rejbrand