Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image-creator
Commits
67600135
Commit
67600135
authored
Jul 07, 2014
by
Nikos Skalkotos
Browse files
windows: Hide VirtIO driver installation window
Hide the powershell InstallDrivers.ps1 window if supported
parent
ee7b11a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
image_creator/os_type/windows/__init__.py
View file @
67600135
...
...
@@ -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
=
(
'%(drive)s:%(root)s
\\
System32
\\
WindowsPowerShell
\\
v1.0
\\
'
'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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment