How to use custom options in chocolate .config file?

I use chocolatey to install git with options, and this works fine on the command line:

choco install git -params '"/GitOnlyOnPath /NoAutoCrlf"' 

Now I want to put this in my .config file, where it does not work. Here is an example of how I could configure it:

 <?xml version="1.0" encoding="utf-8"?> <packages> <package id="git" params="/GitOnlyOnPath /NoAutoCrlf"/> </packages> 

This will install git successfully, but ignore the arguments: autocrlf is still true .

The documentation and most sources cover only the version and location attributes for package objects. So (how) is it possible to configure custom parameters inside a .config file?

+7
chocolatey
source share
2 answers

I’m not quite sure that I agree with your argument that the documentation does not apply to this, but maybe it is difficult to find it? We have this in the installation article, since you can call package.config.

https://github.com/chocolatey/choco/wiki/CommandsInstall#packagesconfig

Included here:

 <?xml version="1.0" encoding="utf-8"?> <packages> <package id="apackage" /> <package id="anotherPackage" version="1.1" /> <package id="chocolateytestpackage" version="0.1" source="somelocation" /> <package id="alloptions" version="0.1.1" source="https://somewhere/api/v2/" installArguments="" packageParameters="" forceX86="false" allowMultipleVersions="false" ignoreDependencies="false" /> </packages> 

Always try to check the documentation in the choco wiki - it is the most current. In addition, Chocolatey packages.config not like NuGet packages.config .

+7
source share

I want to install SQL Server Express through a configuration file. However, the installation failed because my arguments are incorrect. Where did I make a mistake?

 <?xml version="1.0" encoding="utf-8"?> <packages> <package id="sqlserver2012express-engine" installArguments="/INDICATEPROGRESS /INSTANCENAME=MyInstance /SECURITYMODE=SQL /SAPWD=myPassword2017 /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /SQLSVCACCOUNT=.\sqladmin /SQLSYSADMINACCOUNTS=BUILTIN\ADMINISTRATORS /AGTSVCACCOUNT=.\sqladmin" /> </packages> 
0
source share

All Articles