Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 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?

like image 322
Similar Avatar asked Sep 01 '10 13:09

Similar


People also ask

Which of the given command line parameter is used to suppress logging?

To prevent this behavior, you can suppress the log file by specifying /LogFile= (with no filename argument) after Installutil.exe on the command line.

What does Inno Setup do?

The installer has the ability to compare file version info, replace in-use files, use shared file counting, register DLL/OCX's and type libraries, and install fonts. Creation of shortcuts anywhere, including in the Start Menu and on the desktop. Creation of registry and . INI entries.

What is Suppressmsgboxes?

/SUPPRESSMSGBOXESInstructs Setup to suppress message boxes. Only has an effect when combined with '/SILENT' or '/VERYSILENT'. The default response in situations where there's a choice is: Yes in a 'Keep newer file? ' situation.


Video Answer


1 Answers

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.

like image 62
Dan Locks Avatar answered Sep 16 '22 20:09

Dan Locks