Chocolatey: Локальный репозиторий

В публичном (официальном репозитории) присутствуют ограничения на обращение к серверу, т.е. вы не сможете сразу на 20 машин раскидать нужное вам ПО. На локальном репозитории такие ограничения отсутствуют. Просто скачиваете или создаете сами нужный пакет, пушите его на свой сервер и устанавливаете его сколько вам угодно раз.

  • .NET Framework 4.6+.
  • You need a Windows box with at least 50GB of free space (or where ever you are going to put the packages).
  • 50GB of free space for where ever you will put packages.
  • We recommend at least 8GB RAM, but more if you can.
  • Ability to set up an IIS site and unblock website ports.
  • If you have an IIS site for WSUS administration, see Configure Simple Server alongside WSUS admin-site for instructions on how to make Chocolatey Simple Server work alongside the WSUS admin-site.
  • If you can ensure your server is up to date with all of the Windows Updates, you will move through this process quite a bit quicker.

На всякий случай сначала ставим клиент chocolatey (powershell):

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))
Читать дальше

Chocolatey: Пример создания пакета .nupkg

На примере bareos-client.

Описание программы и общие сведения в файле bareos-client.nuspec:

<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if ??? doesn?t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="">
	<!-- Read this before publishing packages to -->
	<authors>Bareos GmbH and Co.KG</authors>
	<owners>Slava Makarov</owners>
	<description>Bareos is a 100% open source fork of the backup project from 
	The fork is in development since late 2010, it has a lot of new features. 
	The source has been published on github, licensed AGPLv3.</description>
	<tags>bareos winbareos admin backup windows</tags>
	<copyright>© Copyright Bareos GmbH and Co. KG. Bareos is a registered Trademark of Bareos GmbH and Co. KG.</copyright>
	<!-- Important note about Files are cached permanently after the first request. Use commit URLs when updating the icon. -->
	  <dependency id="" version="" />
	<releaseNotes>32bit, 64bit.</releaseNotes>
	<file src="tools\**" target="tools" />
Описание процесса установки chocolateyInstall.ps1:

$packageName = 'bareos-client'
$installerType = 'exe'
$url = ''
$url64 = ''
$silentArgs = '/S'
$validExitCodes = @(0)
$checksum      = '3CA9FE7BC67DC042F9F97AB448F05A733502833BFCADE3B26CCEF900545E7FAF'
$checksumType  = 'sha256'
$checksum64    = 'D2880A6110C7A1A42AED7BB97F0BCB176F58427223EFF1C305A183382CFC1055'
$checksumType64= 'sha256'

Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" "$checksum" "$checksumType" "$checksum64" "$checksumType64"  -validExitCodes $validExitCodes
Если надо получить md5 хеш (PowerShell):
Get-FileHash -Path '.\winbareos.msi' -Algorithm SHA256
Пакуем в .nupkg:
cpack -y
Пробная установка из локального пакета:
cinst -fvy .\bareos-client.19.2.7.nupkg
Если всё ок, пушим в репозиторий:
choco push .\bareos-client.19.2.7.nupkg --source