[wix-users] why does 64 bit bundle install key/value pairs under the 32 bit HKLM/Software/Win6432Node registry key?

Edwin Castro egcastr at gmail.com
Wed Oct 12 13:22:07 PDT 2016


Something that hasn't been explicitly mentioned is why burn is a
32-bit process to begin with.

The purpose of burn is to provide a single entry point to install
32-bit and/or 64-bit packages. Since you can't install 64-bit packages
or run 64-bit executables on 32-bit windows, then burn certainly needs
to be a 32-bit process on 32-bit windows. IF you could have both
32-bit burn and 64-bit burn, then you'd have two entry points rather
than a single one. If you have multiple packages to install, then burn
could still be helpful but if all burn was doing is giving you a
mechanism to install a 32-bit MSI OR 64-bit MSI based on the target
OS, then having both 32-bit and 64-bit burn would simply add more
complexity for very little value add. In that case, you'd be better
off just distributing the 32-bit MSI or the 64-bit MSI directly once
you know which burn you're going to deliver.


> > The question is,
> > how does the 64 bit version of my application know whether it was installed
> > using the WIX based MSI installer or the WIX based SETUP installer?

The registry API allows me to say that I always want to read the
32-bit hive regardless of whether I'm a 32-bit or 64-bit process.

See https://msdn.microsoft.com/en-us/library/windows/desktop/aa384129.aspx

If your application is .NET, then you could use
RegistryKey.OpenBaseKey if you're on .NET 4

See https://msdn.microsoft.com/en-us/library/microsoft.win32.registrykey.openbasekey.aspx

If you're on earlier versions of .NET then, you'd have to use pinvoke
to call the C API directly.

--
Edwin G. Castro

On Wed, Oct 12, 2016 at 12:35 PM, Hoover, Jacob
<Jacob.Hoover at greenheck.com> wrote:
> 32 bit processes write to 32 bit keys.... It would be smell if burn registered elsewhere.
>
> Your app shouldn't need to look in the registry for the bundle info, but if it does it should use the existing logic inside of dutil in Butil.cpp.  If your process is a 64 bit process, this code would have to be tweaked to only access the 32 bit locations.  I still don't see a reason as to why your application would need to know about the UninstallString, but with a given bundle upgrade code you can find this (BundleEnumRelatedBundle->BundleGetBundleInfo).
>
> Note, only the bundle registration is done in 32 bit land, if your bundle installs 64 bit MSI's then they register into the 64 bit location. If there is a configuration option your BA collects, then one would think you would pass it to your application installer via a MSIProperty, and then your MSI puts it in the registry where it sees fit.  Using that pattern, then your application doesn't need to care about a bundled install vs a bare install, as the location will be the same for both.
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Ian Bell
> Sent: Wednesday, October 12, 2016 2:02 PM
> To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] why does 64 bit bundle install key/value pairs under the 32 bit HKLM/Software/Win6432Node registry key?
>
> Burn only writes to the 32 bit registry?   OUCH - the 'code-smell' is
> already detectable.   JJJ
>
>
>
> The WIX based MSI installer adds configuration information to 32 bit or 64 bit registry keys depending on which soluction platform (i.e. 32 bit or 64
> bit) of the WIX base MSI project is built in VS2015.   So far, so good.
> Now, you have just confirmed the same is not true for WIX based SETUP (i.e.
> bundle) installers - these installers only add configuration information to
> 32 bit registry keys.  Here is the problem.  My app needs to know where to find configuration information added to the registry by WIX based MSI and
> SETUP installers (e.g. the 'UninstallString'  key/value pair).   If the 64
> bit version of my application was installed using the WIX based MSI installer then my application needs to look for the installer added information in the 64 bit registry keys (this is the expected location).
> On the other hand, if the 64 bit version of my application was installed using the WIX based SETUP installer then my application needs to look for the installer added information in the 32 bit registry keys (this is the
> unexpected location and where the 'code-smell' begins).   The question is,
> how does the 64 bit version of my application know whether it was installed
> using the WIX based MSI installer or the WIX based SETUP installer?   There
> are several hacks that come to mind such as writing a custom installer that adds this extra information to the registry (i.e. was the application installed using an MSI or a SETUP installer) and rewriting the source code
> to accommodate this hack, hence the 'code-smell'.   Oh well, I'll just have
> to decide which of these hacks is the lesser evil and get on with it.
>
>
>
> Anyways, thanks you for responding so quickly.   Now I can start to grapple
> with the next WIX based SETUP hiccup. J
>
>
>
> Cheers,
>
>
>
> Ian
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Bob Arnson
> Sent: 12-Oct-16 13:22
> To: WiX Toolset Users Mailing List
> Subject: Re: [wix-users] why does 64 bit bundle install key/value pairs under the 32 bit HKLM/Software/Win6432Node registry key?
>
>
>
> Yes. Burn is currently 32-bit.
>
>
>
> -----Original Message-----
>
> From: wix-users [ <mailto:wix-users-bounces at lists.wixtoolset.org>
> mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Ian Bell
>
> Sent: Wednesday, 12 October, 2016 12:59
>
> To:  <mailto:wix-users at lists.wixtoolset.org> wix-users at lists.wixtoolset.org
>
> Subject: [wix-users] why does 64 bit bundle install key/value pairs under the 32 bit HKLM/Software/Win6432Node registry key?
>
>
>
> The 32 bit version of my WIX setup bundle adds key/value pairs under the 32 bit HKLM/Software/Win6432Node/Microsoft/Windows/CurrentVersion/Uninstall
>
> registry key.    Examples of the keys added to the registry are
>
> BundleCachePath, BundleVersion, QuietUninstallString and UninstallString.
>
> Now, I found the 64 bit version of my WIX setup bundle also adds key/value pairs under the 32 bit HKLM/Software/Win6432Node/Microsoft/Windows/CurrentVersion/Uninstall
>
> registry key and this is not where I expected to find the 64 bit key/value
>
> pairs.   Instead, I expected the 64 bit version of my WIX setup bundle to
>
> install under  these key/value pairs under the 64 bit registry key
>
> HKLM/Software/Microsoft/Windows/CurrentVersion/Uninstall.   My application
>
> needs to know where the key/value pairs installed by my WIX bundle are
>
> located in the registry.    Is it normal for the 64 bit version of the setup
>
> bundle to add these key/value pairs to the 32 bit version of the registry key?
>
>
>
>
>
> Thanks,
>
>
>
>
>
> Ian
>
>
>
>
>
>
>
> ____________________________________________________________________
>
> WiX Toolset Users Mailing List provided by FireGiant <http://www.firegiant.com/> http://www.firegiant.com/
>
>
>
> ____________________________________________________________________
>
> WiX Toolset Users Mailing List provided by FireGiant <http://www.firegiant.com/> 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