-
Notifications
You must be signed in to change notification settings - Fork 9
/
Installer.ahk
38 lines (26 loc) · 1.32 KB
/
Installer.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
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
; 这里用于存放安装功能相关的代码。记得在打包成可执行(EXE)文件后要放到EXE文件夹中哦
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
#SingleInstance, Force
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
SetWorkingDir, ../%A_WorkingDir%
FullCommandLine := DllCall("GetCommandLine", "str")
If Not (A_IsAdmin or RegExMatch(FullCommandLine, " /restart(?!\S)"))
{
Try
{
If A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
Else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
Try
RunWait, PowerShell.exe -Command "Move-Item -Path ./Temp/BH3_Hotkey.exe -Destination ./ -Force", , Hide
Catch
MsgBox, 16, Warning, Failed to run Shell!
Finally
Run, ./BH3_Hotkey.exe
ExitApp
;---------------------------------------------------------------------------------------------------------------------------------------------------------------