Include game version in linux otr builds (#826)

This commit is contained in:
GaryOderNichts 2022-07-19 01:33:36 +02:00 committed by GitHub
parent 97d1f0e46c
commit 046b7e8949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,15 @@ import os, sys, shutil
import shutil
from rom_info import Z64Rom
import rom_chooser
import struct
def BuildOTR(xmlPath, rom):
shutil.copytree("assets", "Extract/assets")
checksum = int(Z64Rom(rom).checksum.value, 16)
with open("Extract/version", "wb") as f:
f.write(struct.pack('<L', checksum))
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom)