[wix-users] Burn: How to detect ProductCode of current (or any other) package in the bundle?

Phill Hogland phill.hogland at rimage.com
Tue Apr 12 05:38:43 PDT 2016


BootstrapperApplicationData.xml is generated as part of the build process when a 'setup' (bootstrapper) project is compiled and is embedded into the bundle.exe.  (At build time, for build troubleshooting, you can find these file in your intermediate "obj\$(Configuration)" folder (by default) IF in your project properties you enable Build\'Do not delete temporary file' check box.)  

At run time on a target PC, you can launch your bundle.exe, and while it is running go to your %temp% folder.  Look at the most recent folder created with some GUID name, and then in the sub folder.  For wix 3.10.2 or later look for a folder named .ba (or .ba#) and you will find the files related to your bundle extracted, including BootstrapperApplicationData.xml.

Generally BootstrapperApplicationData.xml is a 'hidden' implementation detail of a bundle which you don't need to know about, but it does contain interesting details and you can add to those details at compile time to pass data to you BA.

You can add data to the BootstrapperApplicationData.xml by using the CustomTable/@BootstrapperApplicatinData='yes' attribute.
 
This post might help fro reading the xml file:   
http://stackoverflow.com/questions/12846421/getting-display-name-from-packageid
 

________________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Magi, Sampattakumar S <Sampattakumar.Magi at in.unisys.com>
Sent: Tuesday, April 12, 2016 5:03 AM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] Burn: How to detect ProductCode of current (or any other) package in the bundle?

Have a look at "BootstrapperApplicationData.xml" in the %temp% location. I think, u may just have to parse the xml.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Reuss, Matthias
Sent: Tuesday, April 12, 2016 1:15 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] Burn: How to detect ProductCode of current (or any other) package in the bundle?

Hi,

how can I retrieve the ProductCode of a certain MsiPackage in the bundle?

I need to get one of the ProductCodes at uninstallation time in order to check whether a certain component is registered with that product.

I know that Burn has to read the ProductCodes (i.e. to detect upgrades), but I have not found a way where it exposes them to the CustomBA (most straightforward place would be in the EventArgs).

As I need this data on uninstall, I cannot simply query the bundled package. So I need to resort to some less straightforward way, such as

Enumerate all installed products and search for the product name
Use ComponentInstallation.ClientProducts, as the component code I am looking for is known (probably the easiest way)

Or does Burn provide the Product Codes somewhere?

Best regards

Matthias Reuss

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list