parent
613f9d222a
commit
dbdefc5a95
@ -0,0 +1,125 @@
|
||||
;---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------------------------------------------------------
|
||||
; [IniFile]
|
||||
; FileNameOfAHKScripttoCompile=
|
||||
; ICOFileName=
|
||||
|
||||
|
||||
|
||||
;---VARIABLES-----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
;---MAIN SCRIPT---------------------------------------------------------------------
|
||||
|
||||
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
|
||||
Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe
|
||||
icopath = %A_ScriptDir%\Assets\FreedomainVideo.ico
|
||||
VersionIniFP = %A_ScriptDir%\Version.ini
|
||||
|
||||
|
||||
|
||||
; Bump the version number in the version.ini file
|
||||
IniRead, VersionNumber, %VersionIniFP%, Video-Uploader, Version, 0.0 ; , Filename, Section, Key [, Default]
|
||||
VersionNumber += .01
|
||||
VersionNumber := SubStr(VersionNumber, 1, 4)
|
||||
; Msgbox % "VersionNumber: " VersionNumber
|
||||
IniWrite, %VersionNumber%, %VersionIniFP%,Video-Uploader, Version
|
||||
|
||||
|
||||
|
||||
; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
|
||||
process, close, Freedomain Video Uploader.exe
|
||||
|
||||
sleep, 1000
|
||||
|
||||
; 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%""
|
||||
|
||||
|
||||
InputBox, ReleaseBody, Release Body, Please Input Release Body,
|
||||
|
||||
|
||||
cred := CredRead("FDR-Gitea-Token")
|
||||
GiteaToken := Cred.Password
|
||||
|
||||
; Info for Creating the Release with Gitea-CreateRelease.ps1
|
||||
PS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-CreateRelease.ps1
|
||||
APIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases?token=%GiteaToken%
|
||||
ReleaseName := VersionNumber
|
||||
ReleaseTag := VersionNumber
|
||||
; ReleaseBody := "-Fixed Item 1--Fixed Item 2--Fixed Item 3"
|
||||
|
||||
Command = Powershell "%PS1Filepath%" "%APIURL%" "%ReleaseName%" "%ReleaseTag%" "%ReleaseBody%"
|
||||
Clipboard := Command
|
||||
Msgbox % "Command: " Command
|
||||
Returned := RunCMD(Command)
|
||||
Clipboard := Returned
|
||||
Msgbox % "Returned: " Returned
|
||||
|
||||
; Pull out the relead ID Number, used for uploading attachmenets
|
||||
SplitText = @{id=
|
||||
SplitText2 = `;
|
||||
ReleaseID := StrSplit(Returned, SplitText)[2]
|
||||
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
|
||||
|
||||
Clipboard := ReleaseID
|
||||
Msgbox % "ReleaseID: " ReleaseID
|
||||
|
||||
|
||||
|
||||
; runcmd()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ExitApp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;---FUNCTIONS-----------------------------------------------------------------------
|
@ -1,3 +1,4 @@
|
||||
[Video-Uploader]
|
||||
Version=3.41
|
||||
Version=3.43
|
||||
Name=Freedomain Video Uploader
|
||||
APIURL=
|
Loading…
Reference in New Issue