[wix-users] How to detect which version (if any) of WiX Toolset is installed on the computer?

Konstantin Erman konste at ermank.com
Mon Feb 8 07:34:01 PST 2016


Thank you! Now I have something to work with.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Wesley Manning
Sent: Monday, February 8, 2016 7:23 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] How to detect which version (if any) of WiX Toolset is installed on the computer?

Ok Konstantin, if you really insist. :)  I had this tagged from my outlook; this is from Jacob Hoover in December 2015. Also see Bob's response below it.

========================================================

Wix doesn't publish a binary for doing this directly, as there were some reservations on what if the underlying storage would change.  As long as you know which version of WiX the bundle is using, then DUtil is the way to go.  I don't think the layout has changed since burn was introduced, so for now you'd be safe.  The bigger concern is trying to be both forward and backward compatible in a dll form, to handle all versions, which currently we don't address.

I use a simple wrapper DLL on DUtil, as I have to consume this outside of C++.  For that, I have a tiny C++ DLL which does:

#include "stdafx.h"
#include "WixUtil.h"

#pragma comment(lib, "dutil.lib")

HRESULT DAPI WixBundleGetBundleInfo(
      __in LPCWSTR   szBundleId,                             // Bundle code
      __in LPCWSTR   szAttribute,                            // attribute name
      __out_ecount_opt(*pcchValueBuf) LPWSTR lpValueBuf,     // returned value, NULL if not desired
      __inout_opt                     LPDWORD pcchValueBuf   // in/out buffer character count
        )
{
    return BundleGetBundleInfo(szBundleId, szAttribute, lpValueBuf, pcchValueBuf); }

HRESULT DAPI WixBundleEnumRelatedBundle(
          __in     LPCWSTR lpUpgradeCode,
          __in     BUNDLE_INSTALL_CONTEXT context,
          __inout  PDWORD pdwStartIndex,
          __out_ecount(MAX_GUID_CHARS+1)  LPWSTR lpBundleIdBuf
            )
{
    return BundleEnumRelatedBundle(lpUpgradeCode, context, pdwStartIndex, lpBundleIdBuf); }

With the 2 wrapper methods exported via a def

LIBRARY

EXPORTS
    WixBundleGetBundleInfo
    WixBundleEnumRelatedBundle



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Bob Arnson
Sent: Tuesday, December 01, 2015 10:40 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Burn Bundle Status Query

There are functions in the DUtil library for querying installed bundles.

> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On 
> Behalf Of Colin Sim
> Sent: Sunday, 29 November, 2015 14:01
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: [wix-users] Burn Bundle Status Query
> 
> With MSIs, Windows provide various installer functions to query an MSI 
> and its status on a system, e.g. functions that start with Msi* such 
> as MsiEnumRelatedProducts, which allows us to determine whether a 
> product is installed. There are also APIs to query an MSI to extract, 
> for example, its upgrade code.
> 
> 
> 
> I would like to confirm that there are no equivalent  APIs for the WiX 
> bundle (EXEs)? That is, there is no meaningful way to determine the 
> upgrade code for a WiX bundle and the only way to check if a bundle is 
> installed is to search through the 
> HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall?
> 
> 
> This e-mail contains IPFX information which may be privileged or 
> confidential and is intended for use only by the individual(s) or 
> entity named above. If you are not the intended recipient, note that 
> disclosing, copying, distributing or using this information is 
> prohibited. If you have received this e-mail in error, please advise 
> immediately to the e-mail address above and permanently delete this 
> message and any attachments. Please note that any views or opinions 
> presented in this email are solely those of the author and do not 
> necessarily represent those of the company. We monitor our e-mail system and may record your e-mails. Thank you.
> 
> __________________________________________________________
> __________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/

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

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

=========================================================================================

Wes

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Konstantin Erman
Sent: February-08-16 10:16 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] How to detect which version (if any) of WiX Toolset is installed on the computer?

I've spent a day looking for that API and got noting! Documented or not documented, 3.x or 4.x, managed or unmanaged. I would appreciate any help with locating it.

After detecting WiX bundle I would have to do the same for Visual Studio own bundles, so I need that API dead or alive :-)

As far as I understand there is no access to mailing lists archive, so my only hope is that somebody long enough on the list would fish it out for me.

Thanks beforehand,
Konstantin
< sent from mobile device >

> On Feb 8, 2016, at 5:40 AM, Wesley Manning <wmanning at dynagen.ca> wrote:
> 
> I know there is an API in latter versions of Wix. It was discussed on this mailing list or wix-devs. Can't remember the name and don't know if it's documented to not.
> 
> Wes
> 
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On 
> Behalf Of Tobias S
> Sent: February-08-16 4:29 AM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] How to detect which version (if any) of WiX Toolset is installed on the computer?
> 
> I'd check if environment variable %wix% is present. If yes, check e.g. for fileversion of %wix%bin\candle.exe.
> 
> Other approach is traversing the ARP information in
> 
> HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersi
> on\Uninstall
> (or without wow6432Node on x86 OS)
> 
> for the GUID {65E893AD-EDD5-4E7D-80CA-F0F50F383532}. The so found key should be the WIX ARP Entry. If present check for BundleVersion.
> 
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/
> 
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/

____________________________________________________________________
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