Skip to content
Snippets Groups Projects
Commit a1975370 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Check for Winexe when customizing

We used to check for the presence of the winexe executable in the
Windows __init__ function. This is not optimal. The winexe check
should be done during customization. The user should be able to
dump, upload or register an image without having Winexe installed.
parent ad3e1ed3
No related branches found
No related tags found
No related merge requests found
...@@ -131,11 +131,6 @@ class Windows(OSBase): ...@@ -131,11 +131,6 @@ class Windows(OSBase):
raise FatalError( raise FatalError(
'For windows support libguestfs 1.16.11 or above is required') 'For windows support libguestfs 1.16.11 or above is required')
# Check if winexe is installed
if not WinEXE.is_installed():
raise FatalError(
"For windows support `Winexe' needs to be installed")
device = self.image.g.part_to_dev(self.root) device = self.image.g.part_to_dev(self.root)
self.last_part_num = self.image.g.part_list(device)[-1]['part_num'] self.last_part_num = self.image.g.part_list(device)[-1]['part_num']
...@@ -305,6 +300,12 @@ class Windows(OSBase): ...@@ -305,6 +300,12 @@ class Windows(OSBase):
def do_sysprep(self): def do_sysprep(self):
"""Prepare system for image creation.""" """Prepare system for image creation."""
# Check if winexe is installed
if not WinEXE.is_installed():
raise FatalError(
"Winexe not found! In order to be able to customize a Windows "
"image you need to have Winexe installed.")
if self.syspreped: if self.syspreped:
raise FatalError( raise FatalError(
"Microsoft's System Preparation Tool has ran on the Image. " "Microsoft's System Preparation Tool has ran on the Image. "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment