How can I resolve installer command-line switch va

2019-02-20 05:26发布

问题:

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.

回答1:

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:

  • Passing a string value to Inno Setup from command line app
  • Install files if command-line switch is passed to Inno Setup based installer


标签: inno-setup