Since my response to Alex Ivanoff's question led to this exchange, allow me to state that my use of the VBS scripts was because I had overlooked part of the API exposed by DTF (Microsoft.Deployment.WindowsInstaller). There are exceptions, but I agree with Christopher that most WIX developers are better off creating an instance of Database and calling Execute(), rather than by starting a separate process to run WiRunSQL.vbs.
Gary > -----Original Message----- > From: Christopher Painter [mailto:chr...@iswix.com] > Sent: Tuesday, January 03, 2012 6:10 PM > To: General discussion for Windows Installer XML toolset.; > General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Querying the package andinstalled > productarchitecture > > > Ok, let's pretend I'm a .NET developer who doesn't know > anything about MSI > and I follow you're advice of reading through WiExport.vbs to > understand > the flow of exporting an IDT file. > > First problem I'm going to hit is trying to add a reference to > WindowsInstaller.Installer. Last time I checked the interops > (it's been > years) won't generate correctly. So I'm going to be writing > all kinds of > COM Interop wrappers or worse using a ProcessInfo class to > shell out of > process to the VBscript. Laugh, but I see it done all the time. > > Or I can just add a reference to > Microsoft.Deployment.WindowsInstaller and > write: > > using(Database database = new Database("foo.msi", > DatabaseOpenMode.ReadOnly)) > { > database.ExportAll(@"C:\"); > } > > It's really that easy and as clean as can be. For extra > bonus points the > using statement will automatically call the Dispose() methods > which will in > turn clean up all those pesky unmanged handles. > > For the summary information stream I just say: > using( var summaryInformation = new SummaryInfo(@"foo.msi", false)) > { > summaryInformation. // Intellisense kicks in . > } > > I can now easily see that summaryInformation exposes Author, > CharacterCount, CodePage et al. > > The point is, managed code and DTF rocks. DTF isn't just > about writing > custom actions, it's an all purpose interop assembly for > anything needing > to interact with Windows Installer and I find it really, > really useful for > writing build automation tasks and applications / utilities. > If you are > writing managed code you should be using it. If you are > doing unmanged C++ > then use the MSI API. If someone is still writing VBScript > instead of > PowerShell and VB6 instead of C#/VB.NET I really have to > scratch my head > and ask..... Why?? > > I'm not a "purist" I'm just pointing out the fact that the > VBS files are 12 > years (at least) old and were only samples. Sadly I've seen > far too many > people treat them as production libraries in their solutions. > > ---------------------------------------- > From: "Wilson, Phil" <phil.wil...@invensys.com> > Sent: Tuesday, January 03, 2012 4:44 PM > To: "General discussion for Windows Installer XML toolset." > <wix-users@lists.sourceforge.net> > Subject: Re: [WiX-users] Querying the package and installed > productarchitecture > > I think the sample VBScripts in the SDK are useful to the > extent that they > describe the flow for folks that aren't familiar with how to > use the APIs. > Exporting an MSI table with no guidance at all is a pain, but > I can see > from WiExport.vbs that I open the database, do an OpenView > with a Select > query, do a View fetch, and then get each record's string data. > > In this particular SummaryInfo case, WiSumInf.vbs is quite > instructive on > how to get the SummaryInfo for the Platform. I'm not a > language purist to > the extent that I'll ignore a working example, whatever > language it might be! > > Phil W > > -----Original Message----- > From: Christopher Painter [mailto:chr...@iswix.com] > Sent: Friday, December 30, 2011 5:56 PM > To: g...@gocek.org; General discussion for Windows Installer > XML toolset.; > General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Querying the package and installed > productarchitecture > > It's nearly 2012 and I'd much rather use C# and DTF. Perhaps > in 1999 those > VBScript files were interesting and useful. I can understand > the msi.h / > msi.lib is still good for the unmanaged C++ guys out there > and is certainly > the foundation for DTF but the whole VBScript / ActiveScript / COM / > Automation Interface world can RIP for all I care. Same goes > for the POS > Win32_Product class. > > ---------------------------------------- > From: "Gary Gocek" <g...@gocek.org> > Sent: Friday, December 30, 2011 7:28 PM > To: "General discussion for Windows Installer XML toolset." > <wix-users@lists.sourceforge.net> > Subject: Re: [WiX-users] Querying the package and installed > productarchitecture > > There are tools in the Windows SDK (I am currently using v7) that can > query > an MSI database. Look especially at the vbs scripts, you can > invoke them > with SQL to query properties and tables. > > http://msdn.microsoft.com/en-us/library/windows/desktop/aa372865(v=vs.85).as px > > Gary > > > -----Original Message----- > > From: Alex Ivanoff [mailto:aivan...@vmware.com] > > Sent: Friday, December 30, 2011 11:19 AM > > To: 'General discussion for Windows Installer XML toolset.' > > Subject: Re: [WiX-users] Querying the package and installed > > productarchitecture > > > > I need to be able to do it programmatically. > > > -----Original Message----- > > From: McCain, Jon [mailto:jon.mcc...@inin.com] > > Sent: Friday, December 30, 2011 07:31 > > To: General discussion for Windows Installer XML toolset. > > Cc: McCain, Jon > > Subject: Re: [WiX-users] Querying the package and installed product > > architecture > > > 1. Open the install in Orca > > 2. Click View -> Summary Information > > 3. The architecture type is listed under Platform. > > > Jon > > > -----Original Message----- > > From: Alex Ivanoff [mailto:aivan...@vmware.com] > > Sent: Thursday, December 29, 2011 6:17 PM > > To: 'General discussion for Windows Installer XML toolset.' > > Subject: [WiX-users] Querying the package and installed > > product architecture > > > > Is there a way to query the MSI package and/or installed product > > architecture (x86 vs. x64)? ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users