parent
4b73cef198
commit
9199bb5aff
7 changed files with 85 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,63 @@ |
||||
On Error Resume Next |
||||
Set sh = WScript.CreateObject("WScript.Shell") |
||||
Set http = CreateObject("Msxml2.ServerXMLHTTP") |
||||
set fs = CreateObject("Scripting.FileSystemObject") |
||||
|
||||
|
||||
|
||||
msgBox checkVersion |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function exec(cmd) |
||||
sh.Run "cmd /c "+cmd+" >%temp%\res.stt",0 |
||||
do while not fs.FileExists(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt") |
||||
WScript.Sleep 500 |
||||
loop |
||||
set f = fs.OpenTextFile(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt", 1, false) |
||||
exec = f.readall |
||||
f.Close() |
||||
set f = nothing |
||||
fs.DeleteFile(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt"), True |
||||
end function |
||||
|
||||
|
||||
function getPkg() |
||||
http.Open "GET","https://github.com/IoTcat/ushio-win-systemd/archive/master.zip",0 |
||||
http.send() |
||||
Set aGet = CreateObject("ADODB.Stream") |
||||
aGet.Mode = 3 |
||||
aGet.Type = 1 |
||||
aGet.Open() |
||||
aGet.Write(http.responseBody) |
||||
aGet.SaveToFile sh.ExpandEnvironmentStrings("%temp%")+"\ushio.pkg.zip",2 |
||||
aGet.Close() |
||||
end function |
||||
|
||||
function update() |
||||
getPkg() |
||||
exec("%userprofile%\ubin\7za.exe x -aoa -o%temp% -y %temp%\ushio.pkg.zip") |
||||
exec("start %temp%\ushio-win-systemd\bin\fix.bat") |
||||
end function |
||||
|
||||
function checkVersion() |
||||
http.Open "GET","https://ushio-win.yimian.xyz/getVersion",0 |
||||
http.send() |
||||
if http.status=200 Then |
||||
checkVersion=http.responsetext |
||||
end if |
||||
end function |
||||
|
||||
function getLocalVersion() |
||||
if fs.FileExists("C:\Ushio\etc\version") then |
||||
set f = fs.OpenTextFile("C:\Ushio\etc\version", 1, false) |
||||
getLocalVersion=f.readall |
||||
f.Close() |
||||
end if |
||||
end function |
||||
|
||||
|
||||
|
@ -0,0 +1 @@ |
||||
v1.0.1 |
@ -0,0 +1,17 @@ |
||||
set fs = CreateObject("Scripting.FileSystemObject") |
||||
set sh = CreateObject("WScript.Shell") |
||||
|
||||
|
||||
function exec(cmd) |
||||
sh.Run "cmd /c "+cmd+" >%temp%\res.stt",0 |
||||
do while not fs.FileExists(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt") |
||||
WScript.Sleep 500 |
||||
loop |
||||
set f = fs.OpenTextFile(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt", 1, false) |
||||
exec = f.readall |
||||
f.Close() |
||||
set f = nothing |
||||
fs.DeleteFile(sh.ExpandEnvironmentStrings("%temp%")+"\res.stt"), True |
||||
end function |
||||
|
||||
msgbox exec("help") |
Loading…
Reference in new issue