Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
40cbc5c0
提交
40cbc5c0
authored
1月 04, 2013
作者:
Jeff Lenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4768 rest of garmts changes mostly cosmetic
上级
dd25e7ea
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
129 行增加
和
120 行删除
+129
-120
util.vbs
libs/win32/util.vbs
+129
-120
没有找到文件。
libs/win32/util.vbs
浏览文件 @
40cbc5c0
...
...
@@ -143,31 +143,40 @@ Sub UnCompress(Archive, DestFolder)
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
If
FSO
.
FileExists
(
Left
(
Archive
,
Len
(
Archive
)
-
3
))
Then
wscript
.
echo
(
"Ready extracting: "
&
Archive
)
Fn
=
Left
(
Archive
,
Len
(
Archive
)
-
3
)
If
FSO
.
FileExists
(
Fn
)
Then
WScript
.
Sleep
(
100
)
wscript
.
echo
(
"Processing: "
&
Fn
&
" - deleting "
&
batname
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
Set
MyFile
=
fso
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
FSO
.
DeleteFile
Left
(
Archive
,
Len
(
Archive
)
-
3
)
,
true
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
End
If
If
FSO
.
FileExists
(
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
"tar"
)
Then
Fn
=
Fn
&
tar
If
FSO
.
FileExists
(
Fn
)
Then
WScript
.
Sleep
(
100
)
wscript
.
echo
(
"Processing: "
&
Fn
&
" - deleting "
&
batname
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
Set
MyFile
=
fso
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
"tar"
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"7za.exe"
&
quote
&
" x "
&
quote
&
Fn
&
quote
&
" -y -o"
&
quote
&
DestFolder
&
quote
)
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
FSO
.
DeleteFile
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
"tar"
,
true
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
End
If
WScript
.
Sleep
(
500
)
...
...
@@ -182,10 +191,9 @@ Sub Wget(URL, DestFolder)
filename
=
Right
(
URL
,
strlength
-
StartPos
)
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
Wscript
.
echo
(
"Downloading: "
&
URL
)
If
UseWgetEXE
Then
batname
=
"tmp"
&
CStr
(
Int
(
10000
*
Rnd
))
&
".bat"
If
UseWgetEXE
Then
Wscript
.
echo
(
"Downloading (wget): "
&
URL
)
batname
=
"tmp"
&
CStr
(
Int
(
100000
*
Rnd
))
&
".bat"
Set
MyFile
=
fso
.
CreateTextFile
(
UtilsDir
&
batname
,
True
)
MyFile
.
WriteLine
(
"@cd "
&
quote
&
DestFolder
&
quote
)
MyFile
.
WriteLine
(
"@"
&
quote
&
UtilsDir
&
"wget.exe"
&
quote
&
" "
&
URL
)
...
...
@@ -195,7 +203,9 @@ If UseWgetEXE Then
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Else
Else
Wscript
.
echo
(
"Downloading (HTTP GET): "
&
URL
)
xml
.
Open
"GET"
,
URL
,
False
xml
.
Send
...
...
@@ -208,7 +218,7 @@ Else
oStream
.
write
xml
.
responseBody
oStream
.
savetofile
DestFolder
&
filename
,
adSaveCreateOverWrite
oStream
.
close
End
If
End
If
End
Sub
...
...
@@ -223,11 +233,11 @@ Sub Slow_Wget(URL, DestFolder)
xml
.
Send
const
ForReading
=
1
,
ForWriting
=
2
,
ForAppending
=
8
Set
MyFile
=
fso
.
OpenTextFile
(
DestFolder
&
filename
,
ForWriting
,
True
)
For
i
=
1
to
lenb
(
xml
.
responseBody
)
Set
MyFile
=
fso
.
OpenTextFile
(
DestFolder
&
filename
,
ForWriting
,
True
)
For
i
=
1
to
lenb
(
xml
.
responseBody
)
MyFile
.
write
Chr
(
Ascb
(
midb
(
xml
.
responseBody
,
i
,
1
)))
Next
MyFile
.
Close
()
Next
MyFile
.
Close
()
End
Sub
...
...
@@ -239,22 +249,22 @@ End Function
Function
FindVersionStringInConfigure
(
strConfigFile
,
strVersionString
)
Set
objRegEx
=
CreateObject
(
"VBScript.RegExp"
)
objRegEx
.
Pattern
=
"[^#]AC_SUBST\("
&
strVersionString
&
".*\[([^\[]*)\]"
Set
objRegEx
=
CreateObject
(
"VBScript.RegExp"
)
objRegEx
.
Pattern
=
"[^#]AC_SUBST\("
&
strVersionString
&
".*\[([^\[]*)\]"
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objFile
=
objFSO
.
OpenTextFile
(
strConfigFile
,
1
)
strSearchString
=
objFile
.
ReadAll
objFile
.
Close
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objFile
=
objFSO
.
OpenTextFile
(
strConfigFile
,
1
)
strSearchString
=
objFile
.
ReadAll
objFile
.
Close
Set
colMatches
=
objRegEx
.
Execute
(
strSearchString
)
Set
colMatches
=
objRegEx
.
Execute
(
strSearchString
)
strResult
=
""
If
colMatches
.
Count
>
0
Then
strResult
=
""
If
colMatches
.
Count
>
0
Then
For
Each
strMatch
in
colMatches
strResult
=
objRegEx
.
Replace
(
strMatch
.
Value
,
"$1"
)
Next
End
If
End
If
FindVersionStringInConfigure
=
strResult
...
...
@@ -279,7 +289,6 @@ Sub FindReplaceInFile(FileName, sFind, sReplace)
End
Sub
Function
ExecAndGetResult
(
tmpFolder
,
VersionDir
,
execStr
)
Set
MyFile
=
FSO
.
CreateTextFile
(
tmpFolder
&
"tmpExec.Bat"
,
True
)
MyFile
.
WriteLine
(
"@"
&
"cd "
&
quote
&
VersionDir
&
quote
)
MyFile
.
WriteLine
(
"@"
&
execStr
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论