+!IF !DEFINED(BOOTIMAGE_VERSION)
+BOOTIMAGE_VERSION = latest
+!ENDIF
+
!IF DEFINED(PLATFORM)
LINK_FLAGS = /nologo shell32.lib
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
--- /dev/null
+if WScript.Arguments.Count < 2 then\r
+ WScript.Echo "usage: http-get.vbs source-url dest-file"\r
+ WScript.Quit 1\r
+else\r
+ source_url = WScript.Arguments.Item(0)\r
+ dest_filename = WScript.Arguments.Item(1)\r
+\r
+ dim http, source_data\r
+ set http = CreateObject("WinHttp.WinHttpRequest.5.1")\r
+ http.Open "GET", source_url, false\r
+ http.Send\r
+\r
+ if http.Status = 200 then\r
+ dim dest_stream\r
+ set dest_stream = CreateObject("ADODB.Stream")\r
+\r
+ dest_stream.Type = 1 ' adTypeBinary\r
+ dest_stream.Open\r
+ dest_stream.Write http.ResponseBody\r
+ dest_stream.SaveToFile dest_filename, 2 ' adSaveCreateOverWrite\r
+\r
+ set dest_stream = nothing\r
+ else\r
+ WScript.Echo CStr(http.Status) + " " + http.StatusText + " when fetching " + source_url\r
+ WScript.Quit 1\r
+ end if\r
+\r
+ set http = nothing\r
+end if\r