VBScript判断客户端是否需要下载控件

VBScript判断客户端是否需要下载控件:

<script language="vbscript">

              sub windo(ip,port,loginname,pass,contact,initiator)

               Dim WebSetupObj2

               On Error Resume Next

               set WebSetupObj2=CreateObject("WebStarter.WebEngine2")          

               

               if WebSetupObj2 is nothing then

                     Dim WebSetupObj

                     On Error Resume Next 

                      set WebSetupObj = CreateObject("WebStarter.WebEngine")

                    if WebSetupObj is nothing then   

                           if MsgBox("本地没有安装客户端,点击Ok后进行自动下载!",vbYesNo,"8分钟视频")=vbYes then

                                   window.open("要下载的程序所在的地址及程序名称" )

                            end if

                     else

                            if MsgBox("客户端有重大更改,要继续必须重新安装客户端,是否下载安装?",vbYesNo,"8分钟视频")=vbYes then

                                          window.open("要下载的程序所在的地址及程序名称" )                                                

                            end if     

                     end if

                     set WebSetupObj = nothing   

               else       

                      WebSetupObj2.AddUpdateParam    "服务器IP","端口","/messenger/"

                     WebSetupObj2.UpdateFileVersion "VideoChat.exe","1.0.0.20"

                     WebSetupObj2.UpdateFileVersion "a.wav","NOVER"

                     if WebSetupObj2.StartUpdate then

                            WebSetupObj2.AddServerParam ip,port

                            WebSetupObj2.AddUserParam    loginname,pass,contact,initiator                  

                            WebSetupObj2.StartExe "VideoChat.exe"      

                     else

                            if MsgBox("升级程序失败,点击OK后重新下载!",vbYesNo,"8分钟视频")=vbYes then

                                   window.open("要下载的程序所在的地址及程序名称" )      

                            end if            

                     end if

              end if 

              set WebSetupObj2=nothing

        end sub 

</script>

posted on 2006-05-01 01:51  老弹  阅读(416)  评论(0编辑  收藏  举报

导航