diff --git a/build.bat b/build.bat index 398a580..d337cea 100644 --- a/build.bat +++ b/build.bat @@ -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 diff --git a/build.py b/build.py index 9492b2f..3b7a548 100644 --- a/build.py +++ b/build.py @@ -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") diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..e2cac26 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.2.3 \ No newline at end of file