feat: VirtualBox.ExtensionPack 4.2.16
- uses VBoxManage to control VirtualBox
This commit is contained in:
27
VirtualBox.ExtensionPack/VirtualBox.ExtensionPack.nuspec
Normal file
27
VirtualBox.ExtensionPack/VirtualBox.ExtensionPack.nuspec
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>VirtualBox.ExtensionPack</id>
|
||||||
|
<title>VirtualBox Extension Pack</title>
|
||||||
|
<version>4.2.16.86992</version>
|
||||||
|
<authors>Oracle Corporation, Innotek</authors>
|
||||||
|
<owners>Ethan J Brown</owners>
|
||||||
|
<summary>VirtualBox Extension Pack adds Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards.</summary>
|
||||||
|
<description>Oracle VM VirtualBox is a general-purpose full virtualizer for hardware. Targeted at server, desktop and embedded use, Oracle VM VirtualBox is now the only professional-quality virtualization solution that is also Open Source Software.
|
||||||
|
|
||||||
|
VirtualBox Extension Pack adds Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards.
|
||||||
|
|
||||||
|
https://www.virtualbox.org/manual/ch01.html#intro-installing
|
||||||
|
</description>
|
||||||
|
<releaseNotes>https://www.virtualbox.org/wiki/Changelog</releaseNotes>
|
||||||
|
<projectUrl>https://www.virtualbox.org/</projectUrl>
|
||||||
|
<tags>virtualbox vmware virtualization vm</tags>
|
||||||
|
<licenseUrl>https://www.virtualbox.org/wiki/VirtualBox_PUEL</licenseUrl>
|
||||||
|
<copyright>Oracle Corporation</copyright>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<iconUrl>https://github.com/Iristyle/ChocolateyPackages/raw/master/VirtualBox.ExtensionPack/VirtualBox_logo.png</iconUrl>
|
||||||
|
<dependencies>
|
||||||
|
<dependency id="VirtualBox" version="[4.2.16,4.2.16]" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
</package>
|
BIN
VirtualBox.ExtensionPack/VirtualBox_logo.png
Normal file
BIN
VirtualBox.ExtensionPack/VirtualBox_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
63
VirtualBox.ExtensionPack/tools/chocolateyInstall.ps1
Normal file
63
VirtualBox.ExtensionPack/tools/chocolateyInstall.ps1
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
$package = 'VirtualBox.ExtensionPack'
|
||||||
|
$version = '4.2.16'
|
||||||
|
$build = '86992'
|
||||||
|
$packName = "Oracle_VM_VirtualBox_Extension_Pack-$version-$build.vbox-extpack"
|
||||||
|
$packUrl = "http://download.virtualbox.org/virtualbox/$version/$packName"
|
||||||
|
|
||||||
|
try {
|
||||||
|
# simulate the unix command for finding things in path
|
||||||
|
# http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell
|
||||||
|
function Which([string]$cmd)
|
||||||
|
{
|
||||||
|
Get-Command -ErrorAction "SilentlyContinue" $cmd |
|
||||||
|
Select -ExpandProperty Definition
|
||||||
|
}
|
||||||
|
|
||||||
|
function Install-ExtensionPack([string] $url)
|
||||||
|
{
|
||||||
|
$vboxManageDefault = Join-Path $Env:ProgramFiles 'Oracle\VirtualBox\VBoxManage.exe'
|
||||||
|
|
||||||
|
$vboxManage = (Which VBoxManage),
|
||||||
|
$vboxManageDefault |
|
||||||
|
? { Test-Path $_ } |
|
||||||
|
Select -First 1
|
||||||
|
|
||||||
|
if (!$vboxManage)
|
||||||
|
{
|
||||||
|
throw 'Could not find VirtualBox VBoxManage.exe to install extension pack with'
|
||||||
|
}
|
||||||
|
|
||||||
|
$fileName = $url -split '/' | Select -Last 1
|
||||||
|
$appTemp = Join-Path $Env:Temp $package
|
||||||
|
if (!(Test-Path $appTemp))
|
||||||
|
{
|
||||||
|
New-Item $appTemp -Type Directory
|
||||||
|
}
|
||||||
|
$packageTemp = Join-Path $appTemp $fileName
|
||||||
|
Get-ChocolateyWebFile -url $url -fileFullPath $packageTemp
|
||||||
|
|
||||||
|
Push-Location $appTemp
|
||||||
|
&$vboxManage extpack install --replace $packName
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
|
||||||
|
Install-ExtensionPack $packUrl
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0)
|
||||||
|
{
|
||||||
|
Write-ChocolateyFailure $package @"
|
||||||
|
Due to a VirtualBox bug, VBoxManage appears unresponsive.
|
||||||
|
|
||||||
|
Please reboot the machine, and reinstall this packge with the -force switch.
|
||||||
|
|
||||||
|
cinst $package -force
|
||||||
|
"@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-ChocolateySuccess $package
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||||
|
throw
|
||||||
|
}
|
50
VirtualBox.ExtensionPack/tools/chocolateyUninstall.ps1
Normal file
50
VirtualBox.ExtensionPack/tools/chocolateyUninstall.ps1
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
$package = 'VirtualBox.ExtensionPack'
|
||||||
|
$vboxName = 'Oracle VM VirtualBox Extension Pack'
|
||||||
|
|
||||||
|
try {
|
||||||
|
# simulate the unix command for finding things in path
|
||||||
|
# http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell
|
||||||
|
function Which([string]$cmd)
|
||||||
|
{
|
||||||
|
Get-Command -ErrorAction "SilentlyContinue" $cmd |
|
||||||
|
Select -ExpandProperty Definition
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-ExtensionPack([string] $name)
|
||||||
|
{
|
||||||
|
$vboxManageDefault = Join-Path $Env:ProgramFiles 'Oracle\VirtualBox\VBoxManage.exe'
|
||||||
|
|
||||||
|
$vboxManage = (Which VBoxManage),
|
||||||
|
$vboxManageDefault |
|
||||||
|
? { Test-Path $_ } |
|
||||||
|
Select -First 1
|
||||||
|
|
||||||
|
if (!$vboxManage)
|
||||||
|
{
|
||||||
|
throw 'Could not find VirtualBox VBoxManage.exe necessary to install extension pack'
|
||||||
|
}
|
||||||
|
|
||||||
|
&$vBoxManage extpack uninstall `"$name`"
|
||||||
|
}
|
||||||
|
|
||||||
|
Uninstall-ExtensionPack $vboxName
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0)
|
||||||
|
{
|
||||||
|
Write-ChocolateyFailure $package @"
|
||||||
|
Due to a VirtualBox bug, VBoxManage appears unresponsive.
|
||||||
|
|
||||||
|
Please reboot the machine, and attempt to uninstall the VirtualBox extension pack
|
||||||
|
using the command line:
|
||||||
|
|
||||||
|
VBoxManage extpack uninstall `"$vboxName`"
|
||||||
|
"@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-ChocolateySuccess $package
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||||
|
throw
|
||||||
|
}
|
Reference in New Issue
Block a user