'Repack the installer into the payload.
Args:
payload_data: data payload for zip file
output_path: filename for the zip output
Raises:
RuntimeError: if the ClientBuilder.unzipsfx_stub doesn\'t require admin.
Returns:
output_path: filename string of zip output file'

def MakeSelfExtractingZip(self, payload_data, output_path):

    context = (self.context + ['Client    Context'])
    src_zip = zipfile.ZipFile(cStringIO.StringIO(payload_data), mode='r')
    zip_data = cStringIO.StringIO()
    output_zip = zipfile.ZipFile(zip_data, mode='w', compression=zipfile.ZIP_DEFLATED)
    config_file_name = config.CONFIG.Get('ClientBuilder.config_filename', context=context)
    for template_file in src_zip.namelist():
        if (template_file != config_file_name):
            CopyFileInZip(src_zip, template_file, output_zip)
    client_config_content = self.GetClientConfig(context)
    output_zip.writestr(config_file_name, client_config_content, compress_type=zipfile.ZIP_STORED)
    output_zip.comment = ('$AUTORUN$>%s' % config.CONFIG.Get('ClientBuilder.autorun_command_line', context=context))
    output_zip.close()
    utils.EnsureDirExists(os.path.dirname(output_path))
    with open(output_path, 'wb') as fd:
        stub_data = cStringIO.StringIO()
        unzipsfx_stub = config.CONFIG.Get('ClientBuilder.unzipsfx_stub', context=context)
        stub_raw = open(unzipsfx_stub, 'rb').read()
        if ('level="requireAdministrator' not in stub_raw):
            raise RuntimeError('Bad    unzip    binary    in    use.    Not    compiled    with    therequireAdministrator    manifest    option.')
        stub_data.write(stub_raw)
        SetPeSubsystem(stub_data, console=config.CONFIG.Get('ClientBuilder.console', context=context))
        end_of_file = (zip_data.tell() + stub_data.tell())
        offset_to_rsrc = stub_data.getvalue().find('.rsrc')
        stub_data.seek((offset_to_rsrc + 20))
        start_of_rsrc_section = struct.unpack('<I', stub_data.read(4))[0]
        stub_data.seek((offset_to_rsrc + 16))
        stub_data.write(struct.pack('<I', (end_of_file - start_of_rsrc_section)))
        out_data = cStringIO.StringIO()
        out_data.write(stub_data.getvalue())
        out_data.write(zip_data.getvalue())
        fd.write(out_data.getvalue())
    if self.signer:
        self.signer.SignFile(output_path)
    logging.info('Deployable    binary    generated    at    %s', output_path)
    return output_path
