Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #Region
- #pragma compile(FileVersion, 1.0.0.0)
- #pragma compile(ProductVersion, 3.3.14.5)
- #pragma compile(ProductName, Portable Edge (Chromium)
- #pragma compile(Icon, Edge Updater.ico)
- #pragma compile(inputboxres, false)
- #pragma compile(Compression, 5)
- #pragma compile(CompanyName, Bens Rumpelkammer)
- #pragma compile(UPX, False)
- #AutoIt3Wrapper_Icon=system-software-update.ico
- #AutoIt3Wrapper_OutFile=Updater.exe
- #AutoIt3Wrapper_UseUpx=n
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_Comment=Updater for portable Microsoft Edge (Chromium)
- #AutoIt3Wrapper_Res_Description=Updater for portable Microsoft Edge (Chromium)
- #AutoIt3Wrapper_Res_Field=Developed by|Ben
- #AutoIt3Wrapper_Res_Field=Productname|Portable Edge Updater
- #AutoIt3Wrapper_Res_Field=Productversion|0.9.0
- #AutoIt3Wrapper_Res_Field=Made by|Ben
- #EndRegion
- ;7zr.exe (https://www.7-zip.org/sdk.html)
- ;curl.exe (https://curl.haxx.se/download.html)
- #include <misc.au3>
- #include <GUIConstants.au3>
- #include <StaticConstants.au3>
- #include <ColorConstants.au3>
- #include <Array.au3>
- Opt("MustDeclareVars", 0)
- Global $update_can, $update_dev, $update_beta, $update_stable, $canaryversion, $developerversion, $betaversion, $stableversion
- Global $c643, $c863, $d643, $d863, $b643, $b863, $s643, $s863, $tcheck, $cxx3, $cxx4, $cxx9, $done2, $done ,$updall
- Global $edgeupdatedir, $edgedir, $edgechannel, $edgelink, $version, $appid, $edgearch, $sicon, $arinstversion, $arversion
- Global $UserAgent
- If _singleton("Portable Edge Updater.exe", 0) = 0 Then
- ProcessClose("Portable Edge Updater.exe")
- EndIf
- If ProcessExists("msedge.exe") Then
- If @OSLang = 407 Then
- $ask = MsgBox(4, "Edge Updater", "Laufender Edge muss beendet werden bevor das Update gestartet werden kann. Edge jetzt beenden?")
- Else
- $ask = MsgBox(4, "Edge Updater", "Existing Edge must be quit before update can start. Quit Edge now?")
- EndIf
- If $ask = 7 Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Edge Updater beenden.")
- Else
- MsgBox(0, "Edge Updater", "Quit Edge updater.")
- EndIf
- Exit
- Else
- ProcessClose("msedge.exe")
- EndIf
- EndIf
- $tcheck = "0"
- Global $arinstdir[9] = ["Edge Canary x64", "Edge Dev x64", "Edge Beta x64", "Edge Stable x64", "Edge Canary x86", "Edge Dev x86", "Edge Beta x86", "Edge Stable x86", "Edge"]
- Global $arappid[8] = ["msedge-canary-win-x64", "msedge-dev-win-x64", "msedge-beta-win-x64", "msedge-stable-win-x64", "msedge-canary-win-x86", "msedge-dev-win-x86", "msedge-beta-win-x86", "msedge-stable-win-x86"]
- Global $archannnel[8] = ["Canary", "Developer", "Beta", "Stable", "Canary", "Developer", "Beta", "Stable"]
- Global $arupdater[8] = [2, 6, 7, 8, 1, 3, 4, 5]
- Global $aricon[8] = ["4", "8", "9", "0", "4", "8", "9", "0"]
- _instversion()
- $udpall = ""
- GUICreate("Edge Updater", 330, 300)
- Opt("GUICoordMode", 0)
- $canaryversion = GUICtrlCreateLabel("", 15, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- If @OSArch = "x86" Then
- $canary = GUICtrlCreateButton("x86", 226, -1, 50, 25)
- If IsDeclared("c863") Then GUICtrlSetTip(-1, $c863)
- Else
- $canary = GUICtrlCreateButton("x86", 201, -1, 50, 25)
- If IsDeclared("c863") Then GUICtrlSetTip(-1, $c863)
- $canary64 = GUICtrlCreateButton("x64", 51, -1, 50, 25)
- If IsDeclared("c643") Then GUICtrlSetTip(-1, $c643)
- EndIf
- If @OSArch = "x86" Then
- $developerversion = GUICtrlCreateLabel("", -226, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $dev = GUICtrlCreateButton("x86", 226, 0, 50, 25)
- If IsDeclared("d863") Then GUICtrlSetTip(-1, $d863)
- Else
- $developerversion = GUICtrlCreateLabel("", -252, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $dev = GUICtrlCreateButton("x86", 201, 0, 50, 25)
- If IsDeclared("d863") Then GUICtrlSetTip(-1, $d863)
- $dev64 = GUICtrlCreateButton("x64", 51, 0, 50, 25)
- If IsDeclared("d643") Then GUICtrlSetTip(-1, $d643)
- EndIf
- If @OSArch = "x86" Then
- $betaversion = GUICtrlCreateLabel("", -226, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $beta = GUICtrlCreateButton("x86", 226, 0, 50, 25)
- If IsDeclared("b863") Then GUICtrlSetTip(-1, $b863)
- Else
- $betaversion = GUICtrlCreateLabel("", -252, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $beta = GUICtrlCreateButton("x86", 201, 0, 50, 25)
- If IsDeclared("b863") Then GUICtrlSetTip(-1, $b863)
- $beta64 = GUICtrlCreateButton("x64", 51, 0, 50, 25)
- If IsDeclared("b643") Then GUICtrlSetTip(-1, $b643)
- EndIf
- If @OSArch = "x86" Then
- $stableversion = GUICtrlCreateLabel("", -226, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $release = GUICtrlCreateButton("x86", 226, 0, 50, 25)
- If IsDeclared("s863") Then GUICtrlSetTip(-1, $s863)
- Else
- $stableversion = GUICtrlCreateLabel("", -252, 30, 200, 25)
- GUICtrlSetFont(-1, 12)
- $release = GUICtrlCreateButton("x86", 201, 0, 50, 25)
- If IsDeclared("s863") Then GUICtrlSetTip(-1, $s863)
- $release64 = GUICtrlCreateButton("x64", 51, 0, 50, 25)
- If IsDeclared("s643") Then GUICtrlSetTip(-1, $s643)
- EndIf
- If @OSArch = "x86" Then
- $allx64 = 4
- $allx86 = 4
- EndIf
- If @OSArch = "x64" Then
- If @OSLang = 407 Then
- $allall = GUICtrlCreateLabel("Alle x86 oder x64 installieren", -252, 40, 149, 30)
- $allver = GUICtrlCreateCheckbox("Alle", 150, -1, 50, 15)
- Else
- $allall = GUICtrlCreateLabel("Install all x86 or x64", -252, 40, 149, 30)
- $allver = GUICtrlCreateCheckbox("All", 150, -1, 50, 15)
- EndIf
- $allx86 = GUICtrlCreateCheckbox("x86", 51, -1, 50, 15)
- $allx64 = GUICtrlCreateCheckbox("x64", 51, -1, 50, 15)
- GUICtrlSetState($allver, $gui_disable)
- GUICtrlSetState($allall, $gui_disable)
- GUICtrlSetState($allx86, $gui_disable)
- GUICtrlSetState($allx64, $gui_disable)
- EndIf
- If @OSArch = "x86" Then
- If @OSLang = 407 Then
- $installdir = GUICtrlCreateCheckbox("Für jede Version einen Ordner anlegen", -226, 35, 200, 20)
- If $tcheck = 1 Then GUICtrlSetState(-1, $gui_checked)
- Else
- $installdir = GUICtrlCreateCheckbox("Create a folder for each version", -226, 35, 200, 20)
- If $tcheck = 1 Then GUICtrlSetState(-1, $gui_checked)
- EndIf
- If $tcheck = 1 Then
- If NOT _direxists(@ScriptDir & "\Edge*x86") Then
- _CGBAI()
- Else
- _CGBAU()
- EndIf
- ElseIf $tcheck = 0 Then
- $updall = GUICtrlCreateButton("", 201, -1, 100, 25)
- EndIf
- Else
- If @OSLang = 407 Then
- $installdir = GUICtrlCreateCheckbox("Für jede Version einen Ordner anlegen", -252, 25, 200, 20)
- If $tcheck = 1 Then GUICtrlSetState(-1, $gui_checked)
- Else
- $installdir = GUICtrlCreateCheckbox("Create a folder for each version", -252, 25, 200, 20)
- If $tcheck = 1 Then GUICtrlSetState(-1, $gui_checked)
- EndIf
- If $tcheck = 1 Then
- If NOT _direxists(@ScriptDir & "\Edge*x86") AND NOT _direxists(@ScriptDir & "\Edge*x64") Then
- _CGBAI()
- Else
- _CGBAU()
- EndIf
- ElseIf $tcheck = 0 Then
- $updall = GUICtrlCreateButton("", 201, -1, 100, 25)
- EndIf
- EndIf
- If @OSLang = 407 Then
- $vcheck = GUICtrlCreateCheckbox("Versionskontrolle ignorieren", -201, 20, 200, 20)
- Else
- $vcheck = GUICtrlCreateCheckbox("Ignore version control", -201, 20, 200, 20)
- EndIf
- If @OSLang = 407 Then
- $close = GUICtrlCreateButton("Beenden", 230, 40, 70, 25)
- Else
- $close = GUICtrlCreateButton("Exit", 230, 40, 70, 25)
- EndIf
- If @OSArch = "x64" Then _buttonchange()
- _versioninfo()
- Global $arguibutton[8] = [$canary64, $dev64, $beta64, $release64, $canary, $dev, $beta, $release]
- Global $arinstchoice[4] = [$allall, $allx86, $allx64, $allver]
- _guichange(1)
- GUISetState()
- If @OSArch = "x86" Then
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = $gui_event_close
- Exit
- Case $msg = $installdir
- _guichange(1)
- Case $msg = $canary
- updater(1, "x86", 1)
- Case $msg = $dev
- updater(3, "x86", 1)
- Case $msg = $beta
- updater(4, "x86", 1)
- Case $msg = $release
- updater(5, "x86", 1)
- Case $msg = $updall
- _updateall()
- Case $msg = $close
- FileDelete(@ScriptDir & "\7zr.exe")
- DirRemove(@ScriptDir & "\Update\", 1)
- Exit
- EndSelect
- WEnd
- Else
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = $gui_event_close
- Exit
- Case $msg = $allver
- _instchange()
- _buttonchange()
- Case $msg = $allx86
- _buttonchange()
- Case $msg = $allx64
- _buttonchange()
- Case $msg = $installdir
- _guichange(1)
- Case $msg = $canary
- updater(1, "x86", 1)
- Case $msg = $canary64
- updater(2, "x64", 1)
- Case $msg = $dev
- updater(3, "x86", 1)
- Case $msg = $beta
- updater(4, "x86", 1)
- Case $msg = $release
- updater(5, "x86", 1)
- Case $msg = $dev64
- updater(6, "x64", 1)
- Case $msg = $beta64
- updater(7, "x64", 1)
- Case $msg = $release64
- updater(8, "x64", 1)
- Case $msg = $updall
- _updateall()
- Case $msg = $close
- FileDelete(@ScriptDir & "\7zr.exe")
- DirRemove(@ScriptDir & "\Update\", 1)
- Exit
- EndSelect
- WEnd
- EndIf
- Func _updateall()
- $vstatx86 = GUICtrlRead($allx86)
- $vstatx64 = GUICtrlRead($allx64)
- If $vstatx86 = 1 Then
- $linkx86 = 1
- Else
- $linkx86 = 4
- EndIf
- If $vstatx64 = 1 Then
- $linkx64 = 1
- Else
- $linkx64 = 4
- EndIf
- If $tcheck = 1 Then
- $done2 = 0
- _instversion()
- _updateall2("x86", 4, 7)
- If @OSArch = "x64" Then _updateall2("x64", 0, 3)
- If @OSArch = "x86" OR $vstatx86 = 1 Then
- If NOT _direxists(@ScriptDir & "\Edge*x86") Then _installall2("x86", 4, 7)
- EndIf
- If $vstatx64 = 1 Then
- If NOT _direxists(@ScriptDir & "\Edge*x64") Then _installall2("x64", 0, 3)
- EndIf
- If $done2 = 0 Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Edge ist Aktuell")
- Else
- MsgBox(0, "Edge Updater", "Edge is Up-to-date")
- EndIf
- EndIf
- If $done2 = 1 Then
- If $linkx86 = 1 AND $vstatx86 = 1 Then
- If NOT FileExists(@ScriptDir & "\Edge *x86.lnk") AND NOT FileExists(@DesktopDir & "\Edge *x86.lnk") Then _linkmenu("x86")
- EndIf
- If $linkx64 = 1 AND $vstatx64 = 1 Then
- If NOT FileExists(@ScriptDir & "\Edge *x64.lnk") AND NOT FileExists(@DesktopDir & "\Edge *x64.lnk") Then _linkmenu("x64")
- EndIf
- If @OSArch = "x86" Then
- If NOT FileExists(@ScriptDir & "\Edge *x86.lnk") AND NOT FileExists(@DesktopDir & "\Edge *x86.lnk") Then
- _linkmenu("x86")
- Else
- _msgpost()
- EndIf
- EndIf
- If $linkx86 = 1 AND $vstatx86 = 1 AND $linkx64 = 1 AND $vstatx64 = 1 Then
- If NOT FileExists(@ScriptDir & "\Edge *x86.lnk") AND NOT FileExists(@DesktopDir & "\Edge *x86.lnk") Then _linkmenu("")
- EndIf
- If $linkx86 = 4 AND $linkx64 = 4 AND $vstatx64 = 4 AND $vstatx86 = 4 Then
- If FileExists(@ScriptDir & "\Edge *.lnk") OR FileExists(@DesktopDir & "\Edge *.lnk") Then
- _msgpost()
- EndIf
- EndIf
- EndIf
- If $tcheck = 0 Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Diese Funktion ist nur für Alle Versionen vorgesehen")
- Else
- MsgBox(0, "Edge Updater", "This function is intended for all versions only")
- EndIf
- EndIf
- EndIf
- EndFunc
- Func _guichange($test)
- $test2 = GUICtrlRead($installdir)
- $tcheck = 1
- _instversion()
- If $test = 1 Then
- If $test2 > 1 Then
- GUICtrlSetData($updall, "")
- $tcheck = 0
- If @OSArch = "x64" Then
- _buttonset(0, 3)
- _disablegui()
- If _direxists(@ScriptDir & "\Edge*x86") Then GUICtrlSetState($allx86, $gui_disable)
- If _direxists(@ScriptDir & "\Edge*x64") Then GUICtrlSetState($allx64, $gui_disable)
- EndIf
- _buttonset(4, 7)
- If FileExists(@ScriptDir & "\Edge\updates\" & "Version.log") Then _buttoncolor("x86", 4, 7)
- If FileExists(@ScriptDir & "\Edge\updates\" & "Version.log") Then _buttoncolor("x64", 0, 3)
- Else
- If @OSArch = "x64" Then
- _buttonset(0, 3)
- _enablegui()
- If _direxists(@ScriptDir & "\Edge*x86") Then
- _disablegui2($allx86)
- _disablegui2($allver)
- EndIf
- If _direxists(@ScriptDir & "\Edge*x64") Then
- _disablegui2($allx64)
- _disablegui2($allver)
- EndIf
- EndIf
- _buttonset(4, 7)
- _buttoncolor2()
- If NOT _direxists(@ScriptDir & "\Edge Canary x86") AND NOT _direxists(@ScriptDir & "\Edge Canary x64") AND NOT _direxists(@ScriptDir & "\Edge Dev x86") AND NOT _direxists(@ScriptDir & "\Edge Dev x64") AND NOT _direxists(@ScriptDir & "\Edge Beta x86") AND NOT _direxists(@ScriptDir & "\Edge Beta x64") AND NOT _direxists(@ScriptDir & "\Edge Stable x86") AND NOT _direxists(@ScriptDir & "\Edge Stable x64") Then
- If @OSLang = 407 Then
- GUICtrlSetData($updall, "Alle Installieren")
- Else
- GUICtrlSetData($updall, "Install All")
- EndIf
- Else
- If @OSLang = 407 Then
- GUICtrlSetData($updall, "Alle Updaten")
- Else
- GUICtrlSetData($updall, "Update All")
- EndIf
- EndIf
- EndIf
- EndIf
- EndFunc
- Func updater($channel, $arch, $done)
- $vstate = GUICtrlRead($vcheck)
- $instcheck = GUICtrlRead($installdir)
- If $channel = 1 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 0, 4, "x86")
- Else
- _edgeinstdir(4, 0, 4, "x86")
- EndIf
- ElseIf $channel = 2 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 0, 0, "x64")
- Else
- _edgeinstdir(0, 0, 0, "x64")
- EndIf
- ElseIf $channel = 3 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 1, 5, "x86")
- Else
- _edgeinstdir(5, 1, 5, "x86")
- EndIf
- ElseIf $channel = 4 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 2, 6, "x86")
- Else
- _edgeinstdir(6, 2, 6, "x86")
- EndIf
- ElseIf $channel = 5 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 3, 7, "x86")
- Else
- _edgeinstdir(7, 3, 7, "x86")
- EndIf
- ElseIf $channel = 6 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 1, 1, "x64")
- Else
- _edgeinstdir(1, 1, 1, "x64")
- EndIf
- ElseIf $channel = 7 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 2, 2, "x64")
- Else
- _edgeinstdir(2, 2, 2, "x64")
- EndIf
- ElseIf $channel = 8 Then
- If $instcheck > 1 Then
- _edgeinstdir(8, 3, 3, "x64")
- Else
- _edgeinstdir(3, 3, 3, "x64")
- EndIf
- EndIf
- $data = "{}"
- $ohttp = ObjCreate("MSXML2.XMLHTTP.6.0")
- $ohttp.open("Post", "https://msedge.api.cdp.microsoft.com/api/v1/contents/Browser/namespaces/Default/names/" & $appid & "/versions/" & $version & "/files?action=GenerateDownloadInfo", False)
- $oHTTP.setRequestHeader("User-Agent", $UserAgent)
- $oHTTP.SetRequestHeader("If-Modified-Since", "Sat, 1 Jan 1970 00:00:00 GMT")
- $ohttp.setrequestheader("Content-Type", "application/json")
- $ohttp.send($data)
- $oreceived = $ohttp.responsetext
- $position = StringInStr($oreceived, "MicrosoftEdge_" & $edgearch & "_" & $version & ".")
- $urltmp2 = StringMid($oreceived, $position + 26, StringLen($oreceived) - $position - 26)
- $url3 = StringSplit($urltmp2, '"')
- $url4 = $url3[5]
- $sv_version = $version
- If NOT $url3[5] Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Es wurde keine URL zurkgegeben!")
- Else
- MsgBox(0, "Edge Updater", "Request failure!")
- EndIf
- DirRemove(@ScriptDir & "\Update", 1)
- EndIf
- If $vstate > 1 Then
- If FileExists(@ScriptDir & $edgeupdatedir & "Version.log") Then
- $vedge = FileRead(@ScriptDir & $edgeupdatedir & "Version.log")
- $vedge2 = StringSplit($vedge, "|")
- $vedge3 = $vedge2[1]
- $vedge4 = $vedge2[3]
- If IsDeclared("vEdge3") AND IsDeclared("vEdge4") Then
- If $version == $vedge3 AND $vedge4 == $edgearch Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Keine neue Version gefunden!")
- DirRemove(@ScriptDir & "\Update", 1)
- Return
- Else
- MsgBox(0, "Edge Updater", "No new version available!")
- DirRemove(@ScriptDir & "\Update", 1)
- Return
- EndIf
- EndIf
- EndIf
- EndIf
- EndIf
- FileInstall("curl.exe", @ScriptDir & "\")
- If NOT FileExists(@ScriptDir & "\curl.exe") Then FileInstall("curl.exe", @ScriptDir & "\")
- $icurl = "--output " & Chr(34) & @ScriptDir & "\Update\Edge_aktuell.exe" & Chr(34) & " " & Chr(34) & $url4 & Chr(34)
- RunWait(@ScriptDir & "\curl.exe " & $icurl)
- Sleep(50)
- DirRemove(@ScriptDir & "\Edge\Resources\Inspector", 1)
- FileInstall("7zr.exe", @ScriptDir & "\")
- If NOT FileExists(@ScriptDir & "\7zr.exe") Then FileInstall("7zr.exe", @ScriptDir & "\")
- If $channel < 9 Then
- RunWait('7zr.exe x "' & @ScriptDir & '\Update\Edge_aktuell.exe" -o"' & @ScriptDir & '\Update"')
- RunWait('7zr.exe x "' & @ScriptDir & '\Update\MSEDGE.7z" -o"' & @ScriptDir & '\Update\extracted"')
- Else
- RunWait('7zr.exe x "' & @ScriptDir & '\Update\Edge_aktuell.exe" -o"' & @ScriptDir & '\Update"')
- EndIf
- If $channel < 9 Then
- $first = FileFindFirstFile(@ScriptDir & "\Update\extracted\Chrome-bin\*.*")
- $versions_ordner = FileFindNextFile($first)
- FileClose($first)
- If FileExists(@ScriptDir & $edgeupdatedir & "Version.log") Then
- $cversioncontrol = FileRead(@ScriptDir & $edgeupdatedir & "Version.log")
- $cversioncontrol2 = StringSplit($cversioncontrol, "|")
- $cversioncontrol3 = $cversioncontrol2[1]
- If _direxists(@ScriptDir & $edgedir & $cversioncontrol3) Then DirRemove(@ScriptDir & $edgedir & $cversioncontrol3, 1)
- EndIf
- DirCopy(@ScriptDir & "\Update\extracted\Chrome-bin\" & $versions_ordner & "\", @ScriptDir & $edgedir & $versions_ordner & "\", 1)
- FileCopy(@ScriptDir & "\Update\extracted\Chrome-bin\msedge.exe", @ScriptDir & $edgedir, 1)
- FileCopy(@ScriptDir & "\Update\extracted\Chrome-bin\wow_helper.exe", @ScriptDir & $edgedir, 1)
- FileCopy(@ScriptDir & "\Update\extracted\Chrome-bin\msedge_proxy.exe", @ScriptDir & $edgedir, 1)
- DirCopy(@ScriptDir & "\Update\extraced\Chrome-bin\Dictionaries", @ScriptDir & $edgedir, 1)
- $edgetmp = $edgeupdatedir & "*.txt"
- $av_temp = FileFindFirstFile(@ScriptDir & $edgetmp)
- $alte_version = FileFindNextFile($av_temp)
- FileClose($av_temp)
- FileDelete(@ScriptDir & $edgeupdatedir & $alte_version)
- FileDelete(@ScriptDir & $edgeupdatedir & "Version.log")
- FileWrite(@ScriptDir & $edgeupdatedir & "Version" & ".log", $sv_version & "|" & $edgechannel & "|" & $arch)
- $edgedir2 = StringTrimRight($edgedir, 1)
- EndIf
- FileDelete(@ScriptDir & "\7zr.exe")
- FileDelete(@ScriptDir & "\curl.exe")
- DirRemove(@ScriptDir & "\Update\", 1)
- If $done = 1 Then
- If FileExists(@ScriptDir & $edgelink) OR FileExists(@DesktopDir & $edgelink) Then
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Edge aktualisiert")
- Else
- MsgBox(0, "Edge Updater", "Edge updated")
- EndIf
- If $instcheck > 1 Then
- If FileExists(@ScriptDir & $edgelink) Then
- Local $aarray = FileGetShortcut(@ScriptDir & $edgelink)
- FileCreateShortcut(@ScriptDir & $edgedir & "msedge.exe", @ScriptDir & $edgelink, @ScriptDir & $edgedir2, $aarray[2], "", @ScriptDir & $edgedir & "msedge.exe", "", $sicon)
- ElseIf FileExists(@DesktopDir & $edgelink) Then
- Local $aarray = FileGetShortcut(@DesktopDir & $edgelink)
- FileCreateShortcut(@ScriptDir & $edgedir & "msedge.exe", @DesktopDir & $edgelink, @ScriptDir & $edgedir2, $aarray[2], "", @ScriptDir & $edgedir & "msedge.exe", "", $sicon)
- EndIf
- EndIf
- ElseIf NOT FileExists(@ScriptDir & $edgelink) AND NOT FileExists(@DesktopDir & $edgelink) Then
- If @OSLang = 407 Then
- $lgui = GUICreate("Edge Updater", 320, 230)
- Opt("GUICoordMode", 0)
- GUICtrlCreateLabel("Edge ist fertig installiert", 60, 20, 200)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Wollen sie eine Verknüpfung erstellen ?", -45, 35, 300, 20)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Wenn nichts ausgewählt ist, wird das lokale Standardprofil von Google verwendet.", -1, 35, 300, 35)
- GUICtrlSetFont(-1, 10)
- $cprofile = GUICtrlCreateCheckbox("Mit einem Portablen Profil für alle Versionen", -1, 40, 250, 20)
- $csprofile = GUICtrlCreateCheckbox("Für jede Version ein Portables Profil", -1, 20, 250, 20)
- $ldcreate = GUICtrlCreateButton("Auf dem Desktop", -1, 35, 100, 30)
- $lcreate = GUICtrlCreateButton("Script Ordner", 101, -1, 100, 30)
- $lcreanot = GUICtrlCreateButton("NEIN", 110, -1, 80, 30)
- Else
- $lgui = GUICreate("Edge Updater", 320, 230)
- Opt("GUICoordMode", 0)
- GUICtrlCreateLabel("Edge is installed", 60, 20, 200)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Do you want to create a shortcut ?", -45, 35, 300, 20)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("If nothing is selected, the Local Standard Profile of Google will be used.", -1, 35, 300, 35)
- GUICtrlSetFont(-1, 10)
- $cprofile = GUICtrlCreateCheckbox("With one portable profile for all versions", -1, 40, 250, 20)
- $csprofile = GUICtrlCreateCheckbox("A portable profile for each version", -1, 20, 250, 20)
- $ldcreate = GUICtrlCreateButton("On the Desktop", -1, 35, 100, 30)
- $lcreate = GUICtrlCreateButton("Script folder", 101, -1, 100, 30)
- $lcreanot = GUICtrlCreateButton("NO", 110, -1, 80, 30)
- EndIf
- GUISetState(@SW_SHOW, $lgui)
- GUICtrlSetTip($cprofile, '--user-data-dir="..\profile"')
- GUICtrlSetTip($csprofile, '--user-data-dir=".\profile"')
- GUICtrlSetTip($ldcreate, @DesktopDir)
- GUICtrlSetTip($lcreate, @ScriptDir)
- While 1
- $msg = GUIGetMsg()
- If GUICtrlRead($cprofile) = 1 Then
- $coption = '--user-data-dir="..\profile"'
- ElseIf GUICtrlRead($csprofile) = 1 Then
- $coption = '--user-data-dir=".\profile"'
- Else
- $coption = ""
- EndIf
- Select
- Case $msg = $gui_event_close
- GUIDelete()
- ExitLoop
- Case $msg = $cprofile
- GUICtrlSetState($csprofile, $gui_unchecked)
- Case $msg = $csprofile
- GUICtrlSetState($cprofile, $gui_unchecked)
- Case $msg = $ldcreate
- GUIDelete()
- FileCreateShortcut(@ScriptDir & $edgedir & "msedge.exe", @DesktopDir & $edgelink, @ScriptDir & $edgedir2, $coption, "", @ScriptDir & $edgedir & "msedge.exe", "", $sicon)
- ExitLoop
- Case $msg = $lcreate
- GUIDelete()
- FileCreateShortcut(@ScriptDir & $edgedir & "msedge.exe", @ScriptDir & $edgelink, @ScriptDir & $edgedir2, $coption, "", @ScriptDir & $edgedir & "msedge.exe", "", $sicon)
- ExitLoop
- Case $msg = $lcreanot
- GUIDelete()
- ExitLoop
- EndSelect
- WEnd
- EndIf
- EndIf
- _guichange(1)
- Return
- EndFunc
- Func _createlink($coption, $lsdir)
- For $i = 0 To 7
- If Not FileExists($lsdir & "\" & $arinstdir[$i] & ".lnk") Then
- If _direxists(@ScriptDir & "\" & $arinstdir[$i] & "\updates") Then FileCreateShortcut(@ScriptDir & "\" & $arinstdir[$i] & "\msedge.exe", $lsdir & "\" & $arinstdir[$i] & ".lnk", @ScriptDir & "\" & $arinstdir[$i], $coption, "", @ScriptDir & "\" & $arinstdir[$i] & "\msedge.exe", "", $aricon[$i])
- EndIf
- Next
- EndFunc
- Func _direxists($spath)
- Return StringInStr(FileGetAttrib($spath), "D")
- EndFunc
- Func _buttonchange()
- $vstatx86 = GUICtrlRead($allx86)
- $vstatx64 = GUICtrlRead($allx64)
- If $vstatx64 = 4 AND $vstatx86 = 1 Then GUICtrlSetState($allver, $gui_unchecked)
- If $vstatx64 = 1 AND $vstatx86 = 4 Then GUICtrlSetState($allver, $gui_unchecked)
- If $vstatx64 = 1 AND $vstatx86 = 1 Then GUICtrlSetState($allver, $gui_checked)
- If $vstatx86 = 1 OR $vstatx64 = 1 Then
- GUICtrlSetState($updall, $gui_enable)
- Else
- GUICtrlSetState($updall, $gui_disable)
- EndIf
- If _direxists(@ScriptDir & "\Edge Canary x86") OR _direxists(@ScriptDir & "\Edge Canary x64") OR _direxists(@ScriptDir & "\Edge Dev x86") OR _direxists(@ScriptDir & "\Edge Dev x64") OR _direxists(@ScriptDir & "\Edge Beta x86") OR _direxists(@ScriptDir & "\Edge Beta x64") OR _direxists(@ScriptDir & "\Edge Stable x86") OR _direxists(@ScriptDir & "\Edge Stable x64") Then
- GUICtrlSetState($updall, $gui_enable)
- EndIf
- If NOT _direxists(@ScriptDir & "\Edge*x86") Then _msipost()
- If NOT _direxists(@ScriptDir & "\Edge*x64") Then _msipost()
- If $vstatx86 = 4 AND $vstatx64 = 4 Then
- If @OSLang = 407 Then
- GUICtrlSetData($updall, "Alle Updaten")
- Else
- GUICtrlSetData($updall, "Update All")
- EndIf
- EndIf
- EndFunc
- Func _instchange()
- $vstatallver = GUICtrlRead($allver)
- If $vstatallver = 1 Then
- GUICtrlSetState($allx86, $gui_checked)
- GUICtrlSetState($allx64, $gui_checked)
- EndIf
- If $vstatallver = 4 Then
- GUICtrlSetState($allx86, $gui_unchecked)
- GUICtrlSetState($allx64, $gui_unchecked)
- EndIf
- EndFunc
- Func _linkmenu($linkarch)
- If NOT FileExists(@ScriptDir & "\Edge*" & $linkarch & ".lnk") AND NOT FileExists(@DesktopDir & "\Edge*" & $linkarch & ".lnk") Then
- If @OSLang = 407 Then
- $lgui = GUICreate("Edge Updater", 320, 230)
- Opt("GUICoordMode", 0)
- GUICtrlCreateLabel("Edge ist fertig installiert", 60, 20, 200)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Wollen sie eine Verknüpfung erstellen ?", -45, 35, 300, 20)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Wenn nichts ausgewählt ist, wird das lokale Standardprofil von MSEdge verwendet.", -1, 35, 300, 35)
- GUICtrlSetFont(-1, 10)
- $cprofile = GUICtrlCreateCheckbox("Mit einem Portablen Profil für alle Versionen", -1, 40, 250, 20)
- $csprofile = GUICtrlCreateCheckbox("Für jede Version ein Portables Profil", -1, 20, 250, 20)
- $ldcreate = GUICtrlCreateButton("Auf dem Desktop", -1, 35, 100, 30)
- $lcreate = GUICtrlCreateButton("Script Ordner", 101, -1, 100, 30)
- $lcreanot = GUICtrlCreateButton("NEIN", 110, -1, 80, 30)
- Else
- $lgui = GUICreate("Edge Updater", 320, 230)
- Opt("GUICoordMode", 0)
- GUICtrlCreateLabel("Edge is installed", 60, 20, 200)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("Do you want to create a shortcut ?", -45, 35, 300, 20)
- GUICtrlSetFont(-1, 12)
- GUICtrlCreateLabel("If nothing is selected, the Local Standard Profile of MSEdge will be used.", -1, 35, 300, 35)
- GUICtrlSetFont(-1, 10)
- $cprofile = GUICtrlCreateCheckbox("With one portable profile for all versions", -1, 40, 250, 20)
- $csprofile = GUICtrlCreateCheckbox("A portable profile for each version", -1, 20, 250, 20)
- $ldcreate = GUICtrlCreateButton("On the Desktop", -1, 35, 100, 30)
- $lcreate = GUICtrlCreateButton("Script folder", 101, -1, 100, 30)
- $lcreanot = GUICtrlCreateButton("NO", 110, -1, 80, 30)
- EndIf
- GUISetState(@SW_SHOW, $lgui)
- GUICtrlSetTip($cprofile, '--user-data-dir="..\profile"')
- GUICtrlSetTip($csprofile, '--user-data-dir=".\profile"')
- GUICtrlSetTip($ldcreate, @DesktopDir)
- GUICtrlSetTip($lcreate, @ScriptDir)
- While 1
- $msg = GUIGetMsg()
- If GUICtrlRead($cprofile) = 1 Then
- $coption = '--user-data-dir="..\profile"'
- ElseIf GUICtrlRead($csprofile) = 1 Then
- $coption = '--user-data-dir=".\profile"'
- Else
- $coption = ""
- EndIf
- Select
- Case $msg = $gui_event_close
- GUIDelete()
- ExitLoop
- Case $msg = $cprofile
- GUICtrlSetState($csprofile, $gui_unchecked)
- Case $msg = $csprofile
- GUICtrlSetState($cprofile, $gui_unchecked)
- Case $msg = $lcreate
- GUIDelete()
- _createlink($coption, @ScriptDir)
- ExitLoop
- Case $msg = $ldcreate
- GUIDelete()
- _createlink($coption, @DesktopDir)
- ExitLoop
- Case $msg = $lcreanot
- GUIDelete()
- ExitLoop
- EndSelect
- WEnd
- Else
- _msgpost()
- EndIf
- EndFunc
- Func _buttoncolor($arch, $1, $2)
- If $cxx9 = $arch Then
- For $i = $1 To $2
- If $cxx4 = $archannnel[$i] Then
- If $arversion[$i] = $cxx3 Then
- GUICtrlSetTip($arguibutton[$i], $cxx3)
- GUICtrlSetBkColor($arguibutton[$i], $color_green)
- Else
- GUICtrlSetTip($arguibutton[$i], $cxx3)
- GUICtrlSetBkColor($arguibutton[$i], $color_red)
- EndIf
- EndIf
- Next
- EndIf
- EndFunc
- Func _buttoncolor2()
- For $i = 0 To 7
- If _direxists(@ScriptDir & "\" & $arinstdir[$i] & "\updates") Then
- If $arversion[$i] = $arinstversion[$i] Then
- GUICtrlSetTip($arguibutton[$i], $arinstversion[$i])
- GUICtrlSetBkColor($arguibutton[$i], $color_green)
- Else
- GUICtrlSetTip($arguibutton[$i], $arinstversion[$i])
- GUICtrlSetBkColor($arguibutton[$i], $color_red)
- EndIf
- EndIf
- Next
- EndFunc
- Func _buttonset($1, $2)
- For $i = $1 To $2
- GUICtrlSetStyle($arguibutton[$i], $gui_ss_default_button)
- GUICtrlSetTip($arguibutton[$i], "")
- Next
- EndFunc
- Func _disablegui2($call)
- GUICtrlSetState($call, $gui_disable)
- EndFunc
- Func _enablegui()
- For $i = 0 To 3
- GUICtrlSetState($arinstchoice[$i], $gui_enable)
- Next
- EndFunc
- Func _disablegui()
- For $i = 0 To 3
- GUICtrlSetState($arinstchoice[$i], $gui_disable)
- Next
- EndFunc
- Func _versioninfo()
- Local $arcontrol[4] = [$canaryversion, $developerversion, $betaversion, $stableversion]
- For $i = 0 To 3
- $data = '{"targetingAttributes":{"AppAp":"","AppCohort":"","AppLang":"de-de","AppRollout":"1.0","AppVersion":"","IsMachine":"0","OsArch":"x64","OsPlatform":"win","OsVersion":"","Updater":"MicrosoftEdgeUpdate","UpdaterVersion":"1.3.101.13"}}'
- $ohttp = ObjCreate("MSXML2.XMLHTTP.6.0")
- $ohttp.open("POST", "https://msedge.api.cdp.microsoft.com/api/v1/contents/Browser/namespaces/Default/names/" & $arappid[$i] & "/versions/latest?action=select", False)
- $oHTTP.setRequestHeader("User-Agent", $UserAgent)
- $oHTTP.SetRequestHeader("If-Modified-Since", "Sat, 1 Jan 1970 00:00:00 GMT")
- $ohttp.setrequestheader("Content-Type", "application/json")
- $ohttp.send($data)
- $oreceived = $ohttp.responsetext
- $position = StringInStr($oreceived, '"Version":"')
- $urltmp = StringMid($oreceived, $position + 11, StringLen($oreceived) - $position - 11)
- $url = StringSplit($urltmp, '"')
- $edgeversion = $url[1]
- GUICtrlSetData($arcontrol[$i], $archannnel[$i] & " " & $edgeversion)
- If $archannnel[$i] = "Canary" Then $update_can = $edgeversion
- If $archannnel[$i] = "Developer" Then $update_dev = $edgeversion
- If $archannnel[$i] = "Beta" Then $update_beta = $edgeversion
- If $archannnel[$i] = "Stable" Then $update_stable = $edgeversion
- Next
- Global $arversion[8] = [$update_can, $update_dev, $update_beta, $update_stable, $update_can, $update_dev, $update_beta, $update_stable]
- EndFunc
- Func _instversion()
- For $i = 0 To 8
- If FileExists(@ScriptDir & "\" & $arinstdir[$i] & "\updates\" & "Version.log") Then
- $sfilename = FileRead(@ScriptDir & "\" & $arinstdir[$i] & "\updates\" & "Version.log")
- $installedversion = StringSplit($sfilename, "|")
- If $arinstdir[$i] = "Edge Canary x64" Then
- $c643 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Canary x86" Then
- $c863 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Dev x64" Then
- $d643 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Dev x86" Then
- $d863 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Beta x64" Then
- $b643 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Beta x86" Then
- $b863 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Stable x64" Then
- $s643 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge Stable x86" Then
- $s863 = $installedversion[1]
- $tcheck = "1"
- ElseIf $arinstdir[$i] = "Edge" Then
- $cxx3 = $installedversion[1]
- $cxx4 = $installedversion[2]
- $cxx9 = $installedversion[3]
- EndIf
- EndIf
- Next
- Global $arinstversion[8] = [$c643, $d643, $b643, $s643, $c863, $d863, $b863, $s863]
- EndFunc
- Func _updateall2($barch, $1, $2)
- For $i = $1 To $2
- If _direxists(@ScriptDir & "\" & $arinstdir[$i]) Then
- If NOT ($arversion[$i] = $arinstversion[$i]) Then
- updater($arupdater[$i], $barch, 0)
- $done2 = 1
- EndIf
- EndIf
- Next
- EndFunc
- Func _installall2($barch, $1, $2)
- For $i = $1 To $2
- If NOT _direxists(@ScriptDir & "\" & $arinstdir[$i]) Then
- updater($arupdater[$i], $barch, 0)
- $done2 = 1
- EndIf
- Next
- EndFunc
- Func _msgpost()
- If @OSLang = 407 Then
- MsgBox(0, "Edge Updater", "Edge aktualisiert")
- GUICtrlSetData($updall, "Alle Updaten")
- Else
- MsgBox(0, "Edge Updater", "Edge updated")
- GUICtrlSetData($updall, "Update All")
- EndIf
- EndFunc
- Func _msipost()
- If @OSLang = 407 Then
- GUICtrlSetData($updall, "Alle Installieren")
- Else
- GUICtrlSetData($updall, "Install All")
- EndIf
- EndFunc
- Func _edgeinstdir($1, $2, $3, $4)
- Local $aricon[4] = ["4", "8", "9", "0"]
- $version = $arversion[$2]
- $appid = $arappid[$3]
- $edgearch = $4
- $sicon = $aricon[$2]
- $edgeupdatedir = "\" & $arinstdir[$1] & "\updates\"
- $edgedir = "\" & $arinstdir[$1] & "\"
- $edgechannel = $archannnel[$2]
- $edgelink = "\" & $arinstdir[$1] & ".lnk"
- DirCreate(@ScriptDir & "\Update")
- DirCreate(@ScriptDir & $edgeupdatedir)
- EndFunc
- Func _CGBAI()
- If @OSLang = 407 Then
- $updall = GUICtrlCreateButton("Alle Installieren", 201, -1, 100, 25)
- Else
- $updall = GUICtrlCreateButton("Install All", 201, -1, 100, 25)
- EndIf
- EndFunc
- Func _CGBAU()
- If @OSLang = 407 Then
- $updall = GUICtrlCreateButton("Alle Updaten", 201, -1, 100, 25)
- Else
- $updall = GUICtrlCreateButton("Update All", 201, -1, 100, 25)
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement