[+] splash support
This commit is contained in:
parent
ed5ee5dad1
commit
2d0fca9845
@ -8,11 +8,16 @@ from .patchers import patch_core_build
|
|||||||
from .patchers import patch_metadata
|
from .patchers import patch_metadata
|
||||||
from .config import *
|
from .config import *
|
||||||
|
|
||||||
product_name = "None" # Автоматически берется из metadata
|
product_name = "None" # Читается из metadata
|
||||||
|
icon = "" # Читается из metadata
|
||||||
|
splash = "" # Читается из metadata
|
||||||
|
|
||||||
def get_pyinstaller_cmd():
|
def get_pyinstaller_cmd():
|
||||||
|
splash_str = ""
|
||||||
|
if splash:
|
||||||
|
splash_str = f'--splash {path_fix + splash} '
|
||||||
pyinstaller_cmd = \
|
pyinstaller_cmd = \
|
||||||
(f'pyinstaller --noconfirm --onedir --console --clean '
|
(f'pyinstaller --noconfirm --onedir --console --clean {splash_str}'
|
||||||
f'--icon {path_fix + icon} --version-file {path_fix + metadata_path_txt} --name {product_name}'
|
f'--icon {path_fix + icon} --version-file {path_fix + metadata_path_txt} --name {product_name}'
|
||||||
f'{"".join([f' --add-data {path_fix + d}' for d in data])} '
|
f'{"".join([f' --add-data {path_fix + d}' for d in data])} '
|
||||||
f'--workpath {workpath} --distpath {distpath} --specpath {specpath} '
|
f'--workpath {workpath} --distpath {distpath} --specpath {specpath} '
|
||||||
@ -101,9 +106,9 @@ def cleanup():
|
|||||||
os.makedirs(build_dir, exist_ok=True)
|
os.makedirs(build_dir, exist_ok=True)
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
global product_name, icon
|
global product_name, icon, splash
|
||||||
new_ver = patch_core_build()
|
new_ver = patch_core_build()
|
||||||
old_ver, product_name, icon = patch_metadata(*new_ver)
|
old_ver, product_name, icon, splash = patch_metadata(*new_ver)
|
||||||
logger.info("Building...")
|
logger.info("Building...")
|
||||||
# subprocess.run(['auto-py-to-exe', '--config', build_json_path], shell=True)
|
# subprocess.run(['auto-py-to-exe', '--config', build_json_path], shell=True)
|
||||||
subprocess.run(get_pyinstaller_cmd())
|
subprocess.run(get_pyinstaller_cmd())
|
||||||
|
@ -15,6 +15,7 @@ build_json_path = './win/build.json'
|
|||||||
main = 'src/main.py'
|
main = 'src/main.py'
|
||||||
product_name = "None" # Читается из metadata
|
product_name = "None" # Читается из metadata
|
||||||
icon = "" # Читается из metadata
|
icon = "" # Читается из metadata
|
||||||
|
splash = "" # Читается из metadata
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
path_fix = os.path.abspath(os.path.dirname(__file__)) + "/../../"
|
path_fix = os.path.abspath(os.path.dirname(__file__)) + "/../../"
|
||||||
|
@ -14,6 +14,7 @@ def patch_metadata(major, minor, patch, build_i):
|
|||||||
logger.info(" - metadata loaded")
|
logger.info(" - metadata loaded")
|
||||||
product_name = metadata['ProductName']
|
product_name = metadata['ProductName']
|
||||||
icon = metadata['Icon']
|
icon = metadata['Icon']
|
||||||
|
splash = metadata.get("Splash")
|
||||||
old_data = metadata['Version']
|
old_data = metadata['Version']
|
||||||
logger.info(f" - current version: {old_data}")
|
logger.info(f" - current version: {old_data}")
|
||||||
logger.info(f" - patched version: {major}.{minor}.{patch}.{build_i}")
|
logger.info(f" - patched version: {major}.{minor}.{patch}.{build_i}")
|
||||||
@ -24,4 +25,4 @@ def patch_metadata(major, minor, patch, build_i):
|
|||||||
logger.info(" - creating version file")
|
logger.info(" - creating version file")
|
||||||
subprocess.run(['create-version-file', metadata_path, '--outfile', metadata_path_txt])
|
subprocess.run(['create-version-file', metadata_path, '--outfile', metadata_path_txt])
|
||||||
logger.info("Ready")
|
logger.info("Ready")
|
||||||
return old_data, product_name, icon
|
return old_data, product_name, icon, splash
|
Loading…
x
Reference in New Issue
Block a user