-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcompileScript.ahk
More file actions
48 lines (37 loc) · 947 Bytes
/
compileScript.ahk
File metadata and controls
48 lines (37 loc) · 947 Bytes
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
/* Written by Masonjar13
Description
Parameters:
---------------
file: path to script
out: name of output executable
bin: path to bin file to be used
icon: path to icon file to be used
mpress: 0 = don't use, 1 = use
return: returns a_lasterror
---------------
Example:
------------
if (!a_isCompiled){
msgbox % "Compiled!`nError code: " compileScript(a_scriptFullPath)
}
else
msgbox Already compiled!
exitApp
------------
*/
compileScript(file,out:="",bin:="",icon:="",mpress:=0){
if (!a_ahkPath)
return
splitPath,a_ahkPath,,cDir
cDir.="\Compiler"
if (bin) {
splitPath,bin,,bDir
bin:=!bDir?cDir "\" bin:bin
}
if (icon) {
splitPath,icon,,iDir
icon:=!iDir?cDir "\" icon:icon
}
runWait,% cDir "\Ahk2Exe.exe /in """ file """" (out?" /out """ out """":"") (icon?" /icon """ icon """":"") (bin?" /bin """ bin """":"")(" /mpress " mpress)
return a_lastError
}