WindowsInstaller bug in VB.Net?
-
Friday, August 12, 2011 9:47 AMHi,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 ->10281041:Has 2 changes in Property records:ProductLanguage: 9 -> 1041ProductName: MyProduct -> XXXXXXIn 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. Theresult is fine if the smaller transform 1028 is run prior to the bigger one. But if the orderis the opposite, i.e. 1041 then 1028, the ProductName change record of 1041 is still inthe _TransformView table.--------------------' parameter args(0)=msiPath, args(1)=1041,1028Sub Main(ByVal args As String())Dim oInst As Installer = CreateObject("WindowsInstaller.Installer")Dim oDB As Database = oInst.OpenDatabase(args(0), 0)Dim kFor Each k In args(1).Split(";")DumpUpdate(oDB, ":" & k)NextoDB = NothingEnd SubSub 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()DoDim r : r = v.FetchIf r Is Nothing Then Exit DoConsole.WriteLine(r.StringData(1) & vbTab & r.StringData(2) & vbTab & r.StringData(3) & vbTab & r.StringData(4) & vbTab & r.StringData(5))Loopv = 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 thecumulative 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?Thanksjojeru
All Replies
-
Monday, August 15, 2011 7:04 AMModerator
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.
-
Tuesday, August 16, 2011 1:57 AM
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 hereDim v As View = oDB.OpenView("SELECT `Table`,`Column`,`Row`,`Data`,`Current` FROM _TransformView")v.Execute() 'get the _TransformView viewDoDim r : r = v.Fetch 'fetch the recordIf r Is Nothing Then Exit Do'write the record into the consoleConsole.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 tablev = oDB.OpenView("ALTER TABLE _TransformView FREE")v.Execute()End Sub--------------------any other idea what's happening here?thanksjojeru -
Wednesday, November 16, 2011 8:59 AM
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

