install.bat 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @echo off
  2. REM
  3. REM gameplay-install.bat [master | next]
  4. REM
  5. REM Download GamePlay resources from HTTP server and extract from ZIP
  6. REM
  7. REM Helps prevent repo bloat due to large binary files since they can
  8. REM be hosted separately.
  9. REM
  10. REM Production URL
  11. set prefix=http://www.gameplay3d.org
  12. set branchname=%1
  13. if "%branchname%" == "" (
  14. set branchname=next
  15. )
  16. set filename=gameplay-deps-%branchname%
  17. echo Downloading %filename%.zip from %prefix%
  18. %~d0
  19. cd %~dp0
  20. > temp1.vbs ECHO Dim strFileURL, strHDLocation
  21. >> temp1.vbs ECHO strFileURL = WScript.Arguments(0)
  22. >> temp1.vbs ECHO strHDLocation = WScript.Arguments(1)
  23. >> temp1.vbs ECHO Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
  24. >> temp1.vbs ECHO objXMLHTTP.open "GET", strFileURL, false
  25. >> temp1.vbs ECHO objXMLHTTP.send()
  26. >> temp1.vbs ECHO If objXMLHTTP.Status = 200 Then
  27. >> temp1.vbs ECHO Set objADOStream = CreateObject("ADODB.Stream")
  28. >> temp1.vbs ECHO objADOStream.Open
  29. >> temp1.vbs ECHO objADOStream.Type = 1
  30. >> temp1.vbs ECHO objADOStream.Write objXMLHTTP.ResponseBody
  31. >> temp1.vbs ECHO objADOStream.Position = 0
  32. >> temp1.vbs ECHO Set objFSO = Createobject("Scripting.FileSystemObject")
  33. >> temp1.vbs ECHO If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
  34. >> temp1.vbs ECHO Set objFSO = Nothing
  35. >> temp1.vbs ECHO objADOStream.SaveToFile strHDLocation
  36. >> temp1.vbs ECHO objADOStream.Close
  37. >> temp1.vbs ECHO Set objADOStream = Nothing
  38. >> temp1.vbs ECHO End if
  39. >> temp1.vbs ECHO Set objXMLHTTP = Nothing
  40. cscript temp1.vbs %prefix%/%filename%.zip %filename%.zip
  41. echo Extracting %filename%.zip... please standby...
  42. %~d0
  43. cd %~dp0
  44. > temp2.vbs ECHO Dim fileName, workingDir
  45. >> temp2.vbs ECHO fileName = WScript.Arguments(0)
  46. >> temp2.vbs ECHO workingDir = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
  47. >> temp2.vbs ECHO Set objShell = CreateObject("Shell.Application")
  48. >> temp2.vbs ECHO Set objSource = objShell.NameSpace(workingDir ^& "\" ^& fileName).Items()
  49. >> temp2.vbs ECHO Set objTarget = objShell.NameSpace(workingDir ^& "\")
  50. >> temp2.vbs ECHO intOptions = 256
  51. >> temp2.vbs ECHO objTarget.CopyHere objSource, intOptions
  52. cscript temp2.vbs %filename%.zip
  53. echo Cleaning up...
  54. del temp1.vbs
  55. del temp2.vbs
  56. del %filename%.zip
  57. echo Done.