-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
generate-version-info.bat
84 lines (51 loc) · 1.92 KB
/
generate-version-info.bat
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
@ECHO OFF
REM
REM This file is a bit of a mess, suggestions for alternatives would be
REM much appreciated.
REM
SETLOCAL ENABLEDELAYEDEXPANSION
WHERE /q git
IF ERRORLEVEL 1 (
ECHO Please install git in your PATH to generate version info.
EXIT /B 1
) ELSE (
FOR /F "delims=" %%i IN ('git describe --tags') DO (
SET VERSION=%%i
FOR /F "tokens=1,2,3,4 delims=.-" %%a IN ("!VERSION:v=!.0") DO SET WINVERSION=%%a,%%b,%%c,%%d
ECHO /* This file is automatically generated on build! */ > src/keynavish/versioninfo.d
ECHO[ >> src/keynavish/versioninfo.d
ECHO module keynavish.versioninfo; >> src/keynavish/versioninfo.d
ECHO[ >> src/keynavish/versioninfo.d
ECHO enum gitVersion = "!VERSION!"; >> src/keynavish/versioninfo.d
ECHO 1 VERSIONINFO ^
FILEVERSION !WINVERSION! ^
PRODUCTVERSION !WINVERSION! ^
FILEOS 0x40004 ^
FILETYPE 0x1 ^
{ ^
BLOCK "StringFileInfo" ^
{ ^
BLOCK "040904B0" ^
{ ^
VALUE "FileDescription", "keynavish – Control the mouse with the keyboard, on Windows" ^
VALUE "InternalName", "keynavish.exe" ^
VALUE "OriginalFilename", "keynavish.exe" ^
VALUE "CompanyName", "Les De Ridder" ^
VALUE "LegalCopyright", "© 2021, Les De Ridder <[email protected]>" ^
VALUE "ProductName", "keynavish" ^
VALUE "FileVersion", "!VERSION:v=!" ^
VALUE "ProductVersion", "!VERSION:v=!" ^
} ^
} ^
^
BLOCK "VarFileInfo" ^
{ ^
VALUE "Translation", 0x0409 0x04B0 ^
} ^
} > src/keynavish/versioninfo.rc
ECHO Version info written to 'src/keynavish/versioninfo.{d,rc}'.
.\tools\llvm-rc.exe /C 65001 src\keynavish\versioninfo.rc
ECHO Converted 'src/keynavish/versioninfo.rc' to 'src/keynavish/versioninfo.res'.
)
)
ENDLOCAL