QEMU Guest Agent for Windose

This commit is contained in:
Peter V. Beck 2017-08-03 10:05:50 +02:00
parent 6fa2629096
commit 0bb70e95c8
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>qemu-guest-agent</id>
<version>7.4.5</version>
<title>QEMU guest agent</title>
<authors>Red Hat</authors>
<owners>foo.li systeme + software</owners>
<licenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html</licenseUrl>
<projectUrl>https://fedoraproject.org/wiki/Windows_Virtio_Drivers</projectUrl>
<iconUrl>https://raw.githubusercontent.com/peterbeck/chocolatey/master/icons/kvm.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>It is a daemon program running inside the domain which is supposed to help management applications with executing functions which need assistance of the guest OS. For example, freezing and thawing filesystems, entering suspend. However, guest agent (GA) is not bullet proof, and hostile guest OS can send spurious replies.</description>
<summary>QEMU Guest Agent</summary>
<releaseNotes>initial package</releaseNotes>
<tags>virtualisation kvm qemu guest-agent</tags>
</metadata>
</package>

View File

@ -0,0 +1,40 @@
# QEMU Guest Agent
# 2016-2017 foo.li systeme + software
$packageName = 'qemu-guest-agent'
$version = '7.4.5'
$installerType = 'msi'
$url = 'https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-' + $version + '-1/qemu-ga-x86.msi'
$url64 = 'https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-' + $version + '-1/qemu-ga-x64.msi'
$silentArgs = '/qb'
$packageSearch = 'QEMU guest agent*'
$checksum = 'A5BDE210C45BC81600ABAE438D31B6BB6DF93F3C'
$checksumType = 'sha1'
$checksum64 = '09D19C994EFA3FA41C4FE8EF249226CEB7EA0BAE'
$checksumType64 = $checksumType
$validExitCodes = @(0,3010)
$compmanu = Get-WmiObject Win32_ComputerSystem | select manufacturer
if ($compmanu.manufacturer -like '*Bochs*') { Write-Host 'QEMU/KVM detected' }
elseif ($compmanu.manufacturer -like '*QEMU*'){ Write-Host 'QEMU/KVM detected' }
else {
Write-Host 'could not detect QEMU/KVM virtual machine. Stopping deployment'
throw 'no KVM/QEMU VM detected'
}
try {
$app = Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*') `
-ErrorAction:SilentlyContinue | Where-Object { $_.DisplayName -like $packageSearch }
if ($app -and ([version]$app.DisplayVersion -ge [version]$version)) {
Write-Host 'QEMU Guest Agent' $version 'or higher is already installed. Doing nothing.'
} else {
Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 `
-checksum $checksum -checksumType $checksumType `
-checksum64 $checksum64 -checksumType64 $checksumType64 `
-validExitCodes $validExitCodes
}
} catch {
throw $_.Exception
}