# HG changeset patch # User koda # Date 1351070322 -3600 # Node ID da60e6b6baa3d2bce9ba62003a030dd5e97c811e # Parent 7d4fb2f35f4f0d4bb4b7813026f478ba7eae9609 download SDL dlls if not present diff -r 7d4fb2f35f4f -r da60e6b6baa3 bin/CMakeLists.txt --- a/bin/CMakeLists.txt Wed Oct 24 10:17:38 2012 +0100 +++ b/bin/CMakeLists.txt Wed Oct 24 10:18:42 2012 +0100 @@ -1,9 +1,11 @@ if(WIN32 AND NOT UNIX) file(GLOB DLLs *.dll) file(GLOB ICOs *.ico) + file(GLOB TXTs *.txt) install(FILES ${DLLs} ${ICOs} + ${TXTs} DESTINATION bin) endif(WIN32 AND NOT UNIX) diff -r 7d4fb2f35f4f -r da60e6b6baa3 tools/build_windows.bat --- a/tools/build_windows.bat Wed Oct 24 10:17:38 2012 +0100 +++ b/tools/build_windows.bat Wed Oct 24 10:18:42 2012 +0100 @@ -8,13 +8,20 @@ set CURRDIR="%CD%" cd .. -echo Copying the DLLs... -REM xcopy /d/y %CD%\misc\winutils\bin\* . -xcopy /d/y %QTDIR%\QtCore4.dll bin -xcopy /d/y %QTDIR%\QtGui4.dll bin -xcopy /d/y %QTDIR%\QtNetwork4.dll bin -xcopy /d/y %QTDIR%\libgcc_s_dw2-1.dll bin -xcopy /d/y %QTDIR%\mingwm10.dll bin +echo Fetching all DLLs... +for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do ( + xcopy /d/y %QTDIR%\%%G.dll bin\ +) + +if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\ +if not exist %CD%\misc\winutils\bin\SDL.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/release/SDL-1.2.15-win32.zip %CD%\misc\winutils\bin +if not exist %CD%\misc\winutils\bin\SDL_image.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip %CD%\misc\winutils\bin +if not exist %CD%\misc\winutils\bin\SDL_net.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8-win32.zip %CD%\misc\winutils\bin +if not exist %CD%\misc\winutils\bin\SDL_mixer.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12-win32.zip %CD%\misc\winutils\bin +if not exist %CD%\misc\winutils\bin\SDL_ttf.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11-win32.zip %CD%\misc\winutils\bin + +xcopy /d/y %CD%\misc\winutils\bin\*.dll bin +xcopy /d/y %CD%\misc\winutils\bin\*.txt bin ::setting up the environment... call %QTDIR%\qtenv2.bat diff -r 7d4fb2f35f4f -r da60e6b6baa3 tools/w32DownloadUnzip.vbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/w32DownloadUnzip.vbs Wed Oct 24 10:18:42 2012 +0100 @@ -0,0 +1,64 @@ +' w32DownloadUnzip.vbs +' Download a zipfile and uncompress it with no external tools in Windows +' +' Copyright (c) 2012, Vittorio Giovara, +' Redistribution and use is allowed according to the terms of the BSD license. +' +' References +' http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line +' http://stackoverflow.com/questions/1021557/how-to-unzip-a-file-using-the-command-line + +Set ArgObj = WScript.Arguments + +If (Wscript.Arguments.Count = 1) Then + strFileURL = ArgObj(0) + strOutputPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") +Else + If (Wscript.Arguments.Count = 2) Then + strFileURL = ArgObj(0) + strOutputPath = ArgObj(1) + Else + WScript.Echo ("Usage: csript.exe w32DownloadUnzip.vbs url output") + WScript.Quit + End if +End if + +strHDLocation = "C:\Windows\Temp\temp.zip" + +' Fetch the file +Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP") +objXMLHTTP.open "GET", strFileURL, false +objXMLHTTP.send() + +If objXMLHTTP.Status = 200 Then + WScript.Echo ( "Downloading file from " & strFileURL) + 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 + Set objFSO = Nothing + + objADOStream.SaveToFile strHDLocation + objADOStream.Close + Set objADOStream = Nothing +Else + WScript.Echo ("Error downloading file (error code: " & objXMLHTTP.Status & ")") + Set objXMLHTTP = Nothing + WScript.Quit +End if +Set objXMLHTTP = Nothing + +WScript.Echo ( "Extracting file to " & strOutputPath) +Set objShell = CreateObject( "Shell.Application" ) +Set objSource = objShell.NameSpace(strHDLocation).Items() +Set objTarget = objShell.NameSpace(strOutputPath) +intOptions = 16 'no user prompt +objTarget.CopyHere objSource, intOptions + +WScript.Echo ( "Extraction successful" ) +Set objShell = Nothing