Note: Windows package management *may* be better handled via integration with
Chocolatey and open source package manager for Windows similar to yum
or
apt-get
.
- Product Name:: 7-Zip 16.04 (x64 edition)
- Version
- 16.04.00.0
Product Name and version (inside the MSI) can be found (or changed) using Orca. http://www.7-zip.org/a/7z1604-x64.msi
bundle agent main
{
powershell::
# Install Chocolatey if it's not found.
"Set-ExecutionPolicy -ExecutionPolicy RemoteSigned"
contain => powershell,
unless => fileexists("C:\ProgramData\Chocolatey\bin\choco.exe");
"iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex"
contain => powershell,
unless => fileexists("C:\ProgramData\Chocolatey\bin\choco.exe");
packages:
windows::
"7zip"
package_policy => "add",
package_method => choco;
}
body package_method choco
{
package_changes => "individual";
package_list_command => "C:\ProgramData\Chocolatey\bin\choco.exe list --localonly";
package_list_version_regex => ".*\s+ (.*)";
package_list_name_regex => "^(.*)\s+.*";
package_installed_regex => ".*";
package_add_command => "C:\ProgramData\Chocolatey\bin\choco.exe install -y";
}