forked from smathot/qnotero
/
setup-windows.py
114 lines (100 loc) · 3.06 KB
/
setup-windows.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
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python3
"""
This file is part of qnotero.
qnotero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qnotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qnotero. If not, see <http://www.gnu.org/licenses/>.
---
desc:
Windows packaging procedure:
1. Build Qnotero into `dist` with `setup-win.py py2exe`
2. Create `.exe` installer with `.nsi` script
3. Rename `.exe` installer
4. Rename `dist` and pack it into `.zip` for portable distribution
---
"""
# Use cx_Freeze to make the windows installer
from cx_Freeze import setup, Executable
from libqnotero.qnotero import Qnotero
import sys
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
executables = [
Executable(
'qnotero',
base=base,
icon='data\qnotero.ico',
)
]
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"Qnotero", # Name
"TARGETDIR", # Component_
"[TARGETDIR]qnotero.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"Qnotero", # Name
"TARGETDIR", # Component_
"[TARGETDIR]qnotero.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
)
]
# Now create the table dictionary
msi_data = {"Shortcut": shortcut_table}
# Setup options
options = {
'build_exe': {
'optimize': '2',
'silent': '0',
'includes': [
'sip'
],
'packages': [
"libqnotero",
"libzotero",
"libqnotero._themes",
"libzotero._noteProvider",
],
'include_files': [
'resources',
'.\data\qnotero.ico',
],
},
'bdist_msi_options': {
'upgrade_code': '{69620F3A-DC3A-11E2-B341-002210FE9B01E}',
'data': msi_data,
'install_icon': 'data\qnotero.ico'
}
}
setup(name="qnotero",
version=Qnotero.version,
description="Standalone sidekick to the Zotero reference manager",
author="E. Albiter",
author_email="ealbitere@ipn.mx",
url="",
options=options,
executables=executables
)