I am setting some environment variables for IIS specifically here. If I were to set the environment variable system wide then my profiler would profile all CLR based applications on the system which is not desired.
The problem that I assume exists with createAndRemoveOnUninstall is that if the environment value already exists I need it to stay on uninstall and only remove the two strings I added to the string array. Append *should* do this and on uninstall only remove my strings, leaving their previous strings intact. Something to add that I found after emailing this list was that a conditional that I originally set on the feature is part of the problem. My Feature had a Condition on it that basically said "If IIS is not installed then set the level of this feature to 0". It would seem that installing and uninstalling with a particular GUID for the component with that conditional set is what gets that component GUID into a bad state. Once in a bad state even if I remove the conditional, it would still not remove on uninstall (I'm guessing the reference counter was already +1 with nothing installed at that point). I did find a workaround which is to remove the condition on the feature and then creating a new GUID for the components. This doesn't provide the best user experience but it is better than not cleaning up on uninstall. On Wed, Dec 12, 2012 at 9:47 PM, Rob Mensching <r...@robmensching.com> wrote: > Why do you use the Environment element? Modifying registry keys directly is > rarely the right way to do things... and when you do, often a restart is > required to get them to really work out. > > > On Wed, Dec 12, 2012 at 3:55 PM, Micah Caldwell <mi...@zoltu.net> wrote: > > > I have a RegistryValue that is added to a pre-existing key. The > > RegistryValue is in a Component in a ComponentGroup in a Feature like so: > > <ComponentGroup Id="IISRegistryComponents" Directory="TARGETDIR"> > > <Component Id="W3SVCRegistryComponent" > > Guid="{BBA19B9F-8D0C-4F31-9384-497DC0E33591}"> > > <RegistryValue Root="HKLM" > > Key="System\CurrentControlSet\Services\W3SVC" Name="Environment" > > Type="multiString" Action="append" KeyPath="yes"> > > <MultiStringValue>COR_ENABLE_PROFILING=1</MultiStringValue> > > > > > > > <MultiStringValue>COR_PROFILER={FF68FEB9-E58A-4B75-A2B8-90CE7D915A26}</MultiStringValue> > > </RegistryValue> > > </Component> > > </ComponentGroup> > > > > <Feature Id="IISRegistryFeature" Title="Instrument IIS > Applications" > > Description="Installing this will result in IIS .NET applications being > > instrumented." Display="expand" Level="1" AllowAdvertise="no" > > InstallDefault="local" Absent="allow"> > > <ComponentGroupRef Id="IISRegistryComponents"/> > > </Feature> > > > > When I install my application the Environment registry key is created if > it > > doesn't exist and my strings are added to the list of strings. When I > > uninstall my application the Environment value is not removed and the > > strings are not removed from the value. > > > > After much testing I have found that if I install with a freshly > generated > > GUID for the Component then the Environment value is removed on > uninstall. > > However, if I re-install again with the same installer and uninstall > again > > then the Environment value is not removed. > > > > I am guessing there is a bug in the reference counting that is causing > the > > uninstall to remove the value but not decrement the > > component reference count so the next time I install/uninstall the > > installer thinks the Component is still in use so it doesn't remove it. > > > > If I am doing something wrong and I just need to do it right that would > be > > ideal, if not then a fix or a workaround would be appreciated since I > need > > to get this installer out and I don't want to release an installer that > > doesn't clean-up after itself. > > > > > ------------------------------------------------------------------------------ > > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > > Remotely access PCs and mobile devices and provide instant support > > Improve your efficiency, and focus on delivering more value-add services > > Discover what IT Professionals Know. Rescue delivers > > http://p.sf.net/sfu/logmein_12329d2d > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > -- > virtually, > > Rob Mensching > http://RobMensching.com LLC > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users