Hello Mike, thank you for your answers!
The situation is the following: The version of the msi package will change but the (meanwhile by the user) customized registry settings should not be overwritten by repair/uninstall (same installer version) or by installing a newer version of the msi. In other words: Existing registry settings must not overwritten or deleted by any process... I tried to read out the existing settings by using a property: <Property Id="EXIST_DEFAULTTEMPLATE" Value="MyProgTemplates"> <RegistrySearch Id="Exist_DefaultTemplate1" Root="HKCU" Key="Software\VB and VBA Program Settings\MyProg\Settings" Name="DefaultTemplates" Type="raw"/> </Property> Then I store the property value into the registry during install: <Component Id="DefaultTemplates" Guid="555a0768-b38a-4444-3333-bbe858bb076e" DiskId="1"> <Registry Root="HKCU" Key="Software\VB and VBA Program Settings\MyProg\Settings"> <Registry Type="string" Name="DefaultTemplates" Value="[PersonalFolder][EXIST_DEFAULTTEMPLATE]"> </Registry> </Registry> </Component> That worked except one point: The "PersonalFolder" will always be replaced so that the path will be appanded on every install: "C:\Documents and Settings\Administrator\My Documents\C:\Documents and Settings\Administrator\My Documents\C:\Documents and Settings\Administrator\My Documents\MyProgTemplates" So I moved "[PersonalFolder]" to the Value attibute of the Property tag: <Property Id="EXIST_DEFAULTTEMPLATE" Value="[PersonalFolder]MyProgTemplates"> But there the [PersonalFolder] property is not replaced during install so that in the registry the following is stored: "DefaultTemplates"="[PersonalFolder]MyProgTemplates" That's why my idea does not work... Have you any ideas? Thanks Ingo -----Ursprüngliche Nachricht----- Von: Mike Dimmick [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Februar 2008 02:02 An: Beyer, Ingo; wix-users@lists.sourceforge.net Betreff: RE: [WiX-users] Prevent registry key from being removed duringuninstall? AND Only create not existing registry entrieswhile install? 1) I'm assuming by 'registry key' you mean any value/data pair. The 'key' is strictly a container for values (one of which can be the default value). If the key is empty - contains no values and the default value has no data - then Windows Installer deletes the key. To keep values even after all products installing that value have been uninstalled, mark the component which contains the value as Permanent. This will have the effect of preserving the key path and all the other resources in the component. 2) Declare all the registry values you need. Windows Installer will write all registry values in a Component if the key path for that component needs to be updated. If the key path is a file, the component will be installed if the file is missing, if the file already installed doesn't have a version number and a version number is recorded in the File table, if the file already installed hasn't been modified if no version number is recorded, or if the version in the File table is newer. For registry values, if the key or value is missing or the value data is different from the data in the package, the component is considered out-of-date and Windows Installer will install the whole component (files, registry values, etc, etc). I recommend that you treat registry values that you install as being immutable, changeable only by the next version of your installer. I believe there's a risk that user customizations could be overwritten by repairs or upgrades if installed registry values are edited. Stick to the bare minimum required to allow the components to be located - do the rest in initial program startup. -- Mike Dimmick -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Beyer, Ingo Sent: 25 February 2008 16:42 To: wix-users@lists.sourceforge.net Subject: [WiX-users] Prevent registry key from being removed duringuninstall? AND Only create not existing registry entrieswhile install? Hi all, I've two questions. I tried to solve them by myself, but I cannot find informations in the net... 1) How can I prevent a registry key from being removed during uninstall? 2) What do I have to do, that a only not existing registry entries (some REG_SZ's) will be create during install. Thanks a lot for help! Greetings Ingo ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users