2017-08-03 10:05:50 +02:00
|
|
|
# QEMU Guest Agent
|
2021-05-17 18:10:52 +02:00
|
|
|
# 2016-2021 foo.li systeme + software
|
2020-05-10 15:53:28 +02:00
|
|
|
|
2017-08-03 10:05:50 +02:00
|
|
|
$packageName = 'qemu-guest-agent'
|
2021-12-30 15:20:25 +01:00
|
|
|
$version = '102.7.0'
|
2017-08-03 10:05:50 +02:00
|
|
|
$installerType = 'msi'
|
2021-12-30 15:20:25 +01:00
|
|
|
$url = 'https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-' + $version + '-0-el8/qemu-ga-x86.msi'
|
|
|
|
$url64 = 'https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-' + $version + '-0.el8/qemu-ga-x86_64.msi'
|
2017-08-03 10:05:50 +02:00
|
|
|
$silentArgs = '/qb'
|
|
|
|
$packageSearch = 'QEMU guest agent*'
|
2021-12-30 15:20:25 +01:00
|
|
|
$checksum = '52dd465b996b1f9ec7e83e64a7f2e147a07f886c'
|
2017-08-03 10:05:50 +02:00
|
|
|
$checksumType = 'sha1'
|
2021-12-30 15:20:25 +01:00
|
|
|
$checksum64 = '0d16fcde5d183fba5ca00be47e13c50d00aa5580'
|
2017-08-03 10:05:50 +02:00
|
|
|
$checksumType64 = $checksumType
|
|
|
|
$validExitCodes = @(0,3010)
|
|
|
|
|
|
|
|
$compmanu = Get-WmiObject Win32_ComputerSystem | select manufacturer
|
|
|
|
if ($compmanu.manufacturer -like '*Bochs*') { Write-Host 'QEMU/KVM detected' }
|
2020-05-10 15:53:28 +02:00
|
|
|
elseif ($compmanu.manufacturer -like '*QEMU*'){ Write-Host 'QEMU/KVM detected' }
|
|
|
|
else {
|
2017-08-03 10:05:50 +02:00
|
|
|
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)) {
|
2020-05-10 15:53:28 +02:00
|
|
|
Write-Host 'QEMU Guest Agent' $version 'or higher is already installed. Doing nothing.'
|
2017-08-03 10:05:50 +02:00
|
|
|
} else {
|
|
|
|
Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 `
|
|
|
|
-checksum $checksum -checksumType $checksumType `
|
|
|
|
-checksum64 $checksum64 -checksumType64 $checksumType64 `
|
|
|
|
-validExitCodes $validExitCodes
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
throw $_.Exception
|
|
|
|
}
|