views:

21

answers:

3

I am preparing an installer with Innosetup. But I'd like to add additional custom (none of the available parameters) command line parameters and would like to get the value of the parameter, like:

setup.exe /do something

check if /do is given, then get the value of something. Is it possible? How can I do this?

+1  A: 

I found the answer: GetCmdTail.

Similar
+1  A: 

Yes it is possible, you can use the ParamStr function in PascalScript to access all the commandline parameters. The ParamCount function will give you the number of commandline parameters.

Another possibility is to use GetCmdTail

Otherside
A: 

You can pass parameters to your installer scripts. Install the Inno Setup Preprocessor and read the documentation on passing custom command-line parameters.

Bernard
The preprocessor code is processed before the installer is compiled, so it can't be used to check the commandline parameters of the resulting setup.exe.
Otherside
I know, which is why I specified "installer scripts" and not the compiled installer executable. I've often needed to do this, so I thought I'd mention this possibility.
Bernard