各位好,在bs方式,怎样才能让vb制作的ocx版本自动更新呢,怎样在CAB的INF中根据版本的不同,
当客户段发现高版本的ocx边会自动更新自己的ocx,自动下载高版本的ocx,并注册呢,
急,期待各位大侠帮忙,期待中。

解决方案 »

  1.   

    发现新版本从就让程序全部重安装一次
    用Setup Factory v6.03打包它会自己注册控件
    你可用AP函I数判断INF里有没数据更新
    仅供参考
      

  2.   

    再开发一个升级程序 
    这里有个vc的例子:
    简单的自动升级程序
    http://www.vckbase.com/code/downcode.asp?id=1968
      

  3.   

    How to create an auto update function. Dim intLocalVer As Integer 
    Dim b() As Byte 
    Dim intRemoteVer As Integer 
    Dim strRemoteVer As String 
    Dim doUpdate As Boolean'从本地文件中读出当前版本号
    Open App.Path & "\version.ini" For Input As #1 
    intLocalVer = CInt(Input(LOF(1), 1)) 
    Close #1 '从网上获取最新版本号
    b() = InetUpdate.OpenURL("http://visualbasic.about.com/library/weekly/remotever.dat", 1)
    strRemoteVer = "" 
    For t = 0 To UBound(b) 
        strRemoteVer = strRemoteVer + Chr(b(t)) 
    Next 
    intRemoteVer = Int(Val(strRemoteVer) )'如果有新版本
    If intRemoteVer > intLocalVer Then 
        If MsgBox("A more recent version of this program exists. Would you like to update it now?", vbYesNo Or vbQuestion) = vbYes Then 
            doUpdate = True 
        Else 
            doUpdate = False 
        End If 
    Else 
        MsgBox "You already have the most recent version of this program." 
        doUpdate = False 
    End If'更新 
    If doUpdate Then 
        b() = InetUpdate.OpenURL("http://visualbasic.about.com/library/weekly/yours.ocx", 1) 
        Open App.Path & "\temp.ocx" For Binary Access Write As #1 
        Put #1, , b() 
        Close 1 
        Kill App.Path & "\yours.ocx" 
        Name App.Path & "\temp.exe" As App.Path & "\yors.exe" 
        '写入新的版本号
        Open App.Path & "\version.ini" For Output As #1 
        Print #1, strRemoteVer 
        Close 1 
        MsgBox "Update Complete!" 
    End If