Q: Uninstall results in Registry Key removal (not just Registry Key property)

Aug 18, 2015 at 1:49 AM
I wan't my installer to add the Registry Key property, but not remove it (or the Registry Key!) during an uninstall. How can I avoid this? (I'm using VS 2013 to build this).

Code is a VERY simple installer
---snip---
Project project = new Project("Personal Office Document Templates",
            new RegFile(@"Office personal template location.reg")
        );

        project.GUID = new Guid("<REMOVED>"); 
        Compiler.BuildMsi(project);
---snip---

Registry file is as follows
---snip---
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options]
"PersonalTemplates"="C:\Program Files (x86)\UNIFY Solutions\Office Document Templates"

[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\PowerPoint\Options]
"PersonalTemplates"="C:\Program Files (x86)\UNIFY Solutions\Office Document Templates"

---snip---

Help!
Coordinator
Aug 19, 2015 at 2:34 AM
Edited Aug 19, 2015 at 1:41 PM
WiX requires use of the 'Permanent' component attribute for that. You can control it either per Reg value or for all of them in a single step as follows:
project.RegValues.ForEach(r => r.AttributesDefinition = "Component:Permanent=yes");
Aug 19, 2015 at 9:07 AM
Marvelous, thank you!

Sincerely,
//Adam