original_docstring: Prepares setup.exe for bundling in mini_installer based on options.
docstring: Prepares setup.exe for bundling in mini_installer based on options.
docstring_tokens: Prepares setup . exe for bundling in mini_installer based on options .
code: def PrepareSetupExec(options, staging_dir, current_version, prev_version):
    """Prepares setup.exe for bundling in mini_installer based on options."""
    if options.setup_exe_format == "FULL":
      setup_file = SETUP_EXEC
    elif options.setup_exe_format == "DIFF":
      if not options.last_chrome_installer:
        raise Exception(
            "To use DIFF for setup.exe, --last_chrome_installer is needed.")
      prev_setup_file = os.path.join(options.last_chrome_installer, SETUP_EXEC)
      new_setup_file = os.path.join(options.output_dir, SETUP_EXEC)
      patch_file = os.path.join(options.output_dir, SETUP_PATCH_FILE_PREFIX +
                                                    PATCH_FILE_EXT)
      GenerateDiffPatch(options, prev_setup_file, new_setup_file, patch_file)
      setup_file = SETUP_PATCH_FILE_PREFIX + '_' + current_version + \
                   '_from_' + prev_version + COMPRESSED_FILE_EXT
      setup_file_path = os.path.join(options.output_dir, setup_file)
      CompressUsingLZMA(options.output_dir, setup_file_path, patch_file)
    else:
      cmd = 'makecab.exe /D CompressionType=LZX /V1 /L "%s" "%s"' % (
          options.output_dir, os.path.join(options.output_dir, SETUP_EXEC))
      RunSystemCommand(cmd)
      setup_file = SETUP_EXEC[:len(SETUP_EXEC) - 1] + "_"
    return setup_file
code_tokens: def PrepareSetupExec ( options , staging_dir , current_version , prev_version ) : if options . setup_exe_format == "FULL" : setup_file = SETUP_EXEC elif options . setup_exe_format == "DIFF" : if not options . last_chrome_installer : raise Exception ( "To use DIFF for setup.exe, --last_chrome_installer is needed." ) prev_setup_file = os . path . join ( options . last_chrome_installer , SETUP_EXEC ) new_setup_file = os . path . join ( options . output_dir , SETUP_EXEC ) patch_file = os . path . join ( options . output_dir , SETUP_PATCH_FILE_PREFIX + PATCH_FILE_EXT ) GenerateDiffPatch ( options , prev_setup_file , new_setup_file , patch_file ) setup_file = SETUP_PATCH_FILE_PREFIX + '_' + current_version + '_from_' + prev_version + COMPRESSED_FILE_EXT setup_file_path = os . path . join ( options . output_dir , setup_file ) CompressUsingLZMA ( options . output_dir , setup_file_path , patch_file ) else : cmd = 'makecab.exe /D CompressionType=LZX /V1 /L "%s" "%s"' % ( options . output_dir , os . path . join ( options . output_dir , SETUP_EXEC ) ) RunSystemCommand ( cmd ) setup_file = SETUP_EXEC [ : len ( SETUP_EXEC ) - 1 ] + "_" return setup_file
short_docstring: Prepares setup.exe for bundling in mini_installer based on options.
short_docstring_tokens: Prepares setup . exe for bundling in mini_installer based on options .
comment: """Prepares setup.exe for bundling in mini_installer based on options."""