2

So when running an executable, you know how there are a bunch of parameters you can check (like include a desktop icon), how do i get a list of available components for an executable, so i can pass these components to the executable from the command line? I researched and came across, silent arguments, and you can append /components on the end of the command to do this:

SomeExecut.exe /COMPONENTS = "comp1,comp2"

Further Explanation: My final goal is to use chocolatey to install packages onto machines, however, the defaults dont always select the properties we need, i want to create custom choco package with an executable and pass the appropriate parameters to the choco install MYPACKAGE.

Any other suggestions are appreciated!!

BLang
  • 930
  • 3
  • 16
  • 35

1 Answers1

2

For open source Chocolatey and outside Chocolatey itself, the answer is you would research each software installer to find them. Each installer is built differently. We like to say that each piece of software is a special snowflake.

There are 20+ different known installer types. Chocolatey knows about most of them. Most of them don't have much to offer, like NSIS.

InnoSetup has "COMPONENTS" like you are seeing. What exactly is available is defined by each installer. In a future version of Package Builder (part of Chocolatey for Business), it is going to automatically extract these and provide them as package parameters for you to use.

MSI (Windows Installer) has MSI Properties. Package Builder already extracts these and adds them to the install script as a comment and to the package description as options to pass as --install-arguments.

Package Builder Extraction

To give you an idea, this is what right click create package on the Puppet-Agent for Windows MSI will get you as part of the fully unattended software deployment package that is created in about 5 seconds:

<description>Puppet-Agent

### Package Specific
#### Installer Properties
The following install arguments can be passed:
 * `ALLUSERS`
 * `PUPPET_AGENT_ACCOUNT_DOMAIN`
 * `PUPPET_AGENT_ACCOUNT_USER`
 * `PUPPET_AGENT_ACCOUNT_PASSWORD`
 * `PUPPET_MASTER_SERVER`
 * `PUPPET_AGENT_ENVIRONMENT`
 * `PUPPET_AGENT_CERTNAME`
 * `PUPPET_CA_SERVER`
 * `PUPPET_AGENT_STARTUP_MODE`
 * `INSTALLDIR`
 * `INSTALLDIR_X86`

To append install arguments to the current silent arguments passed to the installer, use `--install-arguments="''"` or `--install-arguments-sensitive="''"`. To completely override the silent arguments with your own, also pass `--override-arguments`.
 Example: `choco install packageId [other options] --install-arguments="'PROPERTY=value PROPERTY2=value2'"`
To have choco remember parameters on upgrade, be sure to set `choco feature enable -n=useRememberedArgumentsForUpgrades`.
</description>

To pull that out to markdown, this is what it looks like:

Package Specific

Installer Properties

The following install arguments can be passed:

  • ALLUSERS
  • PUPPET_AGENT_ACCOUNT_DOMAIN
  • PUPPET_AGENT_ACCOUNT_USER
  • PUPPET_AGENT_ACCOUNT_PASSWORD
  • PUPPET_MASTER_SERVER
  • PUPPET_AGENT_ENVIRONMENT
  • PUPPET_AGENT_CERTNAME
  • PUPPET_CA_SERVER
  • PUPPET_AGENT_STARTUP_MODE
  • INSTALLDIR
  • INSTALLDIR_X86

To append install arguments to the current silent arguments passed to the installer, use --install-arguments="''" or --install-arguments-sensitive="''". To completely override the silent arguments with your own, also pass --override-arguments. Example: choco install packageId [other options] --install-arguments="'PROPERTY=value PROPERTY2=value2'" To have choco remember parameters on upgrade, be sure to set choco feature enable -n=useRememberedArgumentsForUpgrades.

ferventcoder
  • 11,952
  • 3
  • 57
  • 90
  • 1
    I am following a similar post to try and get the various install options, and i came across using Git-2.15.1.2-64-bit.exe /SAVEINF="C:\git.inf" to generate what looks like the file with the options im after. How would i use these options in chocolatey? Or reference this .inf file? Is it possible? – BLang Dec 28 '17 at 17:14
  • 1
    @BLang From http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline: it appears you can use `/LOADINF`. So it would be `choco install git --install-arguments "'/LOADINF=C:\git.inf'" --override-arguments`. If you need to use `"` in your args, things are shell dependent, see https://chocolatey.org/docs/commands-reference#how-to-pass-options-switches – ferventcoder Dec 31 '17 at 16:00