提交 68db7304 authored 作者: Michael Jerris's avatar Michael Jerris

Add sqlite to the downloaded libs in GetLibs.vbs and cleanup some of the old…

Add sqlite to the downloaded libs in GetLibs.vbs and cleanup some of the old GetLibs.bat stuff and it's dependencies.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@74 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 3dc4d761
@echo off
ECHO ****************************************************************
ECHO ************** VARIABLE SETUP *****************
ECHO ****************************************************************
for /f %%i in ('cscript /Nologo .\tools\Fulldir.vbs .\..\..') DO SET BASEDIR=%%i
set UTILSDIR=%BASEDIR%\w32\vsnet\Tools
set INCLUDEDIR=%BASEDIR%\include
set LIBSRCDIR=%BASEDIR%\libs
set DEBUGLIBBINDIR=%BASEDIR%\debuglib
set WGET=cscript %UTILSDIR%\wget.vbs
set TAR=%UTILSDIR%\tar.exe
set TARURL=http://users.pandora.be/larc/download/windows_management/tar.exe
set TARURL2=http://www.sofaswitch.org/mikej/tar.exe
set GUNZIP=%UTILSDIR%\gunzip.exe
set GUNZIPURL=http://users.pandora.be/larc/download/windows_management/gunzip.exe
set GUNZIPURL2=http://www.sofaswitch.org/mikej/gunzip.exe
set UNIX2DOS=%UTILSDIR%\unix2dos.vbs
set APRDIR=apr-1.2.2
set APRTAR=%APRDIR%.tar.gz
set APRURL=ftp://ftp.wayne.edu/apache/apr/
set APRDESTDIR=apr
set JRTPDIR=jrtplib-3.3.0
set JRTPTAR=%JRTPDIR%.tar.gz
set JRTPURL=http://research.edm.luc.ac.be/jori/jrtplib/
set JRTPDESTDIR=jrtplib
set JTHREADDIR=jthread-1.1.2
set JTHREADTAR=%JTHREADDIR%.tar.gz
set JTHREADURL=http://research.edm.luc.ac.be/jori/jthread/
set JTHREADDESTDIR=%JTHREADDIR%
set EXOSIPDIR=libeXosip2-1.9.1-pre17
set EXOSIPTAR=%EXOSIPDIR%.tar.gz
set EXOSIPURL=http://www.antisip.com/download/
set EXOSIPDESTDIR=libeXosip2
set OSIPDIR=libosip2-2.2.1
set OSIPTAR=%OSIPDIR%.tar.gz
set OSIPURL=http://www.antisip.com/download/
set OSIPDESTDIR=osip
set BACKUPURL=http://www.sofaswitch.org/mikej/
IF NOT EXIST %LIBSRCDIR% md %LIBSRCDIR%
ECHO ****************************************************************
ECHO ************** DOWNLOADS *****************
ECHO ****************************************************************
IF NOT EXIST %TAR% %WGET% %TARURL% %UTILSDIR%
IF NOT EXIST %TAR% %WGET% %TARURL2% %UTILSDIR%
IF NOT EXIST %GUNZIP% %WGET% %GUNZIPURL% %UTILSDIR%
IF NOT EXIST %GUNZIP% %WGET% %GUNZIPURL2% %UTILSDIR%
cd %LIBSRCDIR%
IF NOT EXIST %LIBSRCDIR%\%APRTAR% IF NOT EXIST %LIBSRCDIR%\%APRDESTDIR% %WGET% %APRURL%%APRTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%APRTAR% | %TAR% xvf - & ren %APRDIR% %APRDESTDIR% & del %APRTAR%
IF NOT EXIST %LIBSRCDIR%\%EXOSIPTAR% IF NOT EXIST %LIBSRCDIR%\%EXOSIPDESTDIR% %WGET% %EXOSIPURL%%EXOSIPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%EXOSIPTAR% | %TAR% xvf - & ren %EXOSIPDIR% %EXOSIPDESTDIR% & del %EXOSIPTAR%
IF NOT EXIST %LIBSRCDIR%\%OSIPTAR% IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR% %WGET% %OSIPURL%%OSIPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%OSIPTAR% | %TAR% xvf - & ren %OSIPDIR% %OSIPDESTDIR% & del %OSIPTAR%
IF NOT EXIST %LIBSRCDIR%\%JTHREADTAR% IF NOT EXIST %LIBSRCDIR%\%JTHREADDESTDIR% %WGET% %JTHREADURL%%JTHREADTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%JTHREADTAR% | %TAR% xvf - & ren %JTHREADDIR% %JTHREADDESTDIR% & del %JTHREADTAR%
IF NOT EXIST %LIBSRCDIR%\%JRTPTAR% IF NOT EXIST %LIBSRCDIR%\%JRTPDESTDIR% %WGET% %JRTPURL%%JRTPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%JRTPTAR% | %TAR% xvf - & ren %JRTPDIR% %JRTPDESTDIR% & del %JRTPTAR%
REM Backup download locations for all the libs just in case the primaries are down
IF NOT EXIST %LIBSRCDIR%\%APRTAR% IF NOT EXIST %LIBSRCDIR%\%APRDESTDIR% %WGET% %BACKUPURL%%APRTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%APRTAR% | %TAR% xvf - & ren %APRDIR% %APRDESTDIR% & del %APRTAR%
IF NOT EXIST %LIBSRCDIR%\%EXOSIPTAR% IF NOT EXIST %LIBSRCDIR%\%EXOSIPDESTDIR% %WGET% %BACKUPURL%%EXOSIPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%EXOSIPTAR% | %TAR% xvf - & ren %EXOSIPDIR% %EXOSIPDESTDIR% & del %EXOSIPTAR%
IF NOT EXIST %LIBSRCDIR%\%OSIPTAR% IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR% %WGET% %BACKUPURL%%OSIPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%OSIPTAR% | %TAR% xvf - & ren %OSIPDIR% %OSIPDESTDIR% & del %OSIPTAR%
IF NOT EXIST %LIBSRCDIR%\%JTHREADTAR% IF NOT EXIST %LIBSRCDIR%\%JTHREADDESTDIR% %WGET% %BACKUPURL%%JTHREADTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%JTHREADTAR% | %TAR% xvf - & ren %JTHREADDIR% %JTHREADDESTDIR% & del %JTHREADTAR%
IF NOT EXIST %LIBSRCDIR%\%JRTPTAR% IF NOT EXIST %LIBSRCDIR%\%JRTPDESTDIR% %WGET% %BACKUPURL%%JRTPTAR% %LIBSRCDIR% & %GUNZIP% < %LIBSRCDIR%\%JRTPTAR% | %TAR% xvf - & ren %JRTPDIR% %JRTPDESTDIR% & del %JRTPTAR%
cd
ECHO ****************************************************************
ECHO ************** VS Version Detection *****************
ECHO ****************************************************************
IF EXIST "%VS80COMNTOOLS%..\IDE\devenv.exe" GOTO VS8
IF EXIST "%VS71COMNTOOLS%..\IDE\devenv.exe" GOTO VS7
echo no Visual Studio .net 2003 or greater found. I don't know how to autobuild projects. Please manually build libs.
GOTO END
:VS8
set DEVENV="%VS80COMNTOOLS%..\IDE\devenv"
call "%VS80COMNTOOLS%vsvars32.bat"
SET MSVCVER=8
GOTO NEXT
:VS7
set DEVENV="%VS71COMNTOOLS%..\IDE\devenv"
call "%VS71COMNTOOLS%vsvars32.bat"
SET MSVCVER=7
:NEXT
ECHO ****************************************************************
ECHO ************** APR BUILD *****************
ECHO ****************************************************************
IF NOT EXIST %LIBSRCDIR%\%APRDESTDIR%\libapr.vcproj %UNIX2DOS% %LIBSRCDIR%\%APRDESTDIR%\libapr.dsp
IF NOT EXIST %LIBSRCDIR%\%APRDESTDIR%\libapr.vcproj cscript %UTILSDIR%\upgrade.vbs %LIBSRCDIR%\%APRDESTDIR%\libapr.dsp %LIBSRCDIR%\%APRDESTDIR%\libapr.vcproj
REM %DEVENV% %LIBSRCDIR%\%APRDESTDIR%\libapr.vcproj /build Debug
ECHO ****************************************************************
ECHO ************** OSIP BUILD *****************
ECHO ****************************************************************
IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\patched.tag del %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\osipparser2.vcproj
IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\patched.tag copy %UTILSDIR%\osipparser2.vcproj %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\
IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\patched.tag %DEVENV% %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\osip.sln /Upgrade
REM IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\Debug\osip2.lib %DEVENV% %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\osip.sln /build Debug
IF NOT EXIST %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\patched.tag ECHO. > %LIBSRCDIR%\%OSIPDESTDIR%\platform\vsnet\patched.tag
ECHO ****************************************************************
ECHO ************** EXOSIP BUILD *****************
ECHO ****************************************************************
IF NOT EXIST %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\upgrade.tag %DEVENV% %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\eXosip.vcproj /Upgrade
IF NOT EXIST %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\upgrade.tag ECHO. > %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\upgrade.tag
REM IF NOT EXIST %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\Debug\eXosip.lib %DEVENV% %LIBSRCDIR%\%EXOSIPDESTDIR%\platform\vsnet\eXosip.vcproj /build Debug
ECHO ****************************************************************
ECHO ************** JRTP BUILD *****************
ECHO ****************************************************************
REM IF NOT EXIST %LIBSRCDIR%\jrtp4c\w32\Debug\jrtp4c.obj %DEVENV% %LIBSRCDIR%\jrtp4c\w32\jrtp4c.sln /build Debug
:END
cd %UTILSDIR%\..
......@@ -11,7 +11,6 @@ LibDestDir=Showpath(ScriptDir & "..\..\libs")
UtilsDir=Showpath(ScriptDir & "Tools")
GetTarGZObjects UtilsDir
If Not FSO.FolderExists(LibDestDir & "osip") Then
WgetUnTarGz "http://www.antisip.com/download/libosip2-2.2.1.tar.gz", LibDestDir
RenameFolder LibDestDir & "libosip2-2.2.1", "osip"
......@@ -42,6 +41,12 @@ If Not FSO.FolderExists(LibDestDir & "apr") Then
Upgrade LibDestDir & "apr\libapr.dsp", LibDestDir & "apr\libapr.vcproj"
End If
If Not FSO.FolderExists(LibDestDir & "sqlite") Then
WgetUnZip "http://www.sqlite.org/sqlite-source-3_2_7.zip", LibDestDir
RenameFolder LibDestDir & "sqlite-source-3_2_7", "sqlite"
Upgrade Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\sqlite.vcproj"
End If
WScript.Echo "Download Complete"
Sub RenameFolder(FolderName, NewFolderName)
......@@ -104,6 +109,18 @@ Sub WgetUnTarGZ(URL, DestFolder)
UnTarGZ Destfolder & filename, DestFolder
End Sub
Sub WgetUnZip(URL, DestFolder)
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If
StartPos = InstrRev(URL, "/", -1, 1)
strlength = Len(URL)
filename=Right(URL,strlength-StartPos)
NameEnd = InstrRev(filename, ".",-1, 1)
filestrlength = Len(filename)
filebase = Left(filename,NameEnd)
Wget URL, DestFolder
UnZip Destfolder & filename, DestFolder & filebase
End Sub
Sub GetTarGZObjects(DestFolder)
Dim oExec
......@@ -113,13 +130,19 @@ Sub GetTarGZObjects(DestFolder)
Wget "http://www.sofaswitch.org/mikej/XTar.dll", DestFolder
End If
If Not FSO.FileExists(DestFolder & "XGzip.dll") Then
If Not FSO.FileExists(DestFolder & "XGZip.dll") Then
Wget "http://www.sofaswitch.org/mikej/XGZip.dll", DestFolder
End If
If Not FSO.FileExists(DestFolder & "XZip.dll") Then
Wget "http://www.sofaswitch.org/mikej/XZip.dll", DestFolder
End If
WshShell.Run "regsvr32 /s " & DestFolder & "XTar.dll", 6, True
WshShell.Run "regsvr32 /s " & DestFolder & "XGZip.dll", 6, True
WshShell.Run "regsvr32 /s " & DestFolder & "XZip.dll", 6, True
End Sub
......@@ -136,6 +159,14 @@ Sub UnTarGZ(TGZfile, DestFolder)
End Sub
Sub UnZip(Zipfile, DestFolder)
Dim objZip
Set objZip = WScript.CreateObject("XStandard.Zip")
objZip.UnPack Zipfile, DestFolder
Set objZip = Nothing
End Sub
Sub Wget(URL, DestFolder)
StartPos = InstrRev(URL, "/", -1, 1)
......@@ -168,5 +199,5 @@ End Sub
Function Showpath(folderspec)
Set f = FSO.GetFolder(folderspec)
showpath = f.path
showpath = f.path & "\"
End Function
\ No newline at end of file
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objArgs = WScript.Arguments
'system, user, or process
wscript.echo Showpath(objargs(0))
Function Showpath(folderspec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
showpath = f.path
End Function
\ No newline at end of file
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sqlite"
ProjectGUID="{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;SQLITE_DEBUG"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/sqlite.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug DLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;SQLITE_DEBUG"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
ModuleDefinitionFile="sqlite3.def"
GenerateDebugInformation="TRUE"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release DLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
ModuleDefinitionFile="sqlite3.def"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="alter.c">
</File>
<File
RelativePath="analyze.c">
</File>
<File
RelativePath="attach.c">
</File>
<File
RelativePath="auth.c">
</File>
<File
RelativePath="btree.c">
</File>
<File
RelativePath="build.c">
</File>
<File
RelativePath="callback.c">
</File>
<File
RelativePath="complete.c">
</File>
<File
RelativePath="date.c">
</File>
<File
RelativePath="delete.c">
</File>
<File
RelativePath="expr.c">
</File>
<File
RelativePath="func.c">
</File>
<File
RelativePath="hash.c">
</File>
<File
RelativePath="insert.c">
</File>
<File
RelativePath="legacy.c">
</File>
<File
RelativePath="main.c">
</File>
<File
RelativePath="opcodes.c">
</File>
<File
RelativePath="os_unix.c">
</File>
<File
RelativePath="os_win.c">
</File>
<File
RelativePath="pager.c">
</File>
<File
RelativePath="parse.c">
</File>
<File
RelativePath="pragma.c">
</File>
<File
RelativePath="prepare.c">
</File>
<File
RelativePath="printf.c">
</File>
<File
RelativePath="random.c">
</File>
<File
RelativePath="select.c">
</File>
<File
RelativePath="shell.c">
</File>
<File
RelativePath="table.c">
</File>
<File
RelativePath="tokenize.c">
</File>
<File
RelativePath="trigger.c">
</File>
<File
RelativePath="update.c">
</File>
<File
RelativePath="utf.c">
</File>
<File
RelativePath="util.c">
</File>
<File
RelativePath="vacuum.c">
</File>
<File
RelativePath="vdbe.c">
</File>
<File
RelativePath="vdbeapi.c">
</File>
<File
RelativePath="vdbeaux.c">
</File>
<File
RelativePath="vdbefifo.c">
</File>
<File
RelativePath="vdbemem.c">
</File>
<File
RelativePath="where.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="btree.h">
</File>
<File
RelativePath="hash.h">
</File>
<File
RelativePath="keywordhash.h">
</File>
<File
RelativePath="opcodes.h">
</File>
<File
RelativePath="os.h">
</File>
<File
RelativePath="os_common.h">
</File>
<File
RelativePath="os_unix.h">
</File>
<File
RelativePath="os_win.h">
</File>
<File
RelativePath="pager.h">
</File>
<File
RelativePath="parse.h">
</File>
<File
RelativePath="sqlite3.h">
</File>
<File
RelativePath="sqliteInt.h">
</File>
<File
RelativePath="vdbe.h">
</File>
<File
RelativePath="vdbeInt.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Const OpenAsASCII = 0 ' Opens the file as ASCII (TristateFalse)
Const OpenAsUnicode = -1 ' Opens the file as Unicode (TristateTrue)
Const OpenAsDefault = -2 ' Opens the file using the system default
Const OverwriteIfExist = -1
Const FailIfNotExist = 0
Const ForReading = 1
Set objArgs = WScript.Arguments
' path to original log file
sFileName = objargs(0)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set fOrgFile = oFSO.OpenTextFile(sFileName, ForReading, FailIfNotExist, OpenAsASCII)
sText = fOrgFile.ReadAll
fOrgFile.Close
sText = Replace(sText, vbLf, vbCrLf)
Set fNewFile = oFSO.CreateTextFile(sFileName, OverwriteIfExist, OpenAsASCII)
fNewFile.WriteLine sText
fNewFile.Close
Set objFile = Createobject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
If WshSysEnv("VS80COMNTOOLS")<> "" Then
Set vcProj = CreateObject("VisualStudio.VCProjectEngine.8.0")
Else If WshSysEnv("VS71COMNTOOLS")<> "" Then
Set vcProj = CreateObject("VisualStudio.VCProjectEngine.7.1")
Else
Wscript.Echo("Did not find any Visual Studio .net 2003 or 2005 on your machine")
WScript.Quit(1)
End If
End If
'// check the arguments to be sure it's right
if (objArgs.Count() < 2) Then
WScript.Echo("VC6 or 5 DSP Project File Conversion")
WScript.Echo("Opens specified .dsp and converts to VC7.1 Format.")
WScript.Echo("Will create project file with .vcproj extension")
WScript.Echo("usage: <full path\project.dsp> <full path\project.vcproj>")
WScript.Quit(1)
End If
WScript.Echo("Converting: "+ objArgs.Item(0))
'// If there is a file name of the .vcproj extension, do not convert
Set vcProject = vcProj.LoadProject(objArgs.Item(0))
If Not objFile.FileExists(vcProject.ProjectFile) Then
' // specify name and location of new project file
vcProject.ProjectFile = objArgs.Item(1)
' // call the project engine to save this off.
' // when no name is shown, it will create one with the .vcproj name
vcProject.Save()
WScript.Echo("New Project Name: "+vcProject.ProjectFile+"")
Else
WScript.Echo("ERROR!: "+vcProject.ProjectFile+" already exists!")
End If
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objArgs = WScript.Arguments
StartPos = InstrRev(objargs(0), "/", -1, 1)
strlength = Len(objargs(0))
If objArgs.Count > 1 Then
Path= Showpath(objargs(1))
Else
Path= Showpath(".")
End If
Wget objargs(0), Path & "\", Right(objargs(0),strlength-StartPos)
Sub Wget(URL, DestFolder, Imagefile)
Set xml = CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", URL, False
xml.Send
set oStream = createobject("Adodb.Stream")
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Const adSaveCreateNotExist = 1
oStream.type = adTypeBinary
oStream.open
oStream.write xml.responseBody
' Do not overwrite an existing file
oStream.savetofile DestFolder & ImageFile, adSaveCreateNotExist
' Use this form to overwrite a file if it already exists
' oStream.savetofile DestFolder & ImageFile, adSaveCreateOverWrite
oStream.close
set oStream = nothing
Set xml = Nothing
End Sub
Function Showpath(folderspec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
showpath = f.path
End Function
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论