Hi and welcome to our forums.
First, you need to create a search for the previous registry value as exampled in the image below.
Registry Search.png
Secondly, you need to add a "Set installer property" custom action that sets the search property to a default value if it is empty ( NOT RESULT ...
FOLLOW US
Get the latest news in Application Packaging