forked from Pulover/PuloversMacroCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompile.ahk
114 lines (98 loc) · 6.29 KB
/
Compile.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#NoEnv
SetWorkingDir %A_ScriptDir%
SplitPath, A_AhkPath,, AhkDir
FileCreateDir, Compiled
FileCreateDir, Documentation\MacroCreator_Help-doc\Commands
IfWinExist, ahk_exe MacroCreator.exe
{
WinClose
WinWaitClose
}
FileDelete, Documentation\MacroCreator_Help-doc\*.html
FileDelete, Documentation\MacroCreator_Help-doc\Commands\*.html
FileCopy, Documentation\License.html, Documentation\MacroCreator_Help-doc, 1
RunWait, Documentation\GenDocs-mod.ahk,, UseErrorLevel
If ErrorLevel
ExitApp
RunWait, BuildFiles.ahk,, UseErrorLevel
If ErrorLevel
ExitApp
RunWait, Documentation\MacroCreator_Help-doc\CompileCHM.ahk,, UseErrorLevel
If ErrorLevel
ExitApp
FileCopy, Documentation\MacroCreator_Help-doc\MacroCreator_Help.chm, Compiled\MacroCreator_Help.chm, 1
FileDelete, Compiled\Resources.dll
FileDelete, Compiled\SciLexer-x64.dll
FileDelete, Compiled\SciLexer-x86.dll
FileCopy, Resources.dll, Compiled\Resources.dll, 1
FileCopy, SciLexer-x64.dll, Compiled\SciLexer-x64.dll, 1
FileCopy, SciLexer-x86.dll, Compiled\SciLexer-x86.dll, 1
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 32-bit.bin" /mpress 1,, UseErrorLevel
If ErrorLevel = ERROR
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
ExitApp
}
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator-x64.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 64-bit.bin" /mpress 1,, UseErrorLevel
If ErrorLevel = ERROR
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
ExitApp
}
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in Launcher.ahk /out Compiled\MacroCreatorPortable.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 32-bit.bin" /mpress 1,, UseErrorLevel
If ErrorLevel = ERROR
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
ExitApp
}
RunWait, %ProgramFiles%\Inno Setup 5\iscc.exe %A_ScriptDir%\Installer.iss,, UseErrorLevel
If ErrorLevel = ERROR
{
RunWait, %ProgramFiles% (x86)\Inno Setup 5\iscc.exe %A_ScriptDir%\Installer.iss,, UseErrorLevel
If ErrorLevel = ERROR
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
ExitApp
}
}
FileRemoveDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable, 1
FileCreateDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable
FileCreateDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86
FileCreateDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64
FileCreateDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator
FileCreateDir, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator
IniWrite, 0, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator.ini, Options, AutoUpdate
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\License.txt, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator.exe, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator.ini, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator_Help.chm, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\Resources.dll, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\SciLexer-x86.dll, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x86\MacroCreator\SciLexer.dll, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator-x64.exe, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator\MacroCreator.exe, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator.ini, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator_Help.chm, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\Resources.dll, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator\, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\SciLexer-x64.dll, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\x64\MacroCreator\SciLexer.dll, 1
FileCopy, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable.exe, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\, 1
IniRead, Ver, %A_MyDocuments%\Scripts\PuloversMacroCreator\MacroCreator.ini, Application, Version
FileAppend,
(
Pulover's Macro Creator v%Ver% Portable Edition
===============================================
Thank you for downloading Pulover's Macro Creator.
Supported platforms: Windows XP SP3+, Vista, 7, 8
This file contains both x86 and x64 builds.
MacroCreatorPortable.exe is a launcher that selects
between 32-bit and 64-bit versions based on Operating System's
processor and updates the INI configuration file to the most
recent one. You may use either MacroCreatorPortable.exe or
MacroCreator.exe from the x86 or x64 folders.
), %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable\ReadMe.txt
FileDelete, %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator-Portable.zip
Try
RunWait, %ProgramFiles%\7-Zip\7z.exe a -tzip %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator-Portable.zip %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable
Catch
RunWait, C:\Program Files\7-Zip\7z.exe a -tzip %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreator-Portable.zip %A_MyDocuments%\Scripts\PuloversMacroCreator\Compiled\MacroCreatorPortable
TrayTip,, Finished compiling files.
Sleep, 2000
return