forked from XUJINKAI/OneQuick.AHK-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOneQuick Launcher.ahk
43 lines (41 loc) · 969 Bytes
/
OneQuick Launcher.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
program_icon := "icon/1.ico"
program_name := "OneQuick"
#NoTrayIcon
SetWorkingDir, %A_ScriptDir%
if not A_IsCompiled
{
splitpath, a_ahkpath, , ahk_dir
Ahk2Exe := ahk_dir "\Compiler\Ahk2Exe.exe"
u32bin := ahk_dir "\Compiler\Unicode 32-bit.bin"
if not FileExist(Ahk2Exe)
MsgBox, can't find Compiler\Ahk2Exe.exe to compile
else if not FileExist(u32bin)
MsgBox, can't find Compiler\Unicode 32-bit.bin to compile
Else
{
launcher_exe_name := SubStr(A_ScriptName, 1, StrLen(A_ScriptName) - 4) . ".exe"
FileDelete, % launcher_exe_name
run, %Ahk2Exe% /in "%A_ScriptName%" /icon "%program_icon%" /bin "%u32bin%"
}
}
Else
{
try
{
run AutoHotkey.exe %program_name%.ahk
}
catch e
{
Gosub, ask_open_ahk_org
ExitApp
}
}
ExitApp
ask_open_ahk_org:
msg = Please install Autohotkey first. `nClick YES to open autohotkey.org
msgbox, 0x4, %program_name%, % msg
ifmsgbox Yes
{
run, http://autohotkey.org
}
ExitApp