-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
152 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,79 @@ | ||
; # requirements: | ||
; # autohotkey in PATH | ||
; # ahk2exe in PATH | ||
; # ahk2exe.exe in PATH [1.1.34.00_Beta_8] | ||
; # AutoHotkey64.exe in PATH [v2.0-beta.3] | ||
; # mpress in ahk2exe path | ||
|
||
#SingleInstance, Force | ||
SetWorkingDir, %A_ScriptDir% | ||
#SingleInstance Force | ||
SetWorkingDir(A_ScriptDir) | ||
|
||
#include meta.ahk | ||
|
||
if FileExist(binaryFilename) | ||
{ | ||
FileDelete, % binaryFilename | ||
FileDelete(binaryFilename) | ||
} | ||
|
||
if FileExist(versionFilename) | ||
{ | ||
FileDelete, % versionFilename | ||
FileDelete(versionFilename) | ||
} | ||
|
||
if InStr(FileExist("dist"), "D") | ||
{ | ||
FileRemoveDir, dist, 1 | ||
If (ErrorLevel) | ||
try | ||
{ | ||
MsgBox, % "removing dist`nERROR CODE=" ErrorLevel | ||
DirDelete("dist", 1) | ||
} | ||
catch as e | ||
{ | ||
MsgBox("removing dist`nERROR CODE=" . e.Message) | ||
ExitApp | ||
} | ||
} | ||
|
||
FileCreateDir, dist | ||
DirCreate("dist") | ||
|
||
RunWait, ahk2exe.exe /in updater.ahk /out updater.exe /compress 1 | ||
If (ErrorLevel) | ||
try | ||
{ | ||
RunWait("ahk2exe.exe /in updater.ahk /out updater.exe /base `"" A_AhkPath "`" /compress 1") | ||
} | ||
catch as e | ||
{ | ||
MsgBox, % "updater.ahk`nERROR CODE=" ErrorLevel | ||
MsgBox("updater.ahk`nERROR CODE=" . e.Message) | ||
ExitApp | ||
} | ||
RunWait, ahk2exe.exe /in %ahkFilename% /out %binaryFilename% /icon icon.ico /compress 1 | ||
If (ErrorLevel) | ||
|
||
try | ||
{ | ||
RunWait("ahk2exe.exe /in " ahkFilename " /out " binaryFilename " /base `"" A_AhkPath "`" /icon icon.ico /compress 1") | ||
} | ||
catch as e | ||
{ | ||
MsgBox, % ahkFilename "`nERROR CODE=" ErrorLevel | ||
MsgBox(ahkFilename . "`nERROR CODE=" . e.Message) | ||
ExitApp | ||
} | ||
RunWait, autohotkey.exe .\%ahkFilename% --out=version | ||
If (ErrorLevel) | ||
|
||
try | ||
{ | ||
RunWait("AutoHotkey64.exe .\" . ahkFilename . " --out=version") | ||
} | ||
catch as e | ||
{ | ||
MsgBox, % "get version`nERROR CODE=" ErrorLevel | ||
MsgBox("get version`nERROR CODE=" . e.Message) | ||
ExitApp | ||
} | ||
RunWait, powershell -command "Compress-Archive -Path .\%binaryFilename% -DestinationPath %downloadFilename%",, Hide | ||
If (ErrorLevel) | ||
|
||
try | ||
{ | ||
RunWait("powershell -command `"Compress-Archive -Path .\" binaryFilename " -DestinationPath " downloadFilename '"',, "Hide") | ||
} | ||
catch as e | ||
{ | ||
MsgBox, % "compress`nERROR CODE=" ErrorLevel | ||
MsgBox("compress`nERROR CODE=" . e.Message) | ||
ExitApp | ||
} | ||
FileDelete, %binaryFilename% | ||
FileDelete, updater.exe | ||
FileMove, %downloadFilename%, dist\%downloadFilename%, 1 | ||
FileMove, %versionFilename%, dist\%versionFilename%, 1 | ||
MsgBox, Build Finished | ||
FileDelete(binaryFilename) | ||
FileDelete("updater.exe") | ||
FileMove(downloadFilename, "dist\" downloadFilename, 1) | ||
FileMove(versionFilename, "dist\" versionFilename, 1) | ||
MsgBox("Build Finished") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
setTray() | ||
{ | ||
global version, trueExit | ||
donate(ItemName, ItemPos, MyMenu){ | ||
Run("https://ko-fi.com/xianii") | ||
} | ||
pages(ItemName, ItemPos, MyMenu){ | ||
Run("https://github.com/Nigh/ahk-autoupdate-template") | ||
} | ||
donothing(ItemName, ItemPos, MyMenu){ | ||
} | ||
trayExit(ItemName, ItemPos, MyMenu){ | ||
trueExit("","") | ||
} | ||
tray := A_TrayMenu | ||
tray.delete | ||
tray.add("v" . version, donothing) | ||
tray.add() | ||
tray.add("Github 页面", pages) | ||
tray.add("Donate 捐助", donate) | ||
tray.add("Exit", trayExit) | ||
tray.ClickCount := 1 | ||
} |
Oops, something went wrong.