-
Notifications
You must be signed in to change notification settings - Fork 24
/
freeze.py
105 lines (93 loc) · 2.34 KB
/
freeze.py
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from cx_Freeze import setup, Executable
from rare import __version__ as _version
_name = "Rare"
_author = "RareDevs"
_description = "Open source alternative for Epic Games Launcher, using Legendary"
_icon = "rare/resources/images/Rare"
_license = "LICENSE"
build_exe_options = {
"bin_excludes": [ "qpdf.dll", "libqpdf.so", "libqpdf.dylib"],
"excludes": [
"tkinter",
"unittest",
"pydoc",
],
"include_msvcr": True,
"optimize": 2,
}
shortcut_table = [
(
"DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"Rare", # Name
"TARGETDIR", # Component_
"[TARGETDIR]Rare.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
"TARGETDIR", # WkDir
),
]
msi_data = {
"Shortcut": shortcut_table,
"ProgId": [
("Prog.Id", None, None, _description, "IconId", None),
],
"Icon": [("IcodId", f"{_icon}.ico")],
}
bdist_msi_options = {
"data": msi_data,
"license_file": _license,
# generated with str(uuid.uuid3(uuid.NAMESPACE_DNS, 'io.github.dummerle.rare')).upper()
"upgrade_code": "{85D9FCC2-733E-3D74-8DD4-8FE33A07ADF8}",
}
bdist_appimage_options = {
"target_name": _name,
"target_version": _version,
}
bdist_mac_options = {
"iconfile": f"{_icon}.icns",
"bundle_name": f"{_name}",
}
bdist_dmg_options = {
"volume_label": _name,
"applications_shortcut": True,
"show_icon_preview": True,
"license": {
"default-language": "en_US",
"licenses": {
"en_US": _license,
},
"buttons": {
"en_US": [
"English", "Agree", "Disagree", "Print", "Save", "License"
]
},
},
}
executables = [
Executable(
script="rare/main.py",
copyright=f"Copyright (C) 2024 {_author}",
base="gui",
icon=_icon,
target_name=_name,
),
]
setup(
name=_name,
version=_version,
author=_author,
description=_description,
executables=executables,
options={
"build_exe": build_exe_options,
"bdist_msi": bdist_msi_options,
"bdist_appimage": bdist_appimage_options,
"bdist_mac": bdist_mac_options,
"bdist_dmg": bdist_dmg_options,
},
)