Last active
February 23, 2016 13:41
-
-
Save yumetodo/1bc47ce42b6128e1950c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Boost Software License 1.0 (BSL1.0) | |
'copyright (c) 2015-2016 yumetodo | |
Dim WshShell | |
Dim WshFS | |
Dim url | |
Dim html | |
Dim cmd1 | |
Dim path | |
Set WshShell = CreateObject("WScript.Shell") | |
Set WshFS = CreateObject("Scripting.FileSystemObject") | |
'check Env | |
If (Not WshFS.FileExists("curl.exe")) Then | |
WScript.Echo("Unable to find curl.exe") | |
WScript.Quit | |
End If | |
'Input Install Folder | |
path = InputBox("インストール先フォルダをフルパスで入力してください", "DoNotPushGameDownloader") | |
If (Not WshFS.FolderExists(path)) Then | |
WScript.Echo("Not kown such a directory.") | |
WScript.Quit | |
End If | |
'Change Current Directory to Install Folder | |
WshFS.CopyFile "curl.exe", WshFS.BuildPath(path, "curl.exe") | |
WshShell.CurrentDirectory = path | |
' for SSL | |
If (Not WshFS.FileExists("curl-ca-bundle.crt")) Then | |
WScript.Echo("missing curl-ca-bundle.crt") | |
WScript.Quit | |
End IF | |
If (Not WshFS.FileExists("DigiCertHighAssuranceEVRootCA.crt")) Then | |
url = "https://www.digicert.com/testroot/DigiCertHighAssuranceEVRootCA.crt" | |
cmd1 = """" & WshShell.CurrentDirectory & "\curl.exe" & """" &" "& url & "" & " -o DigiCertHighAssuranceEVRootCA.crt" | |
WScript.Echo(cmd1) | |
Call WshShell.Run(cmd1, 1, True) | |
End IF | |
'Fetch GitHub DL page | |
url = "https://github.com/TakeObara/DoNotPushGame/releases/latest" | |
cmd1 = """" & WshShell.CurrentDirectory & "\curl.exe" & """" & " -sL " &" "& url & "" & " -o latest.html" | |
WScript.Echo(cmd1) | |
Call WshShell.Run(cmd1, 1, True) | |
'Extract Link | |
Set myregex = New RegExp | |
myregex.IgnoreCase = True | |
myregex.Global = True | |
myregex.Pattern = "(/releases/download/.*/DoNotPushGame.+.zip)" | |
'WScript.Echo(myregex.Pattern) | |
html= WshFS.OpenTextFile("latest.html").ReadAll | |
Set rMatches = myregex.Execute(html) | |
url = rMatches.Item(0).Submatches(0) | |
'Download | |
'WScript.Echo(url) | |
cmd1 = """" & WshShell.CurrentDirectory & "\curl.exe" & """" & " -s -L --insecure " &" " & "" & "https://github.com/TakeObara/DoNotPushGame" & "" & url & "" & " -o DoNotPushGame-latest.zip" | |
'WScript.Echo(cmd1) | |
Call WshShell.Run(cmd1, 1, True) | |
'Unzip | |
Set appShell = CreateObject("Shell.Application") | |
appShell.NameSpace(WshFS.GetAbsolutePathName(WshShell.CurrentDirectory)).CopyHere appShell.NameSpace(WshFS.GetAbsolutePathName("DoNotPushGame-latest.zip")).Items | |
Set appShell = Nothing | |
'Wait unzip | |
WScript.Sleep(1000) | |
WScript.Echo("finish.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/TakeObara/DoNotPushGame
のダウンローダーです。
依存関係
curl.exe
http://www.paehl.com/open_source/?CURL_7.47.1
の
Download WITH SUPPORT SSL
を使用して動作確認しております。curl-ca-bundle.crt
https://curl.haxx.se/ca/cacert.pem
を落としてリネーム
動作環境
Windows Vista 以降
インストール方法(自動版)
curl.exe
をvbsと同じパスにおきますdownload.vbs
を実行しますfinish.
とでれば多分終わっていますDoNotPushGame
というフォルダがあれば成功です連絡先
Twitter: @yumetodo
GitHub : @yumetodo
e-mail : yume-wikijp@live.jp
License
vbsのライセンスです
Boost Software License 1.0 (BSL1.0)
copyright (c) 2015 yumetodo
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.