Skip to content

Commit

Permalink
simplify header extraction and satisfy my customers
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 19, 2024
1 parent 69bd639 commit e17ed51
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions refinery/units/formats/archive/xtnsis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ def bzipcheck(p):

xtnsis.log_debug(F'read header of length {len(header_data)}')

self.header_data = header_data
self.header = NSHeader(header_data, size=header_size, extended=self.extended)
self.reader = reader

Expand Down Expand Up @@ -1345,12 +1346,7 @@ def info():
for item in arc.header.items:
yield self._pack(item.path, item.mtime, lambda i=item: arc._extract_item(i).data)

with MemoryFile() as bin:
for opc in arc.header.instructions:
bin.write(opc.get_data())
yield self._pack('$HEADER/opcodes.bin', None, bin.getvalue())

yield self._pack('$HEADER/strings.bin', None, arc.header.string_data)
yield self._pack('setup.bin', None, arc.header_data)
yield self._pack('setup.nsis', None, arc.script.encode(self.codec))

@classmethod
Expand Down

0 comments on commit e17ed51

Please sign in to comment.