diff --git a/image_creator/os_type/windows/__init__.py b/image_creator/os_type/windows/__init__.py index a72fcd535c2927cb2ce0130b76db341b39f566d7..1af5990f6c8397ad9d27a457685f39c5305acaf9 100644 --- a/image_creator/os_type/windows/__init__.py +++ b/image_creator/os_type/windows/__init__.py @@ -131,11 +131,6 @@ class Windows(OSBase): raise FatalError( '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) self.last_part_num = self.image.g.part_list(device)[-1]['part_num'] @@ -305,6 +300,12 @@ class Windows(OSBase): def do_sysprep(self): """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: raise FatalError( "Microsoft's System Preparation Tool has ran on the Image. "