-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScriptUp.ahk
More file actions
76 lines (68 loc) · 2.34 KB
/
ScriptUp.ahk
File metadata and controls
76 lines (68 loc) · 2.34 KB
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
#singleInstance force
#persistent
#noEnv
setWorkingDir,% a_scriptDir
menu,tray,tip,ScriptUp
; compiled installs
if(a_isCompiled){
fileCreateDir,data\dlls
fileCreateDir,data\imgs
fileInstall,data\dlls\mini32.dll,data\dlls\mini32.dll
fileInstall,data\dlls\mini64.dll,data\dlls\mini64.dll
fileInstall,data\dlls\std32.dll,data\dlls\std32.dll
fileInstall,data\dlls\std64.dll,data\dlls\std64.dll
fileInstall,data\imgs\b1.png,data\imgs\b1.png
fileInstall,data\imgs\b2.png,data\imgs\b2.png
fileInstall,data\imgs\b3.png,data\imgs\b3.png
fileInstall,data\imgs\b4.png,data\imgs\b4.png
fileInstall,data\imgs\b5.png,data\imgs\b5.png
fileInstall,data\imgs\MXIII.png,data\imgs\MXIII.png
fileInstall,data\workerH.ahk,data\workerH.ahk
}
; setup config
;sini:=(siniD:=a_appData . "\..\Local\ScriptUp") . "\config.ini"
sini:=a_scriptDir . "\data\config.ini"
dlls:=a_scriptDir . "\data\dlls"
imgs:=a_scriptDir . "\data\imgs"
workerdll:=dlls . "\std" . (a_ptrSize*8) . ".dll"
workerfile:=a_scriptDir . "\data\workerH.ahk"
fileLastDir:=a_scriptDir
if(!fileExist(sini))
firstRun:=1
; load settings
iniRead,editPath,% sini,settings,editPath,0
iniRead,hideDeleteWarning,% sini,settings,hideDeleteWarning,0
regRead,loginRun,% regStartupPath:="HKCU\Software\Microsoft\Windows\CurrentVersion\Run",ScriptUp
if(!errorLevel) ; auto-correct if the script has been moved
if(loginRun!=a_scriptFullPath)
regWrite,REG_SZ,% regStartupPath,ScriptUp,% a_scriptFullPath
; start worker
#include %a_scriptDir%\data\guiMake.ahk
worker:=ahkThread(workerfile,params,1,workerdll)
onExit,cleanup
; set DLLs/open gui automatically for first run
if(firstRun){
nDllType:="Std",nDllPath:="dlls\std" . (a_ptrSize*8) . ".dll"
gosub setDllFinal
nDllType:="Mini",nDllPath:="dlls\mini" . (a_ptrSize*8) . ".dll"
gosub setDllFinal
gosub showMain
}
setTimer,checkStates,1000
return
#include %a_scriptDir%\data\guiSubs.ahk
#include %a_scriptDir%\data\optionSubs.ahk
#include %a_scriptDir%\data\menuSubs.ahk
#include %a_scriptDir%\data\functions.ahk
checkStates:
stateList:=worker.ahkGetVar["stateList"]
loop,parse,stateList,`,
{
lv_getText(pstate,a_index,2)
if(pstate!=a_loopField)
lv_modify(a_index,,,a_loopField)
}
return
cleanUp:
worker.ahkTerminate[30000]
exitApp