#include "stream/file.hpp" #include #include #include #include "setup/data.hpp" #include "setup/version.hpp" #include "stream/checksum.hpp" #include "stream/exefilter.hpp" namespace io = boost::iostreams; namespace stream { file_reader::pointer file_reader::get(base_type & base, const setup::data_entry & location, const inno_version & version, crypto::checksum * checksum) { boost::shared_ptr result = boost::make_shared(); result->push(stream::checksum_filter(checksum, location.checksum.type), 8192); if(location.options & setup::data_entry::CallInstructionOptimized) { if(version < INNO_VERSION(5, 2, 0)) { result->push(inno_exe_decoder_4108(), 8192); } else { result->push(inno_exe_decoder_5200(version >= INNO_VERSION(5, 3, 9)), 8192); } } result->push(io::restrict(base, 0, int64_t(location.file_size))); return result; } } // namespace stream