I had a quick reread and the MSDN docs do seem somewhat contradictory. + is
Wix's "create"

"+      The key is to be created, if absent, when the component is installed.
*       The key is to be created, if absent, when the component is installed.
Additionally, the key is to be deleted, if present, with all of its values
and subkeys, when the component is uninstalled." 

By implication + doesn't remove it on uninstall. That matches observed
behaviour but doesn't quite match up with a later paragraph:

"Note that the installer removes a registry key after removing the last value
or subkey under the key. To prevent an empty registry key from being removed
when uninstalling, write a dummy value under the key you need to keep and
enter + in the Name column."

The Wix docs say:
"create
Creates the key, if absent, when the parent component is installed."
which is right.

So it would seem it's expected according to the Wix docs and the MSDN is
confusing.

-----Original Message-----
From: Mark E. Scott Jr. [mailto:msc...@scott-usa.com] 
Sent: 15 December 2011 19:56
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Removing Registry Keys Revisited

Thanks, but I actually had been reading that post before making mine.

The problem I have seems to occur when you add an empty key, that it does not
follow those rules.  In the case of an empty key, the "create" action is not
removing the key on uninstall, even if there were no subkeys or values added.

Other than this case, it seems to function exactly as Daniel wrote.


Mark E. Scott Jr.
msc...@scott-usa.com



-----Original Message-----
From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] 
Sent: Thursday, December 15, 2011 3:54 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Removing Registry Keys Revisited

Daniel wrote a nice summary here
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Removing-Regist
ry-Value-tp6557782p6562164.html

-----Original Message-----
From: Mark E. Scott Jr. [mailto:msc...@scott-usa.com]
Sent: 14 December 2011 18:48
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Removing Registry Keys Revisited

Is my understanding of the RegistryKey's action parameters incorrect?

Recently, we moved from having the keys with the Action parameter set to
'createAndRemoveOnUninstall', to 'create'.  We were clobbering keys between
applications with this setting.  When rereading the documentation, it is
unclear to me if it is going to also remove the key value even if another
application placed one correctly through Windows Installer.

Regardless, we started having orphaned registry keys on the system after
making this change.  And after reviewing them, they all  were Registry keys
that did not yet have any children.

For instance, we had '<RegistryKey Key="ActiveTasks" Action="create" />'.
This key needed to be present for an application to function, and after the
service has been configured, it will place some registry values.  However, I
have noticed that having this statement, Windows Installer leaves the key,
even if our application has not yet placed any values.  I would have expected
Windows Installer to remove it based on documentation.

However, other places in our code do not exhibit this behavior, but all the
rest of the locations specifically call out a RegistryValue child for them,
as in:
<RegistryKey Root="HKLM" Key="MyParentKey" Action="create">
  <RegistryValue Name="MyValue" Type="string" Value="test" KeyPath="yes" />
</RegistryKey>


After uninstalling, the above key was successfully removed, while the
ActiveTasks key remained, with no attached registry values.

Setting the Action to 'createAndRemoveOnUninstall' on the first registry key
does correctly remove the whole key, but it certainly seems that it shouldn't
be a requirement.  Our intention is to specifically begin calling out
registry values that should be removed in the future, but we aren't there
yet, but at that time it will be a moot point I think.

So, to summarize my question, is it expected behavior that if I declare a
RegistryKey, with the Action set to Create, with no children, and my
application does not create children or values, that Windows Installer will
not remove the key on full product uninstall (WiX 3.5)?

Thanks!

Mark E. Scott Jr.
msc...@scott-usa.com<mailto:msc...@scott-usa.com>


-----------------------------------------------------------------------------
-
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
SDL PLC confidential, all rights reserved.
If you are not the intended recipient of this mail SDL requests and requires
that you delete it without acting upon or copying any of its contents, and we
further request that you advise us.
SDL PLC is a public limited company registered in England and Wales.
Registered number: 02675207.
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6
7DY, UK.


-----------------------------------------------------------------------------
-
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity while improving
strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-----------------------------------------------------------------------------
-
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to