Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4df19edb
提交
4df19edb
authored
1月 18, 2013
作者:
Jeff Lenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4768 applied hopefully final patch(for now) to util.vbs
上级
cad607d7
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
55 行增加
和
26 行删除
+55
-26
.gitignore
.gitignore
+3
-0
.gitignore
libs/.gitignore
+1
-0
util.vbs
libs/win32/util.vbs
+51
-26
没有找到文件。
.gitignore
浏览文件 @
4df19edb
...
@@ -184,3 +184,6 @@ ipch/
...
@@ -184,3 +184,6 @@ ipch/
/w32/Setup/obj
/w32/Setup/obj
*dSYM*
*dSYM*
/libs/xmlrpc-c/lib/expat/xmltok/nametab.h
/libs/xmlrpc-c/lib/expat/xmltok/nametab.h
/UpgradeLog.*
/_UpgradeReport_Files/
libs/.gitignore
浏览文件 @
4df19edb
...
@@ -357,6 +357,7 @@ opal
...
@@ -357,6 +357,7 @@ opal
/libwebsockets/test-server/Makefile.in
/libwebsockets/test-server/Makefile.in
/mongo-cxx-driver-v*/
/mongo-cxx-driver-v*/
/mpg123/
/mpg123/
/libmpg123/
/openldap-*/
/openldap-*/
/openssl-*/
/openssl-*/
/openzap/build/compile
/openzap/build/compile
...
...
libs/win32/util.vbs
浏览文件 @
4df19edb
...
@@ -94,6 +94,8 @@ End Sub
...
@@ -94,6 +94,8 @@ End Sub
Sub
GetCompressionTools
(
DestFolder
)
Sub
GetCompressionTools
(
DestFolder
)
Dim
tries
Dim
tries
Dim
max_tries
Dim
max_tries
Dim
MyFile
tries
=
0
tries
=
0
max_tries
=
10
max_tries
=
10
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
...
@@ -109,6 +111,7 @@ Sub GetCompressionTools(DestFolder)
...
@@ -109,6 +111,7 @@ Sub GetCompressionTools(DestFolder)
FSO
.
DeleteFile
DestFolder
&
"7za.tag"
,
true
FSO
.
DeleteFile
DestFolder
&
"7za.tag"
,
true
Wscript
.
echo
(
"Downloaded 7za.exe"
)
Wscript
.
echo
(
"Downloaded 7za.exe"
)
End
If
End
If
Set
MyFile
=
Nothing
WScript
.
Sleep
(
500
)
WScript
.
Sleep
(
500
)
End
If
End
If
Do
While
FSO
.
FileExists
(
DestFolder
&
"7za.tag"
)
And
tries
<
max_tries
Do
While
FSO
.
FileExists
(
DestFolder
&
"7za.tag"
)
And
tries
<
max_tries
...
@@ -137,33 +140,44 @@ Function Strip(Str)
...
@@ -137,33 +140,44 @@ Function Strip(Str)
Strip
=
Right
(
oRE
.
Replace
(
Str
,
""
),
20
)
Strip
=
Right
(
oRE
.
Replace
(
Str
,
""
),
20
)
End
Function
End
Function
Sub
ExecPrintOutput
(
Str
)
Dim
Process
Set
Process
=
WshShell
.
Exec
(
Str
)
Do
If
Not
Process
.
StdOut
.
atEndOfStream
Then
WScript
.
Echo
Process
.
StdOut
.
ReadLine
()
End
If
Loop
Until
(
Process
.
Status
<>
0
)
And
(
Process
.
StdOut
.
atEndOfStream
)
Process
.
Terminate
WScript
.
Sleep
(
500
)
End
Sub
Sub
UnCompress
(
Archive
,
DestFolder
)
Sub
UnCompress
(
Archive
,
DestFolder
)
Dim
Fn
Dim
Fn
Dim
batname
Dim
batname
Dim
MyFile
GetCompressionTools
UtilsDir
GetCompressionTools
UtilsDir
batname
=
"tmp"
&
Strip
(
Archive
)
&
CStr
(
Int
(
10000
*
Rnd
))
&
".bat"
batname
=
"tmp"
&
Strip
(
Archive
)
&
CStr
(
Int
(
10000
*
Rnd
))
&
".bat"
wscript
.
echo
(
"Extracting: "
&
Archive
&
" - using: "
&
batname
)
wscript
.
echo
(
"Extracting: "
&
Archive
&
" - using: "
&
batname
)
Set
MyFile
=
fso
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Archive
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Archive
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
Close
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
MyFile
=
Nothing
Do
ExecPrintOutput
(
UtilsDir
&
batname
)
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Archive
)
wscript
.
echo
(
"Ready extracting: "
&
Archive
)
Fn
=
Left
(
Archive
,
Len
(
Archive
)
-
3
)
Fn
=
Left
(
Archive
,
Len
(
Archive
)
-
3
)
If
FSO
.
FileExists
(
Fn
)
Then
If
FSO
.
FileExists
(
Fn
)
Then
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
Close
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
MyFile
=
Nothing
Do
ExecPrintOutput
(
UtilsDir
&
batname
)
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
wscript
.
echo
(
"Deleting: "
&
Fn
)
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
FSO
.
DeleteFile
Fn
,
true
End
If
End
If
...
@@ -172,12 +186,9 @@ Sub UnCompress(Archive, DestFolder)
...
@@ -172,12 +186,9 @@ Sub UnCompress(Archive, DestFolder)
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
Close
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
MyFile
=
Nothing
Do
ExecPrintOutput
(
UtilsDir
&
batname
)
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
wscript
.
echo
(
"Deleting: "
&
Fn
)
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
FSO
.
DeleteFile
Fn
,
true
End
If
End
If
...
@@ -189,6 +200,8 @@ Sub UnCompress(Archive, DestFolder)
...
@@ -189,6 +200,8 @@ Sub UnCompress(Archive, DestFolder)
End
Sub
End
Sub
Sub
Wget
(
URL
,
DestFolder
)
Sub
Wget
(
URL
,
DestFolder
)
Dim
MyFile
StartPos
=
InstrRev
(
URL
,
"/"
,
-
1
,
1
)
StartPos
=
InstrRev
(
URL
,
"/"
,
-
1
,
1
)
strlength
=
Len
(
URL
)
strlength
=
Len
(
URL
)
filename
=
Right
(
URL
,
strlength
-
StartPos
)
filename
=
Right
(
URL
,
strlength
-
StartPos
)
...
@@ -197,15 +210,12 @@ Sub Wget(URL, DestFolder)
...
@@ -197,15 +210,12 @@ Sub Wget(URL, DestFolder)
If
UseWgetEXE
Then
If
UseWgetEXE
Then
Wscript
.
echo
(
"wget: "
&
URL
)
Wscript
.
echo
(
"wget: "
&
URL
)
batname
=
"tmp"
&
CStr
(
Int
(
10000
*
Rnd
))
&
".bat"
batname
=
"tmp"
&
CStr
(
Int
(
10000
*
Rnd
))
&
".bat"
Set
MyFile
=
fso
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@cd "
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@cd "
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"wget.exe"
&
quote
&
" "
&
URL
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"wget.exe"
&
quote
&
" "
&
URL
)
MyFile
.
Close
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
MyFile
=
Nothing
Do
ExecPrintOutput
(
UtilsDir
&
batname
)
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Else
Else
Wscript
.
echo
(
"XMLHTTP GET: "
&
URL
)
Wscript
.
echo
(
"XMLHTTP GET: "
&
URL
)
...
@@ -226,6 +236,8 @@ Sub Wget(URL, DestFolder)
...
@@ -226,6 +236,8 @@ Sub Wget(URL, DestFolder)
End
Sub
End
Sub
Sub
Slow_Wget
(
URL
,
DestFolder
)
Sub
Slow_Wget
(
URL
,
DestFolder
)
Dim
MyFile
StartPos
=
InstrRev
(
URL
,
"/"
,
-
1
,
1
)
StartPos
=
InstrRev
(
URL
,
"/"
,
-
1
,
1
)
strlength
=
Len
(
URL
)
strlength
=
Len
(
URL
)
filename
=
Right
(
URL
,
strlength
-
StartPos
)
filename
=
Right
(
URL
,
strlength
-
StartPos
)
...
@@ -236,11 +248,12 @@ Sub Slow_Wget(URL, DestFolder)
...
@@ -236,11 +248,12 @@ Sub Slow_Wget(URL, DestFolder)
xml
.
Send
xml
.
Send
const
ForReading
=
1
,
ForWriting
=
2
,
ForAppending
=
8
const
ForReading
=
1
,
ForWriting
=
2
,
ForAppending
=
8
Set
MyFile
=
fso
.
OpenTextFile
(
DestFolder
&
filename
,
ForWriting
,
True
)
Set
MyFile
=
FSO
.
OpenTextFile
(
DestFolder
&
filename
,
ForWriting
,
True
)
For
i
=
1
to
lenb
(
xml
.
responseBody
)
For
i
=
1
to
lenb
(
xml
.
responseBody
)
MyFile
.
write
Chr
(
Ascb
(
midb
(
xml
.
responseBody
,
i
,
1
)))
MyFile
.
write
Chr
(
Ascb
(
midb
(
xml
.
responseBody
,
i
,
1
)))
Next
Next
MyFile
.
Close
()
MyFile
.
Close
()
Set
MyFile
=
Nothing
End
Sub
End
Sub
...
@@ -292,29 +305,37 @@ Sub FindReplaceInFile(FileName, sFind, sReplace)
...
@@ -292,29 +305,37 @@ Sub FindReplaceInFile(FileName, sFind, sReplace)
End
Sub
End
Sub
Function
ExecAndGetResult
(
tmpFolder
,
VersionDir
,
execStr
)
Function
ExecAndGetResult
(
tmpFolder
,
VersionDir
,
execStr
)
Dim
MyFile
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"tmpExec.Bat"
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"tmpExec.Bat"
,
True
)
MyFile
.
WriteLine
(
"@"
&
"cd "
&
quote
&
VersionDir
&
quote
)
MyFile
.
WriteLine
(
"@"
&
"cd "
&
quote
&
VersionDir
&
quote
)
MyFile
.
WriteLine
(
"@"
&
execStr
)
MyFile
.
WriteLine
(
"@"
&
execStr
)
MyFile
.
Close
MyFile
.
Close
Set
MyFile
=
Nothing
Set
oExec
=
WshShell
.
Exec
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
)
Set
oExec
=
WshShell
.
Exec
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
)
ExecAndGetResult
=
Trim
(
OExec
.
StdOut
.
ReadLine
())
ExecAndGetResult
=
Trim
(
OExec
.
StdOut
.
ReadLine
())
Do
Do
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Loop
Until
(
oExec
.
Status
<>
0
)
And
(
oExec
.
StdOut
.
atEndOfStream
)
oExec
.
Terminate
WScript
.
Sleep
(
500
)
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
End
Function
End
Function
Function
ExecAndGetExitCode
(
tmpFolder
,
VersionDir
,
execStr
)
Function
ExecAndGetExitCode
(
tmpFolder
,
VersionDir
,
execStr
)
Dim
MyFile
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"tmpExec.Bat"
,
True
)
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"tmpExec.Bat"
,
True
)
MyFile
.
WriteLine
(
"@"
&
"cd "
&
quote
&
VersionDir
&
quote
)
MyFile
.
WriteLine
(
"@"
&
"cd "
&
quote
&
VersionDir
&
quote
)
MyFile
.
WriteLine
(
"@"
&
execStr
)
MyFile
.
WriteLine
(
"@"
&
execStr
)
MyFile
.
WriteLine
(
"@exit %ERRORLEVEL%"
)
MyFile
.
WriteLine
(
"@exit %ERRORLEVEL%"
)
MyFile
.
Close
MyFile
.
Close
Set
MyFile
=
Nothing
ExecAndGetExitCode
=
WshShell
.
Run
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
,
0
,
True
)
ExecAndGetExitCode
=
WshShell
.
Run
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
,
0
,
True
)
...
@@ -403,12 +424,16 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
...
@@ -403,12 +424,16 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
sLastVersion
=
sLastFile
.
ReadLine
()
sLastVersion
=
sLastFile
.
ReadLine
()
End
If
End
If
sLastFile
.
Close
sLastFile
.
Close
Set
sLastFile
=
Nothing
End
If
End
If
If
VERSION
&
" "
&
strVerHuman
<>
sLastVersion
Then
If
VERSION
&
" "
&
strVerHuman
<>
sLastVersion
Then
Set
MyFile
=
fso
.
CreateTextFile
(
tmpFolder
&
"lastversion"
,
True
)
Dim
MyFile
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"lastversion"
,
True
)
MyFile
.
WriteLine
(
VERSION
&
" "
&
strVerHuman
)
MyFile
.
WriteLine
(
VERSION
&
" "
&
strVerHuman
)
MyFile
.
Close
MyFile
.
Close
Set
MyFile
=
Nothing
FSO
.
CopyFile
includebase
,
includedest
,
true
FSO
.
CopyFile
includebase
,
includedest
,
true
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION@"
,
VERSION
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION@"
,
VERSION
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论