-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.ahk
100 lines (69 loc) · 2 KB
/
compile.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#SingleInstance force
BackSlash(input)
{
return rtrim(input,"\") "\"
}
GetDir(input)
{
Array := StrSplit(input , "\")
dir:=""
Array.Remove(Array.MaxIndex())
for index, element in Array
{
if(dir!="")
{
dir:=dir "\"
}
dir:=dir element
}
return dir
}
ahkdir:=GetDir(A_AhkPath)
compilerdir:=BackSlash(ahkdir) "Compiler"
compiler:="""" BackSlash(compilerdir) "Ahk2Exe.exe"""
binfile:=BackSlash(compilerdir) "Unicode 32-bit.bin"
; make output and compile temp directory and clean them
cmd:="md output"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="md compiletemp"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="del /Q .\output\*"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="del /Q .\compiletemp\*"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="md compiletemp\lib"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="md output\lib"
RunWait, %ComSpec% /c %cmd% ,,Hide
; copy all scripts to compile temp dir
cmd:="copy *.ahk .\compiletemp\"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="copy .\lib\*.ahk .\compiletemp\"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="copy .\lib\*.ahk .\compiletemp\lib\"
RunWait, %ComSpec% /c %cmd% ,,Hide
; Start compiling script
rootdir:=a_scriptdir
srcdir:=rootdir "\compiletemp"
SetWorkingDir, %srcdir%
cmd:=compiler " /in showeditor.ahk /out ..\output\showeditor.exe /bin """ binfile """"
RunWait, %cmd%,,Hide
cmd:=compiler " /in guard.ahk /out ..\output\lib\guard.exe /bin """ binfile """"
RunWait, %cmd% ,,Hide
cmd:=compiler " /in syncuipos.ahk /out ..\output\lib\syncuipos.exe /bin """ binfile """"
RunWait, %cmd% ,,Hide
cmd:=compiler " /in synccontent.ahk /out ..\output\lib\synccontent.exe /bin """ binfile """"
RunWait, %cmd% ,,Hide
; copy assets
SetWorkingDir, %rootdir%
cmd:="xcopy .\assets .\output\assets\ /E /H"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="copy *.exe .\output\"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="copy *.dll .\output\"
RunWait, %ComSpec% /c %cmd% ,,Hide
cmd:="copy *.txt .\output\"
RunWait, %ComSpec% /c %cmd% ,,Hide
; clear compile dir
FileRemoveDir,%srcdir%,1
Msgbox Done!