Skip to content

Commit

Permalink
Update build process, add 64 bit build support
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Mar 22, 2019
1 parent 4ad8946 commit 86aec59
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
9 changes: 6 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

pyinstaller extract_models.spec
pyinstaller pack_player.spec
py -3.6-32 -m PyInstaller extract_models.spec
py -3.6-32 -m PyInstaller pack_player.spec
py -3.6-32 build.py

py -3 build.py
py -3.6-64 -m PyInstaller extract_models.spec
py -3.6-64 -m PyInstaller pack_player.spec
py -3.6-64 build.py
29 changes: 26 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@

import os
from zipfile import ZipFile

with ZipFile("./dist/WW_Model_Helpers.zip", "w") as zip:
zip.write("./dist/extract_models.exe", arcname="extract_models.exe")
zip.write("./dist/pack_player.exe", arcname="pack_player.exe")
with open("version.txt", "r") as f:
version_number = f.read().strip()

base_zip_name = "WW Model Helpers"
base_zip_name = base_zip_name + " " + version_number

import struct
if (struct.calcsize("P") * 8) == 64:
bits_number = "_64bit"
else:
bits_number = "_32bit"
base_zip_name += bits_number

zip_name = base_zip_name.replace(" ", "_") + ".zip"

extract_models_exe_path = "./dist/extract_models.exe"
if not os.path.isfile(extract_models_exe_path):
raise Exception("Executable not found: %s" % exe_path)
pack_player_exe_path = "./dist/pack_player.exe"
if not os.path.isfile(pack_player_exe_path):
raise Exception("Executable not found: %s" % exe_path)

with ZipFile("./dist/" + zip_name, "w") as zip:
zip.write(extract_models_exe_path, arcname="extract_models.exe")
zip.write(pack_player_exe_path, arcname="pack_player.exe")

zip.write("README.md")
zip.write("generate_previews_README.md")
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.3

0 comments on commit 86aec59

Please sign in to comment.