-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.spec
More file actions
90 lines (85 loc) · 2.52 KB
/
Copy pathrun.spec
File metadata and controls
90 lines (85 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# -*- mode: python ; coding: utf-8 -*-
import os
from PyInstaller.utils.win32.versioninfo import (
VSVersionInfo, FixedFileInfo, StringFileInfo,
StringStruct, VarFileInfo, VarStruct, StringTable
)
# Version info
version = "0.2.0"
vs = VSVersionInfo(
ffi=FixedFileInfo(
filevers=(0,2,0,0),
prodvers=(0,2,0,0),
mask=0x3f,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0,0)
),
kids=[StringFileInfo([StringTable('040904B0', [
StringStruct('CompanyName', 'Ullas'),
StringStruct('FileDescription', 'LocVi – Local File Viewer'),
StringStruct('FileVersion', version),
StringStruct('InternalName', 'LocVi'),
StringStruct('OriginalFilename', 'LocVi.exe'),
StringStruct('ProductName', 'LocVi'),
StringStruct('ProductVersion', version),
StringStruct('LegalCopyright', '© 2025 Ullas. MIT License'),
])]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]
)
# --------------------------
# Paths
# --------------------------
spec_dir = os.path.abspath(".")
icon_path = os.path.join(spec_dir, 'assets', 'icons', 'icon-ico.ico')
# IMPORTANT: Use the correct path to your global Python DLL
python_dll_path = 'C:\\Users\\ullas\\AppData\\Local\\Programs\\Python\\Python313\\python313.dll'
# --------------------------
# Analysis
# --------------------------
a = Analysis(
['run.py'],
pathex=[spec_dir],
binaries=[
# Explicitly add the Python DLL from its correct location
(python_dll_path, '.'),
],
datas=[
# Add your data files
(os.path.join(spec_dir, 'app', 'templates'), 'app/templates'),
(os.path.join(spec_dir, 'app', 'static'), 'app/static')
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
# --------------------------
# PYZ
# --------------------------
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
# --------------------------
# EXE - Configured for One-File Mode
# --------------------------
exe = EXE(
pyz,
a.scripts,
a.binaries, # Include the binaries from the analysis step
a.datas, # Include the data files
name='LocVi.exe',
debug=False,
strip=False,
upx=True,
console=False,
icon=icon_path,
version=vs,
# This ensures a single executable file is created
# The 'onedir' flag is false by default if 'collect' is not used
# This also means we don't need a separate 'COLLECT' object.
)