You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.4 KiB
Plaintext
93 lines
2.4 KiB
Plaintext
2 years ago
|
;---ENVIRONMENT---------------------------------------------------------------------
|
||
|
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||
|
;#Warn ; Enable warnings to assist with detecting common errors.
|
||
|
;DetectHiddenWindows, On
|
||
|
#SingleInstance, Force
|
||
|
DetectHiddenWindows, ON
|
||
|
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||
|
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||
|
;SetKeyDelay, 500
|
||
|
CoordMode, ToolTip, Screen
|
||
|
CoordMode, Mouse, Screen
|
||
|
; #NoTrayIcon
|
||
|
; Menu, Tray, Icon, RMScriptManager.ico
|
||
|
|
||
|
;---Notes/Extra Info/#Includes------------------------------------------------------
|
||
|
|
||
|
; msgbox
|
||
|
;---VARIABLES-----------------------------------------------------------------------
|
||
|
/*ScriptToCompile = %1%
|
||
|
CompileType = %2% ; Testing OR Production
|
||
|
if(CompileType = "")
|
||
|
CompileType = Testing
|
||
|
; Msgbox % "CompileType: " CompileType
|
||
|
if(ScriptToCompile = "")
|
||
|
ExitApp
|
||
|
|
||
|
|
||
|
*/
|
||
|
|
||
|
; Msgbox % "ScriptToCompile: " ScriptToCompile
|
||
|
ScriptToCompile = SocialMediaPoster
|
||
|
; ScriptToCompile = ScriptUpdater
|
||
|
;---MAIN SCRIPT---------------------------------------------------------------------
|
||
|
if(ScriptToCompile = "SocialMediaPoster"){
|
||
|
AHKFilepath = %A_ScriptDir%\..\Freedomain Social Media Poster.ahk
|
||
|
Exefilepath = %A_ScriptDir%\..\Freedomain Social Media Poster.exe
|
||
|
icopath = %A_ScriptDir%\..\Assets\FreedomainSMP.ico
|
||
|
}
|
||
|
|
||
|
if(ScriptToCompile = "ScriptUpdater"){
|
||
|
AHKFilepath = %A_ScriptDir%\..\Tools\Freedomain Program Updater.ahk
|
||
|
Exefilepath = %A_ScriptDir%\..\Tools\Freedomain Program Updater.exe
|
||
|
icopath = %A_ScriptDir%\..\Assets\Update.ico
|
||
|
}
|
||
|
|
||
|
; Kill any active intances of the uploaders so the .exe files can be overwriten by the compilation
|
||
|
run, %A_ScriptDir%\Kill Open Freedomain Programs.ahk
|
||
|
|
||
|
sleep, 500
|
||
|
|
||
|
; Delete the .exe file so it can be repalced
|
||
|
if(FileExist(Exefilepath)){
|
||
|
FileDelete, %Exefilepath%
|
||
|
if(ErrorLevel){
|
||
|
msgbox, failed to delete Exe file. Please delete manually and re-run the compiler.
|
||
|
ExitApp
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
if(!FileExist(AHKFilepath)){
|
||
|
msgbox, %AHKFilepath% does not exist`nExiting
|
||
|
ExitApp
|
||
|
}
|
||
|
|
||
|
|
||
|
if(!FileExist(icopath)){
|
||
|
msgbox, %icopath% does not exist`nExiting
|
||
|
ExitApp
|
||
|
}
|
||
|
|
||
|
|
||
|
run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
||
|
|
||
|
|
||
|
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
|
||
|
; sleep, 5000
|
||
|
ExitApp
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
;---FUNCTIONS-----------------------------------------------------------------------
|