Discussion:
[WiX-users] Possible Bug: RegDelete does not work properly with REG_KEY_32BIT on a 64-bit system
Edwin Castro
2015-07-16 04:20:21 UTC
Permalink
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
Nir Bar
2015-07-16 06:06:55 UTC
Permalink
You shuold OR it with the KEY_READ
See Registry Key Security and Access Rights
<https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878(v=vs.85).aspx>



-----
Nir Bar
Freelance Developer
Mail: ***@panel-sw.com
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
--
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-tp7600893p7600894.html
Sent from the wix-users mailing list archive at Nabble.com.
Phill Hogland
2015-07-16 14:01:55 UTC
Permalink
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.
Edwin Castro
2015-07-16 15:17:56 UTC
Permalink
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?
Post by Phill Hogland
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
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.
--
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
https://lists.sourceforge.net/lists/listinfo/wix-users
--
Edwin G. Castro
Rob Mensching
2015-07-16 15:56:03 UTC
Permalink
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:***@gmail.com]
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?
Post by Phill Hogland
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
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.
--
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
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
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Loading...