add targets to Nmakefile to fetch boot images on windows, add a wscript program to fetch files over http without depending on curl/wget
parent
60b20d590a
commit
518fa0de57
12
Nmakefile
12
Nmakefile
|
@ -1,3 +1,7 @@
|
|||
!IF !DEFINED(BOOTIMAGE_VERSION)
|
||||
BOOTIMAGE_VERSION = latest
|
||||
!ENDIF
|
||||
|
||||
!IF DEFINED(PLATFORM)
|
||||
|
||||
LINK_FLAGS = /nologo shell32.lib
|
||||
|
@ -115,6 +119,12 @@ clean:
|
|||
del factor.dll
|
||||
del factor.dll.lib
|
||||
|
||||
.PHONY: all default x86-32 x86-64 clean
|
||||
bootimage-x86-32:
|
||||
cscript /nologo build-support\http-get.vbs http://factorcode.org/images/$(BOOTIMAGE_VERSION)/boot.winnt-x86.32.image boot.winnt-x86.32.image
|
||||
|
||||
bootimage-x86-64:
|
||||
cscript /nologo build-support\http-get.vbs http://factorcode.org/images/$(BOOTIMAGE_VERSION)/boot.winnt-x86.64.image boot.winnt.x86.64.image
|
||||
|
||||
.PHONY: all bootimage-x86-32 bootimage-x86-64 default x86-32 x86-64 clean
|
||||
|
||||
.SUFFIXES: .rs
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
if WScript.Arguments.Count < 2 then
|
||||
WScript.Echo "usage: http-get.vbs source-url dest-file"
|
||||
WScript.Quit 1
|
||||
else
|
||||
source_url = WScript.Arguments.Item(0)
|
||||
dest_filename = WScript.Arguments.Item(1)
|
||||
|
||||
dim http, source_data
|
||||
set http = CreateObject("WinHttp.WinHttpRequest.5.1")
|
||||
http.Open "GET", source_url, false
|
||||
http.Send
|
||||
|
||||
if http.Status = 200 then
|
||||
dim dest_stream
|
||||
set dest_stream = CreateObject("ADODB.Stream")
|
||||
|
||||
dest_stream.Type = 1 ' adTypeBinary
|
||||
dest_stream.Open
|
||||
dest_stream.Write http.ResponseBody
|
||||
dest_stream.SaveToFile dest_filename, 2 ' adSaveCreateOverWrite
|
||||
|
||||
set dest_stream = nothing
|
||||
else
|
||||
WScript.Echo CStr(http.Status) + " " + http.StatusText + " when fetching " + source_url
|
||||
WScript.Quit 1
|
||||
end if
|
||||
|
||||
set http = nothing
|
||||
end if
|
Loading…
Reference in New Issue