-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
dist.ahk
57 lines (50 loc) · 1.22 KB
/
dist.ahk
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
#SingleInstance, Force
SetWorkingDir, %A_ScriptDir%
#include meta.ahk
if FileExist(binaryFilename)
{
FileDelete, %binaryFilename%
}
if FileExist(versionFilename)
{
FileDelete, %versionFilename%
}
if InStr(FileExist("dist"), "D")
{
FileRemoveDir, dist, 1
If (ErrorLevel)
{
MsgBox, % "removing dist`nERROR CODE=" ErrorLevel
ExitApp
}
}
FileCreateDir, dist
RunWait, ahk_compiler/tcc/tcc.exe ./updater.c -luser32
If (ErrorLevel)
{
MsgBox, % "updater.c`nERROR CODE=" ErrorLevel
ExitApp
}
RunWait, ahk_compiler/ahk2exe.exe /in %ahkFilename% /out %binaryFilename% /compress 1 /base "ahk_compiler/AutoHotkeyU64.exe"
If (ErrorLevel)
{
MsgBox, % ahkFilename "`nERROR CODE=" ErrorLevel
ExitApp
}
RunWait, ahk_compiler/AutoHotkeyU64.exe .\%ahkFilename% --out=version
If (ErrorLevel)
{
MsgBox, % "get version`nERROR CODE=" ErrorLevel
ExitApp
}
RunWait, powershell -command "Compress-Archive -Path .\%binaryFilename%`, .\free_sheets -DestinationPath %downloadFilename%",, Hide
If (ErrorLevel)
{
MsgBox, % "compress`nERROR CODE=" ErrorLevel
ExitApp
}
FileDelete, %binaryFilename%
FileDelete, updater.exe
FileMove, %downloadFilename%, dist\%downloadFilename%, 1
FileMove, %versionFilename%, dist\%versionFilename%, 1
MsgBox, Build Finished