I don't think you understand what KeyPaths are. Every Component has a KeyPath. WiX hides this from you most of the time by picking the first File or RegistryKey/RegistryValue in a Component & making it the KeyPath for that Component unless you explicitly tell it otherwise. See -> http://msdn.microsoft.com/en-us/library/aa368007(VS.85).aspx & http://wix.sourceforge.net/manual-wix3/wix_xsd_component.htm
As I said before you can't achieve what you want to achieve without changing the Component you pasted by modifying the HKCU RegistryValue, creating a new Component for the RegistryValue you want to save & Conditioning it appropriately. Asking the same thing in a different way isn't going to make it any more possible. Palbinder Sandher Software Deployment & IT Administrator T: +44 (0) 141 945 8500 F: +44 (0) 141 945 8501 http://www.iesve.com **Design, Simulate + Innovate with the <Virtual Environment>** Integrated Environmental Solutions Limited. Registered in Scotland No. SC151456 Registered Office - Helix Building, West Of Scotland Science Park, Glasgow G20 0SP Email Disclaimer -----Original Message----- From: Kristoffer Danielsson [mailto:kristoffer.daniels...@live.se] Sent: 11 May 2010 16:09 To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] Conditional removal of HKCU-key? Thanks for your answer. Just to clarify... This is what I want: 1) HKCU\MyApp\InstallPath should be the key path for the installed exe (and all other files too). 2) HKCU\MyApp must not be removed if HKCU\MyApp\SpecialValue is set. 3) The installation folder for the installed exe must always be removed. I understand that "createAndRemoveOnUninstall" explicitly removes the MyApp key. It cannot be used! I understand that "create" solves the above, but instead leaves the installation folder. Can't I explicitly delete the folder as the last step during uninstallation? It shouldn't conflict with "create", right? Thanks again. > Date: Mon, 10 May 2010 10:34:46 +0100 > From: pally.sand...@iesve.com > To: wix-users@lists.sourceforge.net > Subject: Re: [WiX-users] Conditional removal of HKCU-key? > > You can't in that case. Use a different RegistryValue for the KeyPath of that > directory if you need that one to persist in certain situations (try > something like <RegistryValue Name="Installed" Value="true" Type="string" > KeyPath="yes" /> ). > > Move that one to it's own Component & add the requisite Condition Element. > > Palbinder Sandher > Software Deployment & IT Administrator > T: +44 (0) 141 945 8500 > F: +44 (0) 141 945 8501 > > http://www.iesve.com > **Design, Simulate + Innovate with the <Virtual Environment>** > Integrated Environmental Solutions Limited. Registered in Scotland No. > SC151456 Registered Office - Helix Building, West Of Scotland Science > Park, Glasgow G20 0SP Email Disclaimer > > > -----Original Message----- > From: Kristoffer Danielsson [mailto:kristoffer.daniels...@live.se] > Sent: 08 May 2010 23:33 > To: wix-users@lists.sourceforge.net > Subject: Re: [WiX-users] Conditional removal of HKCU-key? > > > Actually, this does not work :( > > > > Registry is left intact, but installation folder is never removed. I > understand this has to do with the KeyPath-thingy. How do I make sure that > the folder is removed even if some HKCU-key is left untouched? > > > > <DirectoryRef Id="LocalProgramsFolder"> > > <Component Id="LocalProgramsFolderRef" Guid="YOUR_GUID"> > > <CreateFolder /> > > <RemoveFolder Id="LocalProgramsFolder" On="uninstall" /> > > <RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" > Action="create"> > > <RegistryValue Name="InstallPath" Value="[INSTALLLOCATION]" > Type="string" KeyPath="yes" /> > > </RegistryKey> > > </Component> > > </DirectoryRef> > > > > > From: kristoffer.daniels...@live.se > > To: wix-users@lists.sourceforge.net > > Date: Sat, 8 May 2010 22:42:09 +0200 > > Subject: Re: [WiX-users] Conditional removal of HKCU-key? > > > > > > Hmmm, seems this did the trick: > > > > <RegistryKey ... Action="create"> > > > > > > > > It actually removed the registry value "InstallPath", which is exactly what > > I wanted. > > > > > > > > > From: kristoffer.daniels...@live.se > > > To: wix-users@lists.sourceforge.net > > > Date: Sat, 8 May 2010 22:17:07 +0200 > > > Subject: [WiX-users] Conditional removal of HKCU-key? > > > > > > > > > Using Wix 3.5. I create the following key under HKCU: > > > > > > > > > > > > <DirectoryRef Id="LocalProgramsFolder"> <Component > > > Id="LocalProgramsFolderRef" Guid="YOUR_GUID"> <CreateFolder /> > > > <RemoveFolder Id="LocalProgramsFolder" On="uninstall" /> > > > <RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" > > > Action="createAndRemoveOnUninstall"> > > > <RegistryValue Name="InstallPath" Value="[INSTALLLOCATION]" > > > Type="string" KeyPath="yes" /> </RegistryKey> </Component> > > > </DirectoryRef> > > > > > > > > > > > > Upon uninstallation, I do NOT want to remove the key IF a certain value > > > exists: > > > > > > HKCU\Software\[Manufacturer]\[ProductName]\MyStringValue > > > > > > > > > > > > How can this be accomplished? > > > > > > > > > > > > Help is greatly appreciated! Thanks! > > > > > > _________________________________________________________________ > > > Vårfina smileys till Messenger här! > > > http://springpack.msn.se > > > ------------------------------------------------------------------ > > > -- > > > ---------- > > > > > > _______________________________________________ > > > WiX-users mailing list > > > WiX-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > _________________________________________________________________ > > Vårfina smileys till Messenger här! > > http://springpack.msn.se > > -------------------------------------------------------------------- > > -- > > -------- > > > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > _________________________________________________________________ > Hotmail i mobilen på 5 sekunder! > http://new.windowslivemobile.msn.com/SE-SE/windows-live-hotmail/defaul > t.aspx > ---------------------------------------------------------------------- > -------- > > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ---------------------------------------------------------------------- > -------- > > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users _________________________________________________________________ Vårfina smileys till Messenger här! http://springpack.msn.se ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users