docs: def StopPreviousService(self):
      """Stops the Windows service hosting the GRR process."""
      StopService(
          service_name=config.CONFIG["Nanny.service_name"],
          service_binary_name=config.CONFIG["Nanny.service_binary_name"])
  
      if not config.CONFIG["Client.fleetspeak_enabled"]:
        return
  
      StopService(service_name=config.CONFIG["Client.fleetspeak_service_name"])
  
      # Delete GRR's Fleetspeak config from the registry so Fleetspeak
      # doesn't try to restart GRR unless/until installation completes
      # successfully.
      key_path = config.CONFIG["Client.fleetspeak_unsigned_services_regkey"]
      regkey = OpenRegkey(key_path)
      try:
        winreg.DeleteValue(regkey, config.CONFIG["Client.name"])
        logging.info("Deleted value '%s' of key '%s'.",
                     config.CONFIG["Client.name"], key_path)
      except OSError as e:
        # Windows will raise a no-such-file-or-directory error if
        # GRR's config hasn't been written to the registry yet.
        if e.errno != errno.ENOENT:
          raise