gnucash/packaging/win32/getperl.vbs
Geert Janssens d2357b256a Bug #670355 - Automated install of Perl with Finance-Quote
With these changes install-fq-mods.cmd will automatically download and install
Strawberry perl if now perl version if found on the system.
Patches by Dave Roberts

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22169 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-05-06 21:19:24 +00:00

50 lines
1.5 KiB
Plaintext

' script to download perl install file and save on local disc
' the location of which is provided by first argument
Const WindowsFolder = 0
Const SystemFolder = 1
Const TemporaryFolder = 2
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim tempFolder: tempFolder = fso.GetSpecialFolder(TemporaryFolder)
strHDLocation = Wscript.Arguments.Item(0)
' Set your settings
strFileURL = "http://strawberry-perl.googlecode.com/files/strawberry-perl-5.12.3.0.msi"
Wscript.Echo " copying " & strFileURL
Wscript.Echo " to " & strHDLocation
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
If objFSO.Fileexists(strHDLocation) Then
Wscript.Echo " "
Wscript.Echo " " & strHDLocation & " downloaded OK"
Wscript.Echo " "
Set objFSO = Nothing
wscript.quit 0
End if
End if
wscript.quit 1