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
...
@@ -47,7 +47,7 @@ If objArgs.Count >=3 Then
...
@@ -47,7 +47,7 @@ If objArgs.Count >=3 Then
WgetUnCompress
objArgs
(
1
),
Showpath
(
objArgs
(
2
))
WgetUnCompress
objArgs
(
1
),
Showpath
(
objArgs
(
2
))
Case
"GetUnzipSounds"
Case
"GetUnzipSounds"
WgetSounds
objArgs
(
1
),
objArgs
(
2
),
Showpath
(
objArgs
(
3
)),
objArgs
(
4
)
WgetSounds
objArgs
(
1
),
objArgs
(
2
),
Showpath
(
objArgs
(
3
)),
objArgs
(
4
)
Case
"Version"
Case
"Version"
'CreateVersion(tmpFolder, VersionDir, includebase, includedest)
'CreateVersion(tmpFolder, VersionDir, includebase, includedest)
CreateVersion
Showpath
(
objArgs
(
1
)),
Showpath
(
objArgs
(
2
)),
objArgs
(
3
),
objArgs
(
4
)
CreateVersion
Showpath
(
objArgs
(
1
)),
Showpath
(
objArgs
(
2
)),
objArgs
(
3
),
objArgs
(
4
)
End
Select
End
Select
...
@@ -59,28 +59,28 @@ End If
...
@@ -59,28 +59,28 @@ End If
' *******************
' *******************
Sub
WgetSounds
(
PrimaryName
,
Freq
,
DestFolder
,
VersionFile
)
Sub
WgetSounds
(
PrimaryName
,
Freq
,
DestFolder
,
VersionFile
)
BaseURL
=
"http://files.freeswitch.org/freeswitch-sounds"
BaseURL
=
"http://files.freeswitch.org/freeswitch-sounds"
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objTextFile
=
objFSO
.
OpenTextFile
(
VersionFile
,
1
)
Set
objTextFile
=
objFSO
.
OpenTextFile
(
VersionFile
,
1
)
Do
Until
objTextFile
.
AtEndOfStream
Do
Until
objTextFile
.
AtEndOfStream
strLine
=
objTextFile
.
Readline
strLine
=
objTextFile
.
Readline
if
Len
(
strLine
)
>
2
then
if
Len
(
strLine
)
>
2
then
versionPos
=
InstrRev
(
strLine
,
" "
,
-
1
,
1
)
versionPos
=
InstrRev
(
strLine
,
" "
,
-
1
,
1
)
name
=
Left
(
strLine
,
versionPos
-
1
)
name
=
Left
(
strLine
,
versionPos
-
1
)
if
name
=
PrimaryName
Then
if
name
=
PrimaryName
Then
version
=
Right
(
strLine
,
Len
(
strLine
)
-
versionPos
)
version
=
Right
(
strLine
,
Len
(
strLine
)
-
versionPos
)
Wscript
.
Echo
"Sound name: "
&
name
&
" Version "
&
version
Wscript
.
Echo
"Sound name: "
&
name
&
" Version "
&
version
URL
=
BaseURL
&
"-"
&
name
&
"-"
&
Freq
&
"-"
&
version
&
".tar.gz"
URL
=
BaseURL
&
"-"
&
name
&
"-"
&
Freq
&
"-"
&
version
&
".tar.gz"
Wscript
.
Echo
"URL: "
&
URL
Wscript
.
Echo
"URL: "
&
URL
WgetUnCompress
URL
,
Showpath
(
DestFolder
)
WgetUnCompress
URL
,
Showpath
(
DestFolder
)
End
If
End
If
End
if
End
if
Loop
Loop
End
Sub
End
Sub
Sub
WgetUnCompress
(
URL
,
DestFolder
)
Sub
WgetUnCompress
(
URL
,
DestFolder
)
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
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
)
NameEnd
=
InstrRev
(
filename
,
"."
,
-
1
,
1
)
NameEnd
=
InstrRev
(
filename
,
"."
,
-
1
,
1
)
...
@@ -91,7 +91,7 @@ Sub WgetUnCompress(URL, DestFolder)
...
@@ -91,7 +91,7 @@ Sub WgetUnCompress(URL, DestFolder)
If
fileext
=
"zip"
Then
If
fileext
=
"zip"
Then
UnCompress
Destfolder
&
filename
,
DestFolder
&
filebase
UnCompress
Destfolder
&
filename
,
DestFolder
&
filebase
Else
Else
UnCompress
Destfolder
&
filename
,
DestFolder
UnCompress
Destfolder
&
filename
,
DestFolder
End
If
End
If
End
Sub
End
Sub
...
@@ -121,21 +121,21 @@ End Sub
...
@@ -121,21 +121,21 @@ End Sub
Sub
GetWgetEXE
(
DestFolder
)
Sub
GetWgetEXE
(
DestFolder
)
Dim
oExec
Dim
oExec
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Not
FSO
.
FileExists
(
DestFolder
&
"wget.exe"
)
Then
If
Not
FSO
.
FileExists
(
DestFolder
&
"wget.exe"
)
Then
Slow_Wget
ToolsBase
&
"wget.exe"
,
DestFolder
Slow_Wget
ToolsBase
&
"wget.exe"
,
DestFolder
End
If
End
If
End
Sub
End
Sub
Function
Strip
(
Str
)
Function
Strip
(
Str
)
Set
oRE
=
New
Regexp
Set
oRE
=
New
Regexp
oRE
.
Pattern
=
"[\W_]"
oRE
.
Pattern
=
"[\W_]"
oRE
.
Global
=
True
oRE
.
Global
=
True
Strip
=
oRE
.
Replace
(
Str
,
""
)
Strip
=
oRE
.
Replace
(
Str
,
""
)
End
Function
End
Function
Sub
UnCompress
(
Archive
,
DestFolder
)
Sub
UnCompress
(
Archive
,
DestFolder
)
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
...
@@ -143,77 +143,87 @@ Sub UnCompress(Archive, DestFolder)
...
@@ -143,77 +143,87 @@ Sub UnCompress(Archive, DestFolder)
Do
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
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
.
Sleep
(
100
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
wscript
.
echo
(
"Processing: "
&
Fn
&
" - deleting "
&
batname
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
Set
MyFile
=
fso
.
CreateTextFile
(
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
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Do
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
WScript
.
Sleep
(
500
)
FSO
.
DeleteFile
Left
(
Archive
,
Len
(
Archive
)
-
3
)
,
true
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
End
If
End
If
If
FSO
.
FileExists
(
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
"tar"
)
Then
Fn
=
Fn
&
tar
If
FSO
.
FileExists
(
Fn
)
Then
WScript
.
Sleep
(
100
)
WScript
.
Sleep
(
100
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
wscript
.
echo
(
"Processing: "
&
Fn
&
" - deleting "
&
batname
)
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
Set
MyFile
=
fso
.
CreateTextFile
(
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
MyFile
.
Close
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Set
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Do
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
wscript
.
echo
(
"Ready extracting: "
&
Fn
)
WScript
.
Sleep
(
500
)
WScript
.
Sleep
(
500
)
FSO
.
DeleteFile
Left
(
Archive
,
Len
(
Archive
)
-
3
)
&
"tar"
,
true
wscript
.
echo
(
"Deleting: "
&
Fn
)
FSO
.
DeleteFile
Fn
,
true
End
If
End
If
WScript
.
Sleep
(
500
)
WScript
.
Sleep
(
500
)
If
FSO
.
FileExists
(
UtilsDir
&
batname
)
Then
If
FSO
.
FileExists
(
UtilsDir
&
batname
)
Then
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
FSO
.
DeleteFile
UtilsDir
&
batname
,
True
End
If
End
If
End
Sub
End
Sub
Sub
Wget
(
URL
,
DestFolder
)
Sub
Wget
(
URL
,
DestFolder
)
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
)
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
Wscript
.
echo
(
"Downloading: "
&
URL
)
If
UseWgetEXE
Then
Wscript
.
echo
(
"Downloading (wget): "
&
URL
)
If
UseWgetEXE
Then
batname
=
"tmp"
&
CStr
(
Int
(
100000
*
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
oExec
=
WshShell
.
Exec
(
UtilsDir
&
batname
)
Do
Do
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
WScript
.
Echo
OExec
.
StdOut
.
ReadLine
()
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Loop
While
Not
OExec
.
StdOut
.
atEndOfStream
Else
Else
xml
.
Open
"GET"
,
URL
,
False
Wscript
.
echo
(
"Downloading (HTTP GET): "
&
URL
)
xml
.
Send
xml
.
Open
"GET"
,
URL
,
False
Const
adTypeBinary
=
1
xml
.
Send
Const
adSaveCreateOverWrite
=
2
Const
adSaveCreateNotExist
=
1
Const
adTypeBinary
=
1
Const
adSaveCreateOverWrite
=
2
oStream
.
type
=
adTypeBinary
Const
adSaveCreateNotExist
=
1
oStream
.
open
oStream
.
write
xml
.
responseBody
oStream
.
type
=
adTypeBinary
oStream
.
savetofile
DestFolder
&
filename
,
adSaveCreateOverWrite
oStream
.
open
oStream
.
close
oStream
.
write
xml
.
responseBody
End
If
oStream
.
savetofile
DestFolder
&
filename
,
adSaveCreateOverWrite
oStream
.
close
End
If
End
Sub
End
Sub
Sub
Slow_Wget
(
URL
,
DestFolder
)
Sub
Slow_Wget
(
URL
,
DestFolder
)
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
)
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
If
Right
(
DestFolder
,
1
)
<>
"\"
Then
DestFolder
=
DestFolder
&
"\"
End
If
...
@@ -221,13 +231,13 @@ Sub Slow_Wget(URL, DestFolder)
...
@@ -221,13 +231,13 @@ Sub Slow_Wget(URL, DestFolder)
Wscript
.
echo
(
"Downloading: "
&
URL
)
Wscript
.
echo
(
"Downloading: "
&
URL
)
xml
.
Open
"GET"
,
URL
,
False
xml
.
Open
"GET"
,
URL
,
False
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
()
End
Sub
End
Sub
...
@@ -239,36 +249,36 @@ End Function
...
@@ -239,36 +249,36 @@ End Function
Function
FindVersionStringInConfigure
(
strConfigFile
,
strVersionString
)
Function
FindVersionStringInConfigure
(
strConfigFile
,
strVersionString
)
Set
objRegEx
=
CreateObject
(
"VBScript.RegExp"
)
Set
objRegEx
=
CreateObject
(
"VBScript.RegExp"
)
objRegEx
.
Pattern
=
"[^#]AC_SUBST\("
&
strVersionString
&
".*\[([^\[]*)\]"
objRegEx
.
Pattern
=
"[^#]AC_SUBST\("
&
strVersionString
&
".*\[([^\[]*)\]"
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objFSO
=
CreateObject
(
"Scripting.FileSystemObject"
)
Set
objFile
=
objFSO
.
OpenTextFile
(
strConfigFile
,
1
)
Set
objFile
=
objFSO
.
OpenTextFile
(
strConfigFile
,
1
)
strSearchString
=
objFile
.
ReadAll
strSearchString
=
objFile
.
ReadAll
objFile
.
Close
objFile
.
Close
Set
colMatches
=
objRegEx
.
Execute
(
strSearchString
)
Set
colMatches
=
objRegEx
.
Execute
(
strSearchString
)
strResult
=
""
strResult
=
""
If
colMatches
.
Count
>
0
Then
If
colMatches
.
Count
>
0
Then
For
Each
strMatch
in
colMatches
For
Each
strMatch
in
colMatches
strResult
=
objRegEx
.
Replace
(
strMatch
.
Value
,
"$1"
)
strResult
=
objRegEx
.
Replace
(
strMatch
.
Value
,
"$1"
)
Next
Next
End
If
End
If
FindVersionStringInConfigure
=
strResult
FindVersionStringInConfigure
=
strResult
End
Function
End
Function
Sub
FindReplaceInFile
(
FileName
,
sFind
,
sReplace
)
Sub
FindReplaceInFile
(
FileName
,
sFind
,
sReplace
)
Const
OpenAsASCII
=
0
' Opens the file as ASCII (TristateFalse)
Const
OpenAsASCII
=
0
' Opens the file as ASCII (TristateFalse)
Const
OpenAsUnicode
=
-
1
' Opens the file as Unicode (TristateTrue)
Const
OpenAsUnicode
=
-
1
' Opens the file as Unicode (TristateTrue)
Const
OpenAsDefault
=
-
2
' Opens the file using the system default
Const
OpenAsDefault
=
-
2
' Opens the file using the system default
Const
OverwriteIfExist
=
-
1
Const
OverwriteIfExist
=
-
1
Const
FailIfNotExist
=
0
Const
FailIfNotExist
=
0
Const
ForReading
=
1
Const
ForReading
=
1
Set
fOrgFile
=
FSO
.
OpenTextFile
(
FileName
,
ForReading
,
FailIfNotExist
,
OpenAsASCII
)
Set
fOrgFile
=
FSO
.
OpenTextFile
(
FileName
,
ForReading
,
FailIfNotExist
,
OpenAsASCII
)
sText
=
fOrgFile
.
ReadAll
sText
=
fOrgFile
.
ReadAll
fOrgFile
.
Close
fOrgFile
.
Close
...
@@ -279,33 +289,32 @@ Sub FindReplaceInFile(FileName, sFind, sReplace)
...
@@ -279,33 +289,32 @@ Sub FindReplaceInFile(FileName, sFind, sReplace)
End
Sub
End
Sub
Function
ExecAndGetResult
(
tmpFolder
,
VersionDir
,
execStr
)
Function
ExecAndGetResult
(
tmpFolder
,
VersionDir
,
execStr
)
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
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
While
Not
OExec
.
StdOut
.
atEndOfStream
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
End
Function
End
Function
Function
ExecAndGetExitCode
(
tmpFolder
,
VersionDir
,
execStr
)
Function
ExecAndGetExitCode
(
tmpFolder
,
VersionDir
,
execStr
)
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
ExecAndGetExitCode
=
WshShell
.
Run
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
,
0
,
True
)
ExecAndGetExitCode
=
WshShell
.
Run
(
"cmd /C "
&
quote
&
tmpFolder
&
"tmpExec.Bat"
&
quote
,
0
,
True
)
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
FSO
.
DeleteFile
(
tmpFolder
&
"tmpExec.Bat"
)
End
Function
End
Function
...
@@ -320,28 +329,28 @@ End Function
...
@@ -320,28 +329,28 @@ End Function
Function
GetTimeUTC
()
Function
GetTimeUTC
()
iOffset
=
WshShell
.
RegRead
(
"HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"
)
iOffset
=
WshShell
.
RegRead
(
"HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"
)
If
IsNumeric
(
iOffset
)
Then
If
IsNumeric
(
iOffset
)
Then
GetTimeUTC
=
DateAdd
(
"n"
,
iOffset
,
Now
())
GetTimeUTC
=
DateAdd
(
"n"
,
iOffset
,
Now
())
Else
Else
GetTimeUTC
=
Now
()
GetTimeUTC
=
Now
()
End
If
End
If
End
Function
End
Function
Sub
CreateVersion
(
tmpFolder
,
VersionDir
,
includebase
,
includedest
)
Sub
CreateVersion
(
tmpFolder
,
VersionDir
,
includebase
,
includedest
)
Dim
oExec
Dim
oExec
strVerMajor
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MAJOR"
)
strVerMajor
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MAJOR"
)
strVerMinor
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MINOR"
)
strVerMinor
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MINOR"
)
strVerMicro
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MICRO"
)
strVerMicro
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_MICRO"
)
strVerRev
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_REVISION"
)
strVerRev
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_REVISION"
)
strVerHuman
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_REVISION_HUMAN"
)
strVerHuman
=
FindVersionStringInConfigure
(
VersionDir
&
"configure.in"
,
"SWITCH_VERSION_REVISION_HUMAN"
)
'Set version to the one reported by configure.in
'Set version to the one reported by configure.in
If
strVerRev
<>
""
Then
If
strVerRev
<>
""
Then
VERSION
=
strVerRev
VERSION
=
strVerRev
End
If
End
If
Dim
sLastFile
Dim
sLastFile
...
@@ -392,12 +401,12 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
...
@@ -392,12 +401,12 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
End
If
End
If
sLastFile
.
Close
sLastFile
.
Close
End
If
End
If
If
VERSION
&
" "
&
strVerHuman
<>
sLastVersion
Then
If
VERSION
&
" "
&
strVerHuman
<>
sLastVersion
Then
Set
MyFile
=
fso
.
CreateTextFile
(
tmpFolder
&
"lastversion"
,
True
)
Set
MyFile
=
fso
.
CreateTextFile
(
tmpFolder
&
"lastversion"
,
True
)
MyFile
.
WriteLine
(
VERSION
&
" "
&
strVerHuman
)
MyFile
.
WriteLine
(
VERSION
&
" "
&
strVerHuman
)
MyFile
.
Close
MyFile
.
Close
FSO
.
CopyFile
includebase
,
includedest
,
true
FSO
.
CopyFile
includebase
,
includedest
,
true
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION@"
,
VERSION
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION@"
,
VERSION
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_MAJOR@"
,
strVerMajor
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_MAJOR@"
,
strVerMajor
...
@@ -405,5 +414,5 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
...
@@ -405,5 +414,5 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_MICRO@"
,
strVerMicro
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_MICRO@"
,
strVerMicro
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION_HUMAN@"
,
strVerHuman
FindReplaceInFile
includedest
,
"@SWITCH_VERSION_REVISION_HUMAN@"
,
strVerHuman
End
If
End
If
End
Sub
End
Sub
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论