Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

egcastr
I was trying to use RegDelete from the dutil library and I noticed my
32-bit key did not get deleted on a 64-bit system. I think the problem is
the following RegOpen call

hr = RegOpen(khRoot, wzSubKey, KEY_READ, &hkKey);
if (E_FILENOTFOUND == hr)
{
    ExitFunction1(hr = S_OK);
}

Since KEY_WOW64_32KEY is not specified then RegOpen checks the 64-bit hive,
doesn't find the key, and exits RegDelete.

In other words, I think RegDelete only works with REG_KEY_DEFAULT!

--
Edwin G. Castro
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

Nir Bar
You shuold OR it with the KEY_READ
See Registry Key Security and Access Rights
Nir Bar
Freelance Developer
Mail: nir.bar@panel-sw.com
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

Phill Hogland
In reply to this post by egcastr
FYI - I just implemented a semi-custom action using a similar implementation as I found in the WixGamingExtension which calls WcaAddTempRecord on the Registry table, to allow MSI to manage my registry change.  The CA code (specifically the registry path) is agnostic to WoW6432Node so that the CA can be built for either Win32 or x64 and used in either a x86 or x64 MSI.  I only needed to set Component /@Win64="no" and MSI handles the redirection.

The MSI packages are also built using the InstallerPlatform MSBuild property to set the bitness of the MSI.  For most of the Components I never set Win64, but for this registry key setting Win64="no" was needed to get MSI to redirect the the registry hive.
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

egcastr
I can't use semi-custom-actions for this particular piece of work because I
need to call an API to get permission to create, delete, or modify these
particular registry keys. I work at a security company where they have
implemented additional security features through drivers that disallow
normal interactions with certain resources. Otherwise, I would totally use
the semi-custom-action approach. I use it right now to add rows to the
RemoveFile table depending on whether we're uninstalling for an upgrade or
not.

In any case, RegDelete appears broken to me. At a minimum, the bitness
should be incorporated into the RegOpen call. Should I file a bug to track?


On Thu, Jul 16, 2015 at 7:01 AM, Phill Hogland <[hidden email]> wrote:

> FYI - I just implemented a  semi-custom
> <http://www.joyofsetup.com/2007/07/01/semi-custom-actions/>   action
> using a
> similar implementation as I found in the WixGamingExtension which calls
> WcaAddTempRecord on the Registry table, to allow MSI to manage my registry
> change.  The CA code (specifically the registry path) is agnostic to
> WoW6432Node so that the CA can be built for either Win32 or x64 and used in
> either a x86 or x64 MSI.  I only needed to set Component /@Win64="no" and
> MSI handles the redirection.
>
> The MSI packages are also built using the InstallerPlatform MSBuild
> property
> to set the bitness of the MSI.  For most of the Components I never set
> Win64, but for this registry key setting Win64="no" was needed to get MSI
> to
> redirect the the registry hive.
>
>
>
> --
> View this message in context:
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Possible-Bug-RegDelete-does-not-work-properly-with-REG-KEY-32BIT-on-a-64-bit-system-tp7600893p7600896.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>



--
Edwin G. Castro
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

Rob Mensching-7
I think this only happens if you indicate to delete registry tree. You can definitely file the bug but this is probably one of those bugs where it won't get fixed until someone actually needs the fix. So don't file the bug expecting it to be fixed by itself. <smile/>
_______________________________________________________________
 FireGiant  |  Dedicated support for the WiX toolset  |  http://www.firegiant.com/

-----Original Message-----
From: Edwin Castro [mailto:[hidden email]]
Sent: Thursday, July 16, 2015 8:18 AM
To: General discussion about the WiX toolset.
Subject: Re: [WiX-users] Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system

I can't use semi-custom-actions for this particular piece of work because I need to call an API to get permission to create, delete, or modify these particular registry keys. I work at a security company where they have implemented additional security features through drivers that disallow normal interactions with certain resources. Otherwise, I would totally use the semi-custom-action approach. I use it right now to add rows to the RemoveFile table depending on whether we're uninstalling for an upgrade or not.

In any case, RegDelete appears broken to me. At a minimum, the bitness should be incorporated into the RegOpen call. Should I file a bug to track?


On Thu, Jul 16, 2015 at 7:01 AM, Phill Hogland <[hidden email]> wrote:

> FYI - I just implemented a  semi-custom
> <http://www.joyofsetup.com/2007/07/01/semi-custom-actions/>   action
> using a
> similar implementation as I found in the WixGamingExtension which
> calls WcaAddTempRecord on the Registry table, to allow MSI to manage
> my registry change.  The CA code (specifically the registry path) is
> agnostic to WoW6432Node so that the CA can be built for either Win32
> or x64 and used in either a x86 or x64 MSI.  I only needed to set
> Component /@Win64="no" and MSI handles the redirection.
>
> The MSI packages are also built using the InstallerPlatform MSBuild
> property to set the bitness of the MSI.  For most of the Components I
> never set Win64, but for this registry key setting Win64="no" was
> needed to get MSI to redirect the the registry hive.
>
>
>
> --
> View this message in context:
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Possible
> -Bug-RegDelete-does-not-work-properly-with-REG-KEY-32BIT-on-a-64-bit-s
> ystem-tp7600893p7600896.html Sent from the wix-users mailing list
> archive at Nabble.com.
>
>
> ----------------------------------------------------------------------
> -------- Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>



--
Edwin G. Castro
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users