I created a package from an MSI. However, I need to pass in custom parameters.
/i SERVER='xx.yyy.com
Here are the few things I tried by reading the choco command spec, but none worked.
> choco install foo -y --params "SERVER='xx.yyy.com'"
> choco install foo -y --params "SERVER=xx.yyy.com"
> choco install foo -y --params "SERVER= xx.yyy.com"
How do I pass the install options to the installer?
If you are passing to the native installer, please use --install-arguments
and not --package-parameters
.
https://chocolatey.org/docs/commands-install#options-and-switches
--ia, --installargs, --installarguments, --install-arguments=VALUE
InstallArguments - Install Arguments to pass to the native installer in
the package. Defaults to unspecified.
-o, --override, --overrideargs, --overridearguments, --override-arguments
OverrideArguments - Should install arguments be used exclusively without
appending to current package passed arguments? Defaults to false.
--params, --parameters, --pkgparameters, --packageparameters, --package-parameters=VALUE
PackageParameters - Parameters to pass to the package. Defaults to
unspecified.
Additionally, you may want to explore the documentation on how to pass options and switches - https://chocolatey.org/docs/commands-reference#how-to-pass-options-switches:
"'value'"
). In cmd.exe you can just use double quotes
("value"
) but in powershell.exe you should use backticks ( `"value`")
or apostrophes ('value'
). Using the combination allows for both
shells to work without issue, except for when the next section
applies. "/yo=""Spaces spaces"""
. In PowerShell.exe, you must pass it like
this: -ia '/yo=""Spaces spaces""'
. No other combination will work. In
PowerShell.exe if you are on version v3+, you can try --%
before -ia
to just pass the args through as is, which means it should not
require any special workarounds.