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