[wix-users] modify registry value string on install but do not remove registry value on uninstall

Edwin Castro egcastr at gmail.com
Fri Sep 18 15:09:12 PDT 2020


You'll need a custom action.

I would be suspicious of Permanent Components. Sometimes they're The Right
Thing(tm) to do but they leave orphaned metadata behind so you want to
minimize its use.

I would recommend against using Components to update any resource your
installer does not own precisely because removing the Component will remove
the resource (whatever that means for the resource) and is almost never
what you want.

This case suggests a custom action that updates the registry value if the
substring is not present for installs and a custom action that removes the
substring from the registry value if present for uninstalls. You should be
able to use those custom actions for rollback scenarios as well. Don't
forget rollback.

--
Edwin G. Castro



On Fri, Sep 18, 2020 at 1:15 PM Wesley Manning via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Hi,
>
> My installer is modifying an existing registry value that is not created
> by my installer. It is of type REG_SZ containing a semicolon delimited list
> of paths. ("path1;path2").  My MSI on install adds the substring "path3" so
> that it's now "path1;path2;path3".  To do this I'm using a RegisteryValue
> element in a component marked Permanent.
>
> Now I have a new requirement to check if the substring "path3" exists on
> every install and if it does not exist add it again. Permanent will prevent
> it from being checked again and if I use RegisteryValue without permanent I
> believe it removes the registry value on uninstall which I don't want.
>
> Is there anyway of doing this other than a custom action?
>
> Wes
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list