Default Values to Inno Setup install - inno-setup

I have a group at work asking if there is a way to pass in values, either via command line or an ini value, that will "fill in" values that are normally provided by the user during install. For example, if I have a drop down that the user can select they're installing the client, server, or both, they want a way to automate this so the user doesn't have to select anything.
Basically, they want to automate running the installer without actually showing the wizard panels and populating user values based on command line args or an ini file.
I know you can use ini files, but I don't think they're used for this reason. And I don't see any way that command args would be used.
Is there a way native to Inno Setup to do this?
Thanks!

One way to set all the standard settings at once is to use an INF file via the /LOADINF parameter.
It is also possible to extend this to custom page settings if you wish (with cooperation by the setup author).

There are many command line parameters already included in Inno which you can use: http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline
With them you can set task, directory, group, components, password etc etc.
If you need something special you can use your own command line parameters.
Use GetCmdTail() function to get cmd line parameters for setup or uninstaller.
As this is common question there are already some advanced parsers and methods like this one:
Is it possible to accept custom command line parameters with Inno Setup
I suggest you to use /SILENT parameter for not showing the setup forms together with e.g. /TASKS, /DIR and /COMPONENTS and some custom parameter.

Related

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

Add user defined command line parameters to /? window

With Inno Setup it is possible to add user defined command line parameters. When I use the /?, /HELP command the user defined parameters are not listed there. How can I add my commands with a description to the /?, /HELP window?
Inno Setup 6.0 supports HelpTextNote message, whose contents will be inserted into the /HELP box.
In older versions:
You cannot.
The help text is hard-coded and not customizable in any way. It's not even localized.
It is even displayed before any Pascal Script code (InitializeSetup) is executed, so there's even no room to install some fancy hook to modify the message box on runtime.
See the ShowHelp function in the SetupLdr.dpr.
All you can do is to implement a custom switch (e.g. /usage) and handle it in the InitializeSetup event function.
Or, of course, you can modify Inno Setup source code and re-compile it. It's open source.
A related question: Is it possible to accept custom command line parameters with Inno Setup

Visual Studio load test setting parameters for command line

I have a load test project that I run regularly from the Visual Studio using the Load Test GUI. I would like to run that test from the command line by changing its parameters such as the number of users, run duration etc.
In visual studio load test, there are usually 3 type of settings that I usually play around.
Test setting: for general controller and agent assignments.
Run settings: in which I set the run duration, where to save the logs of the test results etc.
Scenario settings: used to set the load pattern and test mix etc.
Ideally I should be able to change any of these settings using some command line parameters of MSTEST utility or assigning a setting file for each goal, however I haven't been able to accomplish that setting change using the MSTEST command line options. I am able to run the load test using the state where I left off before exiting the GUI, however I cannot set the runsetting that is not currently active or I cannot change the user load defined in the scenario settings.
For my current task, being able to change the user load from the command line is more urgent than changing other parameters. So if someone knows how to change Scenario Settings from the command line that would be great help. I already tried creating more than one scenario with different number of users however in Visual Studio, seems like it is not possible to select particular scenario and execute test using it. Once the load test starts, it runs every available scenarios sequentially. So I think for my purpose I should create only one scenario and be able to change the user load from command line somehow.
Thanks for the help in advance.
As far as I know, none of those items are available as command line options or similar. But all, or possible just most, are available programmatically via a load test plugin. One possible solution for you is to set the required values in the LoadTestStarting event. The values could be read from a file or from environment variables; you choose what values are available and how to represent them.
This Microsoft blog introduces load test plugins and has several examples.
This is the MSDN doc on how to set test settings you want active from command line with MSTest.
https://msdn.microsoft.com/en-us/library/ff426021.aspx
Unfortunately, I haven't been able to find a way to change the step load pattern (and user count within).

Inno Setup: Associating a range of file extensions

Is there a way in Inno setup to register a range of file extensions with a program?
What I want to do is set up a file associations page and ask the user if he wants to associate files with the extension n1..n99 with my program.
I can see how the tasks page works with individual file types, but I want to register 100 file extensions in one go. As it stands this would put 100 check boxes on the Associate files page.
Can this be done with pascal script, anybody got any ideas on how to do it?

Is it possible to control which files to install from command line for INNO installer?

I would like to control a subset of files and only allow some of them to be installed if run with a command line switch for instance.
Is this possible?
For example
if (some condition)
install full set of files
else
Install other set of files
Alternatively I can just run another installer but then I have to pass the file/path location to that second installer. There is also the issue of bundling that second installer with the first one. I think that part is not that difficult though
Yes, it is even rather easy. There are several ways to do this, all of which depend on Pascal scripting.
Method 1
You can use the GetCmdTail, ParamCount, and ParamStr functions to obtain the entire or parts of the command-line.
Then you can use the Check parameter on separate files. Hence, each file will be installed if and only if the called function returns true.

Resources