Commit 67600135 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

windows: Hide VirtIO driver installation window

Hide the powershell InstallDrivers.ps1 window if supported
parent ee7b11a6
......@@ -800,13 +800,18 @@ class Windows(OSBase):
self.image.g.write(remotedir + "/InstallDrivers.ps1",
drvs_install.replace('\n', '\r\n'))
# The -windowstyle option was introduced in PowerShell V2. We need
# to have at least Windows NT 6.1 (Windows 7 or Windows 2008R2) to
# make this work.
hidden_support = self.check_version(6, 1) >= 0
cmd = (
'powershell.exe -ExecutionPolicy RemoteSigned -File '
'%(drive)s:%(root)s\\VirtIO\\InstallDrivers.ps1 '
'powershell.exe -ExecutionPolicy RemoteSigned %(hidden)s '
'-File %(drive)s:%(root)s\\VirtIO\\InstallDrivers.ps1 '
'%(drive)s:%(root)s\\Virtio' %
{'root': self.systemroot.replace('/', '\\'),
'drive': self.systemdrive})
'drive': self.systemdrive,
'hidden': '-windowstyle hidden' if hidden_support else ""})
# The value name of RunOnce keys can be prefixed with an asterisk
# (*) to force the program to run even in Safe mode.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment