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

前端 未结 10 1139
梦谈多话
梦谈多话 2020-12-02 15:33

I am preparing an installer with Inno Setup. But I\'d like to add an additional custom (none of the available parameters) command line parameters and would like to get the v

10条回答
  •  [愿得一人]
    2020-12-02 16:24

    With InnoSetup 5.5.5 (and perhaps other versions), just pass whatever you want as a parameter, prefixed by a /

    c:\> myAppInstaller.exe /foo=wiggle
    

    and in your myApp.iss:

    [Setup]
    AppName = {param:foo|waggle}
    

    The |waggle provides a default value if no parameter matches. Inno setup is not case sensitive. This is a particularly nice way to handle command line options: They just spring into existence. I wish there was as slick a way to let users know what command line parameters the installer cares about.

    BTW, this makes both @knguyen's and @steve-dunn's answers somewhat redundant. The utility functions do exactly what the built-in {param: } syntax does.

提交回复
热议问题