user3417768
user3417768

Reputation:

How can I resolve installer command-line switch value in Inno Setup Pascal Script?

I am trying to fire a S2S pixel from the installer when an install is successful. The pixel require some details like the IP, location, time and sub-id.

I got all the details except the sub id, which is specified on the command line using /subID=xxxx switch, when executing the installer.

Upvotes: 1

Views: 615

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202572

You can use the {param:ParamName} pseudo-constant.

See also Is it possible to accept custom command line parameters with Inno Setup.

In a Pascal Script you can resolve it using the ExpandConstant function:

ExpandConstant('{param:subID}')

If you need some custom parsing, you will have to parse the command-line explicitly by iterating the parameter list using the ParamStr and ParamCount function.

See some of the answers in the question linked above, and also:

Upvotes: 1

Related Questions