From b24e1142f40527b32236c962bc8e07edcd43cccc Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 27 May 2011 18:21:46 +0000 Subject: [PATCH] - need to include 7z.dll for windows users for archive extraction to work --- mk/windoze/Installer/MegaGlestInstaller.nsi | 1 + mk/windoze/Installer/MegaGlestUpdater.nsi | 1 + mk/windoze/build-mg.bat | 1 + mk/windoze/getTools.vbs | 65 ++++++++++++++++----- 4 files changed, 53 insertions(+), 15 deletions(-) diff --git a/mk/windoze/Installer/MegaGlestInstaller.nsi b/mk/windoze/Installer/MegaGlestInstaller.nsi index dac74266..03780700 100644 --- a/mk/windoze/Installer/MegaGlestInstaller.nsi +++ b/mk/windoze/Installer/MegaGlestInstaller.nsi @@ -216,6 +216,7 @@ Section "${APNAME} (required)" File "..\..\..\data\glest_game\megaglest_configurator.exe" File "..\..\..\data\glest_game\megaglest_g3dviewer.exe" File "..\..\..\data\glest_game\7z.exe" + File "..\..\..\data\glest_game\7z.dll" File "..\..\..\data\glest_game\configuration.xml" File "..\..\..\data\glest_game\megaglest.ico" File "..\..\..\data\glest_game\glest.ini" diff --git a/mk/windoze/Installer/MegaGlestUpdater.nsi b/mk/windoze/Installer/MegaGlestUpdater.nsi index e012d6aa..26993448 100644 --- a/mk/windoze/Installer/MegaGlestUpdater.nsi +++ b/mk/windoze/Installer/MegaGlestUpdater.nsi @@ -177,6 +177,7 @@ Section "${APNAME} (required)" File "..\..\..\data\glest_game\megaglest_configurator.exe" File "..\..\..\data\glest_game\megaglest_g3dviewer.exe" File "..\..\..\data\glest_game\7z.exe" + File "..\..\..\data\glest_game\7z.dll" File "..\..\..\data\glest_game\glest.ini" File "..\..\..\data\glest_game\glestkeys.ini" File "..\..\..\data\glest_game\servers.ini" diff --git a/mk/windoze/build-mg.bat b/mk/windoze/build-mg.bat index a86d6414..88dbb3f1 100644 --- a/mk/windoze/build-mg.bat +++ b/mk/windoze/build-mg.bat @@ -7,6 +7,7 @@ cd /d "%~dp0" ECHO Checking for windows binary runtime tools... if NOT EXIST "..\..\data\glest_game\7z.exe" cscript getTools.vbs +if NOT EXIST "..\..\data\glest_game\7z.dll" cscript getTools.vbs call CopyWindowsRuntimeDlls.bat nopause rem setup the Visual Studio 2008 environment diff --git a/mk/windoze/getTools.vbs b/mk/windoze/getTools.vbs index 9ba17dd5..4f8ae866 100644 --- a/mk/windoze/getTools.vbs +++ b/mk/windoze/getTools.vbs @@ -12,23 +12,58 @@ objXMLHTTP.open "GET", strFileURL, false objXMLHTTP.send() If objXMLHTTP.Status = 200 Then -Set objADOStream = CreateObject("ADODB.Stream") -objADOStream.Open -objADOStream.Type = 1 'adTypeBinary + 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 + 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 + Set objFSO = Createobject("Scripting.FileSystemObject") + If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation + Set objFSO = Nothing -objADOStream.SaveToFile strHDLocation -objADOStream.Close -Set objADOStream = Nothing -WScript.Echo "7z.exe has been downloaded successfully to: " -WScript.Echo strHDLocation -WScript.Echo "----------------------------------------" + objADOStream.SaveToFile strHDLocation + objADOStream.Close + Set objADOStream = Nothing + WScript.Echo "7z.exe has been downloaded successfully to: " + WScript.Echo strHDLocation + WScript.Echo "----------------------------------------" End if -Set objXMLHTTP = Nothing \ No newline at end of file +Set objXMLHTTP = Nothing + +' Set your settings +strFileURL = "http://master.dl.sourceforge.net/project/megaglest/7z.dll" +strHDLocation = "..\..\data\glest_game\7z.dll" + +WScript.Echo "----------------------------------------" +WScript.Echo "About to download 7z.dll from:" +WScript.Echo strFileURL & ", please wait..." + +' 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 + Set objFSO = Nothing + + objADOStream.SaveToFile strHDLocation + objADOStream.Close + Set objADOStream = Nothing + WScript.Echo "7z.exe has been downloaded successfully to: " + WScript.Echo strHDLocation + WScript.Echo "----------------------------------------" +End if + +Set objXMLHTTP = Nothing