Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Update() {
- url := "https://raw.githubusercontent.com/Gewerd-Strauss/AHK-Code-Snippets/Update()-Test/version.ini"
- http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- http.Open("GET", url, false), http.Send()
- remote := http.responseText
- FileRead current, % A_ScriptDir "\version.ini"
- if (current = remote)
- return
- MsgBox 0x40024,, New version`, update?
- IfMsgBox No
- return
- url := "https://github.com/Gewerd-Strauss/AHK-Code-Snippets/archive/refs/heads/Update()-Test.zip"
- file := A_Temp "\update.zip"
- UrlDownloadToFile % url, % file
- shell := ComObjCreate("Shell.Application")
- root := file "\AHK-Code-Snippets-Update-Test" ;**
- items := shell.Namespace(root).Items
- for item in items
- shell.Namespace(A_ScriptDir).CopyHere(item, 0x14) ; FOF_SILENT|FOF_NOCONFIRMATION
- MsgBox 0x40040,, Update finished!
- Reload
- }
- ; FOF_MULTIDESTFILES := 0x00000001 ; 1
- ; FOF_CONFIRMMOUSE := 0x00000002 ; 2
- ; FOF_SILENT := 0x00000004 ; 4
- ; FOF_RENAMEONCOLLISION := 0x00000008 ; 8
- ; FOF_NOCONFIRMATION := 0x00000010 ; 16
- ; FOF_WANTMAPPINGHANDLE := 0x00000020 ; 32
- ; FOF_ALLOWUNDO := 0x00000040 ; 64
- ; FOF_FILESONLY := 0x00000080 ; 128
- ; FOF_SIMPLEPROGRESS := 0x00000100 ; 256
- ; FOF_NOCONFIRMMKDIR := 0x00000200 ; 512
- ; FOF_NOERRORUI := 0x00000400 ; 1024
- ; FOF_NO_UI := 0x00000614 ; 1556
- ; FOF_NOCOPYSECURITYATTRIBS := 0x00000800 ; 2048
- ; FOF_NORECURSION := 0x00001000 ; 4096
- ; FOF_NO_CONNECTED_ELEMENTS := 0x00002000 ; 8192
- ; FOF_WANTNUKEWARNING := 0x00004000 ; 16384
- ; FOF_NORECURSEREPARSE := 0x00008000 ; 32768
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement