forked from adampash/texter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TexterInstaller.ahk
63 lines (55 loc) · 1.28 KB
/
TexterInstaller.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
#SingleInstance,Force
#NoEnv
#NoTrayIcon
Goto,DIRECTORY
DIRECTORY:
InstallDir =
Gui, Add, Text,y10 x10,Where would you like to install Texter?
Gui, Add, Edit, x20 y30 r1 W300 vInstallDir,%A_ProgramFiles%\Texter
Gui, Add, Button,w80 GBrowse x320 y29,&Browse
Gui, Add, Button,w80 default GInstall x225 yp+50,&Install
Gui, Add, Button,w80 xp+90 GCancel,&Cancel
Gui, Show, auto,Install Texter
RETURN
BROWSE:
FileSelectFolder, InstallDir,,1,Select your installation folder
if ErrorLevel = 0
GuiControl,,InstallDir,%InstallDir%
RETURN
INSTALL:
Gui, Submit
Gui,Destroy
;MsgBox,%InstallDir%
IfNotExist,%InstallDir%
FileCreateDir,%InstallDir%
Process,Exist,texter.exe
if ErrorLevel != 0
Process,Close,texter.exe
FileInstall,texter.exe,%InstallDir%\texter.exe,1
if ErrorLevel = 0
{
;MsgBox Problem!
Gui, Add, Text,y10 x10,Texter successfully installed!
Gui, Add, Checkbox, Checked y30 x20 vLaunch, Launch Texter
Gui, Add, Button,w80 default GAutoRun x300 yp+65,&Finish
Gui, Show, auto,Installation complete
}
;MsgBox, Installed
return
AUTORUN:
Gui,Submit
Gui,Destroy
if Launch = 1
{
;MsgBox, Launch
Run,%InstallDir%\texter.exe
;MsgBox,Ran: %InstallDir%\texter.exe
}
Goto,Exit
return
CANCEL:
Gui, Destroy
Goto,Exit
return
EXIT:
ExitApp