提交打包相关的内容

This commit is contained in:
halliday2023 2024-02-14 10:47:12 +08:00
parent 137558064a
commit 577abe4d69
7 changed files with 71 additions and 9 deletions

12
DTCPyinstaller.py Normal file
View File

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import re
import sys
from PyInstaller.__main__ import run
# python DTCPyinstaller.py --clean -y DataCreating_Click.spec
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$','',sys.argv[0])
sys.exit(run())

View File

@ -29,7 +29,10 @@ exe = EXE(pyz,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False)
console=False,
icon='images/bjx.ico',
version="file_verison_info.txt"
)
coll = COLLECT(exe,

44
file_verison_info.txt Normal file
View File

@ -0,0 +1,44 @@
# UTF-8
#
# For more details about fixed file info 'ffi' see:
# http://msdn.microsoft.com/en-us/library/ms646997.aspx
VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(1, 0, 0, 0), # 文件版本
prodvers=(1, 0, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1, # 类型
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u'halliday'),
StringStruct(u'FileDescription', u'持续性生成数据'), # 文件说明
StringStruct(u'FileVersion', u'1.0.0'),
StringStruct(u'InternalName', u'GIT'),
StringStruct(u'LegalCopyright', u'halliday版权所有'), #版权
StringStruct(u'OriginalFilename', u'dataCreatingGUI.exe'), #原始文件名
StringStruct(u'ProductName', u'dataCreatingGUI'), #产品名称
StringStruct(u'ProductVersion', u'1.0.0')]) #产品版本
]),
VarFileInfo(
[VarStruct(u'Translation', [2052, 1200])]) # 语言
]
)

BIN
images/bjx.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -70,24 +70,23 @@ def _strip_py(py_dir):
def main():
# src_dir = sys.argv[1]
site_pacakge_dir = sys.argv[2]
pyinstaller_pacakge_dir = sys.argv[2]
target_dir = sys.argv[3]
top_dir = sys.argv[4]
if os.path.isdir(top_dir):
shutil.rmtree(target_dir, ignore_errors=True)
os.makedirs(target_dir)
for dir in ("bin", "etc"):
shutil.move(pyinstaller_pacakge_dir,target_dir)
for dir in ("ui", "etc","images"):
_copytree(os.path.join(top_dir, dir),
os.path.join(target_dir, dir))
shutil.copy2(os.path.join(top_dir, "README.md"),
os.path.join(target_dir, "README.md"))
target_lib_dir = os.path.join(target_dir, "lib")
_copytree(site_pacakge_dir, target_lib_dir)
_zip_file(target_dir)
print("")

View File

@ -4,4 +4,5 @@ schedule==1.2.1
JPype1==1.4.1
JayDeBeApi==1.2.3
pyside6==6.1.3
pyinstaller==6.4.0

View File

@ -24,5 +24,8 @@ deps =
-r{toxinidir}/requirements.txt
commands =
{envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/dataCreatingGUI_v1.0.0 {toxinidir}
# 先调用pyinstaller打包
{envpython} {toxinidir}/DTCPyinstaller.py --clean -y DataCreating_Click.spec
# 整体打包
{envpython} {toxinidir}/release.py {envdir} {toxinidir}/dist/dataCreatingGUI {toxinidir}/dist/dataCreatingGUI_v1.0.0 {toxinidir}