Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing windows features with chocolatey and packages.config

Tags:

chocolatey

I'd like to install a list of windows features, e.g. IIS-WebServerRole, saved in a packages.config using chocolatey.

Listing available windows features gives me the ID's....

choco list --source windowsFeatures
Chocolatey v0.10.8
Deployment Image Servicing and Management tool
Version: 10.0.14393.0
Image Version: 10.0.14393.0
Features listing for package : Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~10.0.14393.0
----------------------------------------------------- | --------
Feature Name                                          | State
----------------------------------------------------- | --------
IIS-WebServerRole                                     | Enabled
IIS-WebServer                                         | Enabled
...

Putting these ID's in a packages.config and setting the source attribute:

<?xml version="1.0" encoding="utf-8"?>
  <packages>
    <package id="IIS-WebServerRole" source="windowsfeatures" />
    <package id="IIS-Security" source="windowsfeatures" />
    </packages>
</xml>

Installing via gives me the error message:

choco install .\packages.config --yes --acceptlicense
Chocolatey v0.10.8
Installing from config file:
.\packages.config
By installing you accept licenses for the packages.
Installing the following packages:
IIS-WebServerRole
IIS-Security
IIS-WebServerRole not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"
IIS-Security not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"

Chocolatey installed 0/2 packages. 2 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - IIS-Security - IIS-Security not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"
 - IIS-WebServerRole - IIS-WebServerRole not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"

Is it possible to install windows features listed in a package.config?

like image 586
Lasse Normann Avatar asked Mar 07 '23 17:03

Lasse Normann


2 Answers

UPDATE:

The bug has been addressed and a new version of Chocolatey v0.11.3 has been released.

ORIGINAL ANSWER:

This should be possible, however, there is a known issue in this area.

This is being tracked here:

https://github.com/chocolatey/choco/issues/877

I would suggest subscribing to that issue for updates on changes.

like image 130
Gary Ewan Park Avatar answered May 16 '23 06:05

Gary Ewan Park


By default, chocolatey searches for packages in its data center. You are trying to enable a Windows feature here and not a software/application. Use the below command to run.

choco install .\choco_iis.config --yes --acceptlicense -s windowsfeatures
like image 27
ganesh aradhya Avatar answered May 16 '23 07:05

ganesh aradhya