Monday, March 28, 2011

How do you pass in parameters to the Inno Setup command line compiler?

It was suggested in the IS newsgroup to use /D= but using the iscc.exe that came with version 5.2.3 I get an "Unknown option:" error.

Then in the script, how do you use the value of the command line parameter?

From stackoverflow
  • Looks like this thread is just what you're searching for: Link

    You will need the IS preprocessor.

    AlanKley : Thanks, I should have done a more general search instead of reyling on the Inno Setup forums! That thread had some good examples
    MicSim : Yes, it's amazing how much things you can find with Google.
  • From the Inno Setup helpfile:

    Inno Setup Preprocessor replaces the standard Inno Setup Command Line Compiler (ISCC.exe) by an extended version. This extended version provides extra parameters to control Inno Setup Preprocessor.

    The "extra parameters" include the /d option.

  • You do, as MicSim says, need the preprocessor. It's included in the latest ISPack. Once it's installed, iscc supports /D.

    You can then use the values defined like this (assuming you'd done /DVERSION_NAME=1.23):

    AppVerName=MyApplication v{#VERSION_NAME}
    

0 comments:

Post a Comment