'Start.'

@flow.StateHandler()
def Start(self):

    blob_path = self.args.blob_path
    if (not blob_path):
        client = aff4.FACTORY.Open(self.client_id, token=self.token)
        client_platform = client.Get(client.Schema.SYSTEM)
        if (not client_platform):
            raise RuntimeError("Can't    determine    client    platform,    please    specify.")
        blob_urn = ('aff4:/config/executables/%s/agentupdates' % self.system_platform_mapping[client_platform])
        blob_dir = aff4.FACTORY.Open(blob_urn, token=self.token)
        updates = sorted(list(blob_dir.ListChildren()))
        if (not updates):
            raise RuntimeError('No    matching    updates    found,    please    specify    one    manually.')
        blob_path = updates[(-1)]
    if (not (('windows' in utils.SmartStr(self.args.blob_path)) or ('darwin' in utils.SmartStr(self.args.blob_path)) or ('linux' in utils.SmartStr(self.args.blob_path)))):
        raise RuntimeError('Update    not    supported    for    this    urn,    use    aff4:/config/executables/<platform>/agentupdates/<version>')
    aff4_blobs = aff4.FACTORY.Open(blob_path, token=self.token)
    if (not isinstance(aff4_blobs, collects.GRRSignedBlob)):
        raise RuntimeError(('%s    is    not    a    valid    GRRSignedBlob.' % blob_path))
    offset = 0
    write_path = ('%d_%s' % (time.time(), aff4_blobs.urn.Basename()))
    for (i, blob) in enumerate(aff4_blobs):
        self.CallClient(server_stubs.UpdateAgent, executable=blob, more_data=(i < (aff4_blobs.chunks - 1)), offset=offset, write_path=write_path, next_state=discovery.Interrogate.__name__, use_client_env=False)
        offset += len(blob.data)
