-On Error Resume Next\r
+'On Error Resume Next\r
Set WshShell = CreateObject("WScript.Shell")\r
Set FSO = CreateObject("Scripting.FileSystemObject")\r
Set WshSysEnv = WshShell.Environment("SYSTEM")\r
Set xml = CreateObject("Microsoft.XMLHTTP")\r
Set oStream = createobject("Adodb.Stream")\r
+Set objArgs = WScript.Arguments\r
+Dim vcver, DevEnv\r
+BuildRelease=False\r
+BuildDebug=False\r
+BuildCore=False\r
+BuildModExosip=false\r
\r
ScriptDir=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))\r
\r
LibDestDir=Showpath(ScriptDir & "..\..\libs")\r
UtilsDir=Showpath(ScriptDir & "Tools")\r
-\r
GetTarGZObjects UtilsDir\r
-If Not FSO.FolderExists(LibDestDir & "osip") Then\r
- WgetUnTarGz "http://www.antisip.com/download/libosip2-2.2.1.tar.gz", LibDestDir\r
- RenameFolder LibDestDir & "libosip2-2.2.1", "osip"\r
-' FSO.CopyFile Utilsdir & "osipparser2.vcproj", LibDestDir & "osip\platform\vsnet\", True\r
- Upgrade Utilsdir & "osipparser2.vcproj", LibDestDir & "osip\platform\vsnet\osipparser2.vcproj"\r
- Upgrade LibDestDir & "osip\platform\vsnet\osip2.vcproj", LibDestDir & "osip\platform\vsnet\osip2.vcproj"\r
-End If\r
+GetDevEnv\r
+Wscript.echo "Detected Visual Studio DevEnv: " & DevEnv\r
\r
-If Not FSO.FolderExists(LibDestDir & "libeXosip2") Then \r
- WgetUnTarGz "http://www.antisip.com/download/libeXosip2-1.9.1-pre17.tar.gz", LibDestDir\r
- RenameFolder LibDestDir & "libeXosip2-1.9.1-pre17", "libeXosip2"\r
- Upgrade Utilsdir & "eXosip.vcproj", LibDestDir & "libeXosip2\platform\vsnet\eXosip.vcproj"\r
+If objArgs.Count >=2 Then\r
+ Select Case objArgs(1)\r
+ Case "Release" \r
+ BuildRelease=True\r
+ Case "Debug" \r
+ BuildDebug=True\r
+ Case "All" \r
+ BuildRelease=True\r
+ BuildDebug=True\r
+ End Select\r
End If\r
\r
-If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then \r
- WgetUnTarGz "http://research.edm.luc.ac.be/jori/jthread/jthread-1.1.2.tar.gz", LibDestDir\r
+If objArgs.Count >=1 Then\r
+ Select Case objArgs(0)\r
+ Case "Core" \r
+ BuildCore=True\r
+ Case "Mod_Exosip" \r
+ BuildModExosip=True\r
+ Case Else\r
+ BuildCore=True\r
+ BuildModExosip=True\r
+ End Select\r
+Else\r
+ BuildCore=True\r
+ BuildModExosip=True\r
End If\r
\r
-If Not FSO.FolderExists(LibDestDir & "jrtplib") Then \r
- WgetUnTarGz "http://research.edm.luc.ac.be/jori/jrtplib/jrtplib-3.3.0.tar.gz", LibDestDir\r
- RenameFolder LibDestDir & "jrtplib-3.3.0", "jrtplib"\r
+\r
+If BuildCore Then\r
+ BuildLibs_Core BuildDebug, BuildRelease\r
End If\r
\r
-If Not FSO.FolderExists(LibDestDir & "apr") Then \r
- WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-1.2.2.tar.gz", LibDestDir\r
- RenameFolder LibDestDir & "apr-1.2.2", "apr"\r
- Unix2dos LibDestDir & "apr\libapr.dsp"\r
- Upgrade LibDestDir & "apr\libapr.dsp", LibDestDir & "apr\libapr.vcproj"\r
-End If \r
-\r
-If Not FSO.FolderExists(LibDestDir & "sqlite") Then \r
- WgetUnZip "http://www.sqlite.org/sqlite-source-3_2_7.zip", LibDestDir \r
- RenameFolder LibDestDir & "sqlite-source-3_2_7", "sqlite"\r
- Upgrade Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\sqlite.vcproj"\r
+If BuildModExosip Then\r
+ BuildLibs_ModExosip BuildDebug, BuildRelease\r
End If\r
\r
-WScript.Echo "Download Complete"\r
+WScript.Echo "Complete"\r
+\r
+Sub BuildLibs_Core(BuildDebug, BuildRelease)\r
+ If Not FSO.FolderExists(LibDestDir & "apr") Then \r
+ WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-1.2.2.tar.gz", LibDestDir\r
+ If Not FSO.FolderExists(LibDestDir & "apr-1.2.2") Then\r
+ Wscript.echo "Unable to get SQLite from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/apr-1.2.2.tar.gz", LibDestDir\r
+ End If\r
+ RenameFolder LibDestDir & "apr-1.2.2", "apr"\r
+ Unix2dos LibDestDir & "apr\libapr.dsp"\r
+ Upgrade LibDestDir & "apr\libapr.dsp", LibDestDir & "apr\libapr.vcproj"\r
+ End If \r
+ If FSO.FolderExists(LibDestDir & "apr") Then \r
+ If BuildDebug Then\r
+ If Not FSO.FileExists(LibDestDir & "apr\Debug\libapr-1.lib") Then \r
+ BuildViaDevEnv LibDestDir & "apr\libapr.vcproj", "Debug"\r
+ End If\r
+ End If\r
+ If BuildRelease Then\r
+ If Not FSO.FileExists(LibDestDir & "apr\Release\libapr-1.lib") Then \r
+ BuildViaDevEnv LibDestDir & "apr\libapr.vcproj", "Release"\r
+ End If\r
+ End If\r
+ Else\r
+ Wscript.echo "Unable to download APR"\r
+ End If \r
+ \r
+ If Not FSO.FolderExists(LibDestDir & "sqlite") Then \r
+ WgetUnZip "http://www.sqlite.org/sqlite-source-3_2_7.zip", LibDestDir \r
+ If Not FSO.FolderExists(LibDestDir & "sqlite-source-3_2_7") Then\r
+ Wscript.echo "Unable to get SQLite from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/sqlite-source-3_2_7.zip", LibDestDir\r
+ End If\r
+ RenameFolder LibDestDir & "sqlite-source-3_2_7", "sqlite"\r
+ FSO.CopyFile Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\", True\r
+ ' Upgrade Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\sqlite.vcproj"\r
+ End If\r
+ If FSO.FolderExists(LibDestDir & "sqlite") Then \r
+ If BuildDebug Then\r
+ If Not FSO.FileExists(LibDestDir & "sqlite\Debug\sqlite.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "sqlite\sqlite.vcproj"\r
+ BuildViaDevEnv LibDestDir & "sqlite\sqlite.vcproj", "Debug"\r
+ End If\r
+ End If\r
+ If BuildRelease Then\r
+ If Not FSO.FileExists(LibDestDir & "sqlite\Release\sqlite.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "sqlite\sqlite.vcproj"\r
+ BuildViaDevEnv LibDestDir & "sqlite\sqlite.vcproj", "Release"\r
+ End If\r
+ End If\r
+ Else\r
+ Wscript.echo "Unable to download SQLite"\r
+ End If \r
+End Sub\r
+\r
+Sub BuildLibs_ModExosip(BuildDebug, BuildRelease)\r
+\r
+ If Not FSO.FolderExists(LibDestDir & "osip") Then\r
+ WgetUnTarGz "http://www.antisip.com/download/libosip2-2.2.1.tar.gz", LibDestDir\r
+ If Not FSO.FolderExists(LibDestDir & "libosip2-2.2.1") Then\r
+ Wscript.echo "Unable to get osip from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/libosip2-2.2.1.tar.gz", LibDestDir\r
+ End If\r
+ RenameFolder LibDestDir & "libosip2-2.2.1", "osip"\r
+ FSO.CopyFile Utilsdir & "osipparser2.vcproj", LibDestDir & "osip\platform\vsnet\", True\r
+ End If\r
+ If FSO.FolderExists(LibDestDir & "osip") Then \r
+ If BuildDebug Then\r
+ If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Debug\osip2.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln"\r
+ BuildViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln", "Debug"\r
+ End If\r
+ End If\r
+ If BuildRelease Then\r
+ If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Release\osip2.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln"\r
+ BuildViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln", "Release"\r
+ End If\r
+ End If\r
+ Else\r
+ Wscript.echo "Unable to download Osip"\r
+ End If \r
+\r
+ If Not FSO.FolderExists(LibDestDir & "libeXosip2") Then \r
+ WgetUnTarGz "http://www.antisip.com/download/libeXosip2-1.9.1-pre17.tar.gz", LibDestDir\r
+ If Not FSO.FolderExists(LibDestDir & "libeXosip2-1.9.1-pre17") Then\r
+ Wscript.echo "Unable to get eXosip from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/libeXosip2-1.9.1-pre17.tar.gz", LibDestDir\r
+ End If\r
+ RenameFolder LibDestDir & "libeXosip2-1.9.1-pre17", "libeXosip2"\r
+ FSO.CopyFile Utilsdir & "eXosip.vcproj", LibDestDir & "libeXosip2\platform\vsnet\", True\r
+ End If\r
+ If FSO.FolderExists(LibDestDir & "libeXosip2") Then \r
+ If BuildDebug Then\r
+ If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Debug\exosip.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj"\r
+ BuildViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Debug"\r
+ End If\r
+ End If\r
+ If BuildRelease Then\r
+ If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Release\exosip.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj"\r
+ BuildViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Release"\r
+ End If\r
+ End If\r
+ Else\r
+ Wscript.echo "Unable to download exosip"\r
+ End If \r
+\r
+ If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then \r
+ WgetUnTarGz "http://research.edm.luc.ac.be/jori/jthread/jthread-1.1.2.tar.gz", LibDestDir\r
+ If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then\r
+ Wscript.echo "Unable to get JThread from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/jthread-1.1.2.tar.gz", LibDestDir\r
+ End If\r
+ End If\r
+ \r
+ If Not FSO.FolderExists(LibDestDir & "jrtplib") Then \r
+ WgetUnTarGz "http://research.edm.luc.ac.be/jori/jrtplib/jrtplib-3.3.0.tar.gz", LibDestDir\r
+ If Not FSO.FolderExists(LibDestDir & "jrtplib-3.3.0") Then\r
+ Wscript.echo "Unable to get JRTPLib from default download location, Trying backup location:"\r
+ WgetUnTarGz "http://www.sofaswitch.org/mikej/jrtplib-3.3.0.tar.gz", LibDestDir\r
+ End If\r
+ RenameFolder LibDestDir & "jrtplib-3.3.0", "jrtplib"\r
+ End If\r
+ If FSO.FolderExists(LibDestDir & "jrtplib") And FSO.FolderExists(LibDestDir & "jthread-1.1.2") And FSO.FolderExists(LibDestDir & "jrtp4c")Then \r
+ If BuildDebug Then\r
+ If Not FSO.FileExists(LibDestDir & "jrtp4c\w32\Debug\jrtp4c.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln"\r
+ BuildViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln", "Debug"\r
+ End If\r
+ End If\r
+ If BuildRelease Then\r
+ If Not FSO.FileExists(LibDestDir & "jrtp4c\w32\Release\jrtp4c.lib") Then \r
+ UpgradeViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln"\r
+ BuildViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln", "Release"\r
+ End If\r
+ End If\r
+ Else\r
+ Wscript.echo "Unable to download JRtplib"\r
+ End If \r
+\r
+\r
+End Sub\r
+\r
+Sub UpgradeViaDevEnv(ProjectFile)\r
+ Set oExec = WshShell.Exec(Chr(34) & DevEnv & Chr(34) & " " & Chr(34) & ProjectFile & Chr(34) & " /Upgrade ")\r
+ Do While oExec.Status <> 1\r
+ WScript.Sleep 100\r
+ Loop\r
+End Sub\r
+\r
+Sub BuildViaDevEnv(ProjectFile, BuildType)\r
+ Wscript.echo "Building : " & ProjectFile & " Config type: " & BuildType\r
+ Set oExec = WshShell.Exec(Chr(34) & DevEnv & Chr(34) & " " & Chr(34) & ProjectFile & Chr(34) & " /Build " & BuildType)\r
+ Do While oExec.Status <> 1\r
+ WScript.Sleep 100\r
+ Loop\r
+End Sub\r
+\r
+Sub GetDevEnv()\r
+ If WshSysEnv("VS80COMNTOOLS")<> "" Then \r
+ vcver = "8"\r
+ DevEnv=Showpath(WshSysEnv("VS80COMNTOOLS")&"..\IDE\") & "devenv"\r
+ Else If WshSysEnv("VS71COMNTOOLS")<> "" Then\r
+ vcver = "7"\r
+ DevEnv=Showpath(WshSysEnv("VS71COMNTOOLS")&"..\IDE\") & "devenv"\r
+ Else\r
+ Wscript.Echo("Did not find any Visual Studio .net 2003 or 2005 on your machine")\r
+ WScript.Quit(1)\r
+ End If\r
+ End If\r
+End Sub\r
+\r
\r
Sub RenameFolder(FolderName, NewFolderName)\r
+On Error Resume Next\r
Set Folder=FSO.GetFolder(FolderName)\r
Folder.Name = NewFolderName\r
+On Error GoTo 0\r
End Sub\r
\r
Sub Upgrade(OldFileName, NewFileName)\r
-\r
+On Error Resume Next\r
If WshSysEnv("VS80COMNTOOLS")<> "" Then \r
Set vcProj = CreateObject("VisualStudio.VCProjectEngine.8.0")\r
Else If WshSysEnv("VS71COMNTOOLS")<> "" Then\r
' WScript.Echo("Converting: "+ OldFileName)\r
\r
Set vcProject = vcProj.LoadProject(OldFileName)\r
-' If Not FSO.FileExists(vcProject.ProjectFile) Then\r
+ If Not FSO.FileExists(vcProject.ProjectFile) Then\r
' // specify name and location of new project file\r
vcProject.ProjectFile = NewFileName\r
-' End If\r
' // call the project engine to save this off. \r
' // when no name is shown, it will create one with the .vcproj name\r
vcProject.Save()\r
+ End If\r
' WScript.Echo("New Project Name: "+vcProject.ProjectFile+"")\r
-\r
+On Error GoTo 0\r
End Sub\r
\r
\r
\r
Set objTAR = WScript.CreateObject("XStandard.TAR")\r
Set objGZip = WScript.CreateObject("XStandard.GZip")\r
-' wscript.echo("Extracting: " & TGZfile)\r
+ wscript.echo("Extracting: " & TGZfile)\r
objGZip.Decompress TGZfile, Destfolder\r
objTAR.UnPack Left(TGZfile, Len(TGZfile)-3), Destfolder\r
\r
Dim objZip\r
Set objZip = WScript.CreateObject("XStandard.Zip")\r
objZip.UnPack Zipfile, DestFolder\r
-Set objZip = Nothing\r
+'Set objZip = Nothing\r
End Sub\r
\r
\r
filename=Right(URL,strlength-StartPos)\r
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If\r
\r
-' Wscript.echo("Downloading: " & URL)\r
+ Wscript.echo("Downloading: " & URL)\r
xml.Open "GET", URL, False\r
xml.Send\r
\r