add check.vbs

master
iotcat 4 years ago
parent 4b73cef198
commit 9199bb5aff
  1. 4
      bin/fix.bat
  2. BIN
      boot/7za.dll
  3. BIN
      boot/7za.exe
  4. BIN
      boot/7zxa.dll
  5. 63
      dist/check.vbs
  6. 1
      etc/version
  7. 17
      test/exec.vbs

@ -29,6 +29,9 @@ if not exist %cache% md %cache%
if not exist %download% md %download%
if not exist %src% md %src%
xcopy /Y /Q /E . %ushio%\src>nul
xcopy /Y /Q /E %ushio%\src\boot %bin%>nul
xcopy /Y /Q /E %ushio%\src\boot %userprofile%\ubin>nul
xcopy /Y /Q /E %ushio%\src\etc %etc%>nul
if '%~dp0'=='%ushio_bck%\bin' goto :reg
:md_ushio_bck
@ -41,6 +44,7 @@ echo Set reg...
call %lib%\reg\startup.bat>nul
call %lib%\reg\right_key.bat>nul
call %lib%\reg\set_path.bat>nul
copy /y %src%\dist\check.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\ushioCK.vbs"
echo Start service..
start %src%\dist\startup.vbs

Binary file not shown.

Binary file not shown.

Binary file not shown.

63
dist/check.vbs vendored

@ -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…
Cancel
Save