Here's the equivilant C# code for anyone interested:  ( using 
Microsoft.Deployment.WindowsInstaller )


ProductInstallation productInstallation = 
ProductInstallation.GetRelatedProducts("{9B70A6F1-4A3E-4955-8C34-2D354042B87
E}").First();

string template = new SummaryInfo(productInstallation.LocalPackage, 
false).Template;

----------------------------------------

From: "Wilson, Phil" <phil.wil...@invensys.com>

Sent: Friday, January 06, 2012 12:49 PM

To: "General discussion for Windows Installer XML toolset." 
<wix-users@lists.sourceforge.net>

Subject: Re: [WiX-users] Querying the package andinstalled 
productarchitecture


No real error checking,just stuck together code using VS 2010 UpgradeCode 
as a test: 


#include <msiquery.h>


WCHAR pbuf [40] = {0}; 

UINT eres = MsiEnumRelatedProducts 
(L"{776922EE-1E34-36CE-A15B-82BB65DC183E}", 0, 0, pbuf); 

WCHAR localpath [MAX_PATH+1] = {0}; 

DWORD plen = MAX_PATH;

eres = MsiGetProductInfo (pbuf, INSTALLPROPERTY_LOCALPACKAGE, localpath, 
&plen); 

PMSIHANDLE hsum;

INT naught=0;

WCHAR buf [100] = {0}; 

DWORD len = 100; 

UINT type=0;

UINT res = MsiGetSummaryInformation (0, localpath, 0, &hsum); 

if (ERROR_SUCCESS == res)

{


res = MsiSummaryInfoGetProperty (hsum, 7, &type, &naught, NULL, buf, 
&len);

}


-----Original Message-----

From: Alex Ivanoff [mailto:aivan...@vmware.com] 

Sent: Friday, January 06, 2012 10:29 AM

To: chr...@iswix.com; 'General discussion for Windows Installer XML 
toolset.'

Subject: Re: [WiX-users] Querying the package andinstalled 
productarchitecture


Native C++.


-----Original Message-----

From: Christopher Painter [mailto:chr...@iswix.com]

Sent: Friday, January 06, 2012 11:23

To: General discussion for Windows Installer XML toolset.; General 

discussion for Windows Installer XML toolset.

Subject: Re: [WiX-users] Querying the package andinstalled 

productarchitecture


There are methods on the automation objects that you can call to resolve a 


product code that machines and upgrade code then get the file path to the 

cached MSI for that product code and then open the database to get access 
to 

the summary information stream and then access the template summary 

property.


I'd give you samples but I'm not sure if you are using C++, VBScript or 
C#.


----------------------------------------


From: "Alex Ivanoff" <aivan...@vmware.com>


Sent: Friday, January 06, 2012 9:46 AM


To: "General discussion for Windows Installer XML toolset."

<wix-users@lists.sourceforge.net>


Subject: Re: [WiX-users] Querying the package andinstalled 

productarchitecture


I am sorry, I should have been more explicit in the question: given the


installed product upgrade code how do I find that product architecture?


-----Original Message-----


From: Wilson, Phil [mailto:phil.wil...@invensys.com]


Sent: Thursday, January 05, 2012 18:58


To: General discussion for Windows Installer XML toolset.


Subject: Re: [WiX-users] Querying the package andinstalled


productarchitecture


If it's working ok you should get a result something like "Intel64;1033"or


"Intel;1033"that tells you that.


Phil W.


-----Original Message-----


From: Alex Ivanoff [mailto:aivan...@vmware.com]


Sent: Thursday, January 05, 2012 10:30 AM


To: 'General discussion for Windows Installer XML toolset.'


Subject: Re: [WiX-users] Querying the package andinstalled


productarchitecture


I think I figured out how to get package architecture throw Template


property of SummaryInfo, but I still cannot find a way to get installed


product architecture.


> 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


----------------------------------------------------------------------------


--


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


*** Confidentiality Notice: This e-mail, including any associated or


attached files, is intended solely for the individual or entity to which 
it


is addressed. This e-mail is confidential and may well also be legally


privileged. If you have received it in error, you are on notice of its


status. Please notify the sender immediately by reply e-mail and then

delete


this message from your system. Please do not copy it or use it for any


purposes, or disclose its contents to any other person. This email comes


from a division of the Invensys Group, owned by Invensys plc, which is a


company registered in England and Wales with its registered office at 3rd


Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). 
For


a list of European legal entities within the Invensys Group, please go to


http://www.invensys.com/en/legal/default.aspx.


You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail


recept...@invensys.com. This e-mail and any attachments thereto may be


subject to the terms of any agreements between Invensys (and/or its


subsidiaries and affiliates) and the recipient (and/or its subsidiaries 
and


affiliates).


----------------------------------------------------------------------------


--


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


----------------------------------------------------------------------------


--


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


----------------------------------------------------------------------------
--

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


----------------------------------------------------------------------------
--

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


*** Confidentiality Notice: This e-mail, including any associated or 
attached files, is intended solely for the individual or entity to which it 
is addressed. This e-mail is confidential and may well also be legally 
privileged. If you have received it in error, you are on notice of its 
status. Please notify the sender immediately by reply e-mail and then 
delete this message from your system. Please do not copy it or use it for 
any purposes, or disclose its contents to any other person. This email 
comes from a division of the Invensys Group, owned by Invensys plc, which 
is a company registered in England and Wales with its registered office at 
3rd Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). 
For a list of European legal entities within the Invensys Group, please go 
to http://www.invensys.com/en/legal/default.aspx.


You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail 
recept...@invensys.com. This e-mail and any attachments thereto may be 
subject to the terms of any agreements between Invensys (and/or its 
subsidiaries and affiliates) and the recipient (and/or its subsidiaries and 
affiliates).


----------------------------------------------------------------------------
--

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


------------------------------------------------------------------------------
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

Reply via email to