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/default.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

Reply via email to