Locked WindowsInstaller bug in VB.Net?

  • 12 สิงหาคม 2554 9:47
     
     
    Hi,
    Im have an MSI with embedded transforms 1028 and 1041. their details are as follows: (sample)
    1028:
     Only change 1 Property table record.
     ProductLanguage: 9 ->1028
    1041:
     Has 2 changes in Property records:
     ProductLanguage: 9 -> 1041
     ProductName: MyProduct -> XXXXXX
    In my sample code below, I apply the transform and dump the _TransformView table.
    So I would expected only 1 change after applying 1028 and 2 changes for 1041. The
    result is fine if the smaller transform 1028 is run prior to the bigger one. But if the order
    is the opposite, i.e. 1041 then 1028, the ProductName change record of 1041 is still in
    the _TransformView table. 
    --------------------
    ' parameter args(0)=msiPath, args(1)=1041,1028
    Sub Main(ByVal args As String())
            Dim oInst As Installer = CreateObject("WindowsInstaller.Installer")
            Dim oDB As Database = oInst.OpenDatabase(args(0), 0)
            Dim k
            For Each k In args(1).Split(";")
                DumpUpdate(oDB, ":" & k)
            Next
            oDB = Nothing
    End Sub
    Sub DumpUpdate(ByRef oDB As Database, mstTransform As String)
            oDB.ApplyTransform(mstTransform,  &H100)
            Dim v As View = oDB.OpenView("SELECT `Table`,`Column`,`Row`,`Data`,`Current` FROM _TransformView")
            v.Execute()
            Do
                Dim r : r = v.Fetch
                If r Is Nothing Then Exit Do
                Console.WriteLine(r.StringData(1) & vbTab & r.StringData(2) & vbTab & r.StringData(3) & vbTab & r.StringData(4) & vbTab & r.StringData(5))
            Loop
            v = oDB.OpenView("ALTER TABLE _TransformView FREE")
            v.Execute()
        End Sub
    --------------------
    Basing from MSDN: http://msdn.microsoft.com/en-us/library/aa372926(v=vs.85).aspx)
    ---------------------
    The _TransformView table is not cleared when another transform is applied. The table reflects the 
    cumulative effect of successive applications. To view the transforms separately you must release the table.
    The _TransformView is held in memory by a lock count, that can be released with the following SQL command.
    "ALTER TABLE _TransformView FREE".
    ---------------------
    Is the result above expected? Why do we have the 2nd record of 1041 transform in 1021 _TransformView?
    Seems to me like bug in the COM part of WindowsInstaller?
    Thanks
    jojeru

ตอบทั้งหมด

  • 15 สิงหาคม 2554 7:04
    ผู้ดูแล
     
     
    But if the order is the opposite, i.e. 1041 then 1028, the ProductName change record of 1041 is still in
    the _TransformView table. 

    Hello jojeru,

    Thanks for your post.

    "The _TransformView table is not cleared when another transform is applied. The table reflects the cumulative effect of successive applications. To view the transforms separately you must release the table."

    As above sentence identified, when you apply the two transforms, the table reflects the cumulative effect of successive application. Try to release the table after one transform and then apply the other. Please have a try and let us know the situation on your side.

    If I misunderstood, please feel free to follow up.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • 16 สิงหาคม 2554 1:57
     
     

    hi Liliane,

    thanks for the reply. my intention was not to apply both the transforms that's why in my code in DumpUpdate function, i have the following lines. shouldn't this be enough to release the _TransformView table? this is the command which is described in MSDN. is there any other command to call other than this?

            v = oDB.OpenView("ALTER TABLE _TransformView FREE")
            v.Execute()
    code with comments:
    --------------------
         Sub DumpUpdate(ByRef oDB As Database, mstTransform As String)
            oDB.ApplyTransform(mstTransform,  &H100)  'apply the transform here
            Dim v As View = oDB.OpenView("SELECT `Table`,`Column`,`Row`,`Data`,`Current` FROM _TransformView")
            v.Execute()   'get the _TransformView view
            Do
                Dim r : r = v.Fetch    'fetch the record
                If r Is Nothing Then Exit Do 
                'write the record into the console
                Console.WriteLine(r.StringData(1) & vbTab & r.StringData(2) & vbTab & r.StringData(3) & vbTab & r.StringData(4) & vbTab & r.StringData(5))
            Loop
            'execute this command to release the _TransformView table
            v = oDB.OpenView("ALTER TABLE _TransformView FREE")
            v.Execute()
        End Sub
    --------------------
    any other idea what's happening here?
    thanks
    jojeru
  • 16 พฤศจิกายน 2554 8:59
     
     

    Hi,

    Got the reference as http://msdn.microsoft.com/en-us/library/windows/desktop/aa368562(v=vs.85).aspx, and realted scirpt code could be found in the windows sdk, hope could make some help on this.

     

    Also, you could  visit the below link to see the various paid support options that are available to better meet your needs if you requires a more in-depth level of support.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
     
     
     
    Regards