Automatically select features for silent MSI install

11,242

Solution 1

You can try to add ADDLOCAL to the command line:

p4inst64.exe /s /v"/QN /L*V "C:\test.log" ADDLOCAL="FeatureName""

I haven't tested this, but it should work ok, barring any issues with the quotes inside the parent quotes.

/L*V "C:\Test.log"= verbose logging
/QN = run completely silently
ADDLOCAL="FeatureName" = Install this feature locally 

Solution 2

I am adding a new answer with some alternative information - this might be useful if the scope of the modifications you need are larger than just a feature. See the end of the answer for a description of "transforms".

First, here are some screen shots so it is clear how to get the feature names. Here is a screen shot showing how you can find the feature names using Orca: Orca

Here is a couple of screen shots combined to show you how to see the features by running the MSI file itself. Dialogs and dialog sequencing can be changed for each MSI, but overall the concept is similar. Find the "Custom" dialog or just run the setup clicking "Next" until the feature list appears. Some setups have no feature list at all in the GUI, and then you need Orca or you can read the log file which you did.

MSI dialogs

Other, commercial installation tools or a trial installation of these (can be easier to install than the full SDK which is required to get Orca) can also be used to view the contents of an MSI file.

Finally: another way to modify what is installed by an MSI, as well as making other changes is to use a transform - a database modification snippet, or transaction that is applied to the original database to make changes for installation. Check this answer for an overview and this stackoverflow answer.

Share:
11,242

Related videos on Youtube

Michiel van Oosterhout
Author by

Michiel van Oosterhout

I ♥ code

Updated on September 18, 2022

Comments

  • Michiel van Oosterhout
    Michiel van Oosterhout over 1 year

    I have an InstallShield .exe that 'wraps' an MSI installer. I can pass arguments to the MSI installer like this:

    /v"..."
    

    For example, to do a silent install: p4inst64.exe /S /v"/qn". The MSI installer will install 4 'features;, but I only want to install 1.

    How can I specify feature selection for the MSI installer from the command line?

  • Michiel van Oosterhout
    Michiel van Oosterhout almost 10 years
    Thanks! I had to run the installer once with verbose logging to find the feature names ("ADDLOCAL" is also used in the install log).
  • Stein Åsmul
    Stein Åsmul almost 10 years
    Most setups allow feature selection as part of its GUI. Either going into a "Custom setup" screen or as one of the normal dialogs in the "next dialog sequence". You can also open the MSI in Orca or another Installation tool.
  • Stein Åsmul
    Stein Åsmul over 7 years
    setup.exe /v"MY_PROPERTY=\"Value Of Property\"" in case the above doesn't work. The \ character is an escape character for the " that follows.