forked from horizon-eda/horizon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_rc.py
34 lines (31 loc) · 803 Bytes
/
make_rc.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
import version as v
import os
import sys
import subprocess
from string import Template
rc_template = """2 ICON "src/icons/horizon-eda.ico"
1 VERSIONINFO
FILEVERSION $major,$minor,$micro,0
PRODUCTVERSION $major,$minor,$micro,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "Horizon EDA"
VALUE "InternalName", "horizon-eda"
VALUE "OriginalFilename", "horizon-eda.exe"
VALUE "ProductName", "Horizon EDA"
VALUE "ProductVersion", "$major.$minor.$micro"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1252
END
END
"""
outfile = sys.argv[1]
with open(outfile, "w", encoding="utf-8") as fi:
tmpl = Template(rc_template)
fi.write(tmpl.substitute(major=v.major, minor=v.minor, micro=v.micro))