Chocolatey - Optional Packages with user-confirmation in packages.config

117 Views Asked by At

Is there a way to specify an optional package in packages.config file which enables user confirmation before installing an application?

For Example, If I have 3 PC's, I would like to install "VSCode" in 2 of them, but not in the 3rd PC. So, to help with this, is there a way for me to optinoally mention or choose which apps to be "installed" or "not installed" during batch installation from packages.config?

If not in Chocolatey, is there a similar feature in other Windows Package managers?

1

There are 1 best solutions below

0
On

What you are describing is a process of Configuration Management, not package installation. You should use a tool such as Chef, SaltStack, Ansible, SCCM, DSC, etc. to define requirements for your infrastructure. You would define packages to install on guests based on those requirements using configuration management tools, but trying to use a package to handle this for you is really against what a package is meant to define, which is a single piece of software and optionally a collection of dependencies to install based on the requirements of the original package.

Yes, you could cobble something together to do this with Chocolatey and package parameters (search --package-parameters to see the argument to pass in for custom parameters defined in a package you create) or any other package format but it is not a cohesive solution. I am not aware of a way to define this behavior using packages.config, either. I highly recommend against taking this approach and use an appropriate tool for configuration management.