на win7 работает и Nuitka и PyInstaller
добавлен прогрессбар на сканирование переменных исправлены мелкие баги
This commit is contained in:
@@ -20,9 +20,7 @@ ICON_ICO_PATH = SCRIPT_DIR / "icon.ico"
|
||||
|
||||
# === Пути к DLL и прочим зависимостям ===
|
||||
LIBS = {
|
||||
"libclang.dll": SCRIPT_DIR / "libclang.dll",
|
||||
"libssl.dll": SCRIPT_DIR / "libssl-3-x64.dll",
|
||||
"libcrypto.dll": SCRIPT_DIR / "libcrypto-3-x64.dll"
|
||||
"libclang.dll": SCRIPT_DIR / "libclang.dll"
|
||||
}
|
||||
|
||||
# === PySide2 плагины ===
|
||||
@@ -33,28 +31,15 @@ datas += collect_data_files('PySide2', includes=['plugins/styles/*'])
|
||||
datas += collect_data_files('PySide2', includes=['plugins/imageformats/*'])
|
||||
|
||||
add_data_list = [f"{src};{dest}" for src, dest in datas]
|
||||
add_binary_list = [f"{str(LIBS['libclang.dll'])};."]
|
||||
|
||||
# Проверка наличия DLL и добавление
|
||||
add_binary_list = []
|
||||
for name, path in LIBS.items():
|
||||
if path.exists():
|
||||
if name != "libclang.dll":
|
||||
add_binary_list.append(f"{str(path)};{name}")
|
||||
add_binary_list.append(f"{str(path)};{name}")
|
||||
else:
|
||||
print(f"WARNING: {path.name} не найден — он не будет включён в сборку")
|
||||
|
||||
# === Сборка ===
|
||||
env = os.environ.copy()
|
||||
env["CC"] = r"C:\Users\I\AppData\Local\Nuitka\Nuitka\Cache\DOWNLOADS\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\bin\gcc.exe"
|
||||
env["CXX"] = r"C:\Users\I\AppData\Local\Nuitka\Nuitka\Cache\DOWNLOADS\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\bin\g++.exe"
|
||||
|
||||
# Конвертация PNG в ICO, если ICO нет или PNG новее ICO
|
||||
if ICON_PATH.exists():
|
||||
if (not ICON_ICO_PATH.exists()) or (ICON_PATH.stat().st_mtime > ICON_ICO_PATH.stat().st_mtime):
|
||||
img = Image.open(ICON_PATH)
|
||||
img.save(ICON_ICO_PATH, format='ICO', sizes=[(256,256), (128,128), (64,64), (32,32), (16,16)])
|
||||
|
||||
# Удалим временные папки до сборки
|
||||
def clean_temp():
|
||||
for folder in ["build_temp", "__pycache__", "DebugVarEdit_GUI.build", "DebugVarEdit_GUI.dist", "DebugVarEdit_GUI.onefile-build"]:
|
||||
path = Path(folder)
|
||||
@@ -68,10 +53,9 @@ if USE_NUITKA:
|
||||
cmd = [
|
||||
"python", "-m", "nuitka",
|
||||
"--standalone",
|
||||
"--debug",
|
||||
"--debugger",
|
||||
"--mingw64",
|
||||
"--onefile",
|
||||
"--enable-plugin=pyside2",
|
||||
"--windows-console-mode=disable",
|
||||
f"--output-dir={DIST_PATH}",
|
||||
f"--output-filename={OUTPUT_NAME}.exe",
|
||||
f"--windows-icon-from-ico={ICON_ICO_PATH}",
|
||||
@@ -101,11 +85,11 @@ print("Выполняется сборка с помощью " + ("Nuitka" if US
|
||||
print(" ".join(cmd))
|
||||
|
||||
try:
|
||||
subprocess.run(cmd, check=True, env=env)
|
||||
subprocess.run(cmd, check=True)
|
||||
print("\nСборка успешно завершена!")
|
||||
|
||||
# Удаление временных папок после сборки
|
||||
#clean_temp()
|
||||
clean_temp()
|
||||
|
||||
except subprocess.CalledProcessError:
|
||||
print("\nОшибка при сборке.")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user