Skip to content

Commit

Permalink
install the UltraVNC mirror video driver
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Jan 10, 2019
1 parent dfd63b9 commit c7ee165
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UltraVNC.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PollForeground=0
PollFullScreen=1
OnlyPollConsole=0
OnlyPollOnEvent=0
EnableDriver=0
EnableDriver=1
EnableHook=1
EnableVirtual=0
SingleWindow=0
Expand Down
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Vagrant.configure('2') do |config|
config.vm.hostname = "windows#{i}"
config.vm.network :private_network, ip: "10.10.10.10#{i}", libvirt__forward_mode: 'route', libvirt__dhcp_enabled: false
config.vm.provision :shell, inline: "'#{hosts}' | Out-File -Encoding Ascii -Append c:/Windows/System32/drivers/etc/hosts"
config.vm.provision :shell, path: 'ps.ps1', args: 'provision-ultravnc-mirror-driver.ps1'
config.vm.provision :reload
config.vm.provision :shell, path: 'ps.ps1', args: 'provision-common.ps1'
config.vm.provision :shell, path: 'ps.ps1', args: 'provision-certificates.ps1'
config.vm.provision :shell, path: 'ps.ps1', args: 'provision-ultravnc.ps1'
Expand Down
27 changes: 27 additions & 0 deletions provision-ultravnc-mirror-driver.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$ultraVncMirrorDriverHome = "C:\Program Files\uvnc bvba\UltraVncMirrorDriver"
$archiveUrl = 'http://sc.uvnc.com/drivers.zip'
$archiveHash = '67001c8f5a37c1ccd2d1750f21e28d372a8639c330aafbae111a5956c942b71a'
$archiveName = Split-Path $archiveUrl -Leaf
$archivePath = "$env:TEMP\$archiveName"

Write-Host 'Downloading mirror driver...'
(New-Object Net.WebClient).DownloadFile($archiveUrl, $archivePath)
$archiveActualHash = (Get-FileHash $archivePath -Algorithm SHA256).Hash
if ($archiveHash -ne $archiveActualHash) {
throw "$archiveName downloaded from $archiveUrl to $archivePath has $archiveActualHash hash witch does not match the expected $archiveHash"
}

Write-Host 'Installing mirror driver...'
Expand-Archive $archivePath -DestinationPath $ultraVncMirrorDriverHome
Rename-Item "$ultraVncMirrorDriverHome\driver" "$ultraVncMirrorDriverHome\tmp"
Move-Item "$ultraVncMirrorDriverHome\tmp\vista64\*" $ultraVncMirrorDriverHome
Remove-Item -Recurse -Force "$ultraVncMirrorDriverHome\tmp"
$catPath = "$ultraVncMirrorDriverHome\driver\mv2.cat"
$cerPath = $catPath.Replace('.cat', '.cer')
$certificate = (Get-AuthenticodeSignature $catPath).SignerCertificate
[System.IO.File]::WriteAllBytes($cerPath, $certificate.Export('Cert'))
Import-Certificate -CertStoreLocation Cert:\LocalMachine\TrustedPublisher $cerPath | Out-Null
Push-Location $ultraVncMirrorDriverHome
.\setupdrv.exe install | Out-String -Stream
Pop-Location
Remove-Item $archivePath

0 comments on commit c7ee165

Please sign in to comment.