"""Encapsulates information pertaining to WinPE during the image."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import functools
from glazier.lib import registry


@functools.lru_cache()
def check_winpe() -> bool:
  """Verify image environment is WinPE or Host.

  Returns:
    True for WinPE, else False.
  """
  value = registry.get_value(
      'EditionID', 'HKLM', r'SOFTWARE\Microsoft\Windows NT\CurrentVersion',
      log=False)
  if value == 'WindowsPE':
    return True
  else:
    return False
