-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnsis-maker.py
More file actions
50 lines (40 loc) · 1.37 KB
/
nsis-maker.py
File metadata and controls
50 lines (40 loc) · 1.37 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
from string import Template
class MyTemplate(Template):
delimiter = '&'
# Change parameters here
appname = "YourApp" # your app name
compname = "Your Company" # your company name
descript = "App description" # App description
vmajor = 1 # Major Version
vminor = 0 # Minor Version
vbuild = 0 # Build Version
helpurl = "https://www.yourapp.com/help" # Help URL
updateurl = "https://www.yourapp.com/update" # Update URL
abouturl = "https://www.yourapp.com/about" # About URL
installsize = 49368 # Installation size in Kb
iconpath = "src/images/yourico.ico" # Icon path of your app
builder = "py" # Compilation used
# ---------------------------------------------------------------#
outfile = f'{appname.replace(" ", "")}-installer-{vmajor}{vminor}{vbuild}-{builder}.exe'
iconpathrev = iconpath.replace("/", '\\')
iconpathrev = f"\\{iconpathrev}"
d = {
'appname': appname,
'compname': compname,
"descript": descript,
"vmajor": vmajor,
"vminor": vminor,
"vbuild": vbuild,
"helpurl": helpurl,
"updateurl": updateurl,
"abouturl": abouturl,
"installsize": installsize,
"iconpath": iconpath,
"outfile": outfile,
"iconpathrev": iconpathrev,
}
with open('nsis_template.txt', 'r') as f:
src = MyTemplate(f.read())
result = src.substitute(d)
with open(f'{appname}-installer-{vmajor}{vminor}{vbuild}.txt', 'w') as g:
g.write(result)