> For the complete documentation index, see [llms.txt](https://thorstenkramm.gitbook.io/saltstack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thorstenkramm.gitbook.io/saltstack/salt-fuer-windows/chocolatey-paktemanager.md).

# Chocolatey Paktemanager

Software-Verwaltung einfach gemacht mit einem Packetmanager

Wenn Sie Salt zur Installation von Windows-Software nutzen möchten, ist der [Chocolatey Paketmanager](https://chocolatey.org) sehr hilfreich, weil sehr viele Programme aus einer zuverlässigen Quelle und unbeaufsichtigt installier werden können. Salt biete Module und States zur Softwareinstallation per Chocolatey.&#x20;

### Chocolatey installieren

Falls der Chcolatey Paketmanager nicht installiert ist, können Sie dies vom Salt-Master anstoßen. Per Modul:

```
salt -G "kernel:windows" chocolatey.bootstrap
```

oder per State:

{% code title="/srv/salt/windows/chocolatey-bootstrap.sls" %}

```yaml
#
# Install the chocolatey package manager if missing
# https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html#salt.modules.chocolatey.bootstrap
#
chocolatey.bootstrap:
  module.run:
    - chocolatey.bootstrap:
      - force: True

'C:\ProgramData\chocolatey\bin':
  win_path.exists: []
```

{% endcode %}

### Pakete installieren

Die Installation der Pakete ist denkbar einfach.

{% code title="/srv/salt/windows/utils.sls" %}

```yaml
firefox:
  chocolatey.installed: []

googlechrome:
  chocolatey.installed: []
  
{% for pkg in ['vlc','7zip','notepadplusplus','putty','screenpresso','foxitreader','xnview'] %}
{{ pkg }}:
  chocolatey.installed: []
{% endfor %}

#
# Enable Package upgrades on boot
#
choco-upgrade-all-at-startup:
  chocolatey.installed: []
```

{% endcode %}
