File: make_rc.py

package info (click to toggle)
horizon-eda 2.6.0-2.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,356 kB
  • sloc: cpp: 270,147; ansic: 3,817; python: 2,098; xml: 402; sql: 219; sh: 190; ruby: 61; makefile: 19
file content (34 lines) | stat: -rw-r--r-- 803 bytes parent folder | download | duplicates (2)
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))