Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference directory install path in registry value using Wix

I want to save the path of my application, installed with wix, in the windows registry. I tried the following:

<RegistryValue Root="HKLM" Key="Software\company\InstallLocation" Value="[#INSTALLLOCATION]" Type="string" Action="write" /> 

where INSTALLLOCATION is the Directory Id of the folder in Wix, but this doesn't work. It seems that the [#id] syntax is only for files...

I saw the following question but the blog he references seemingly is no more:

https://stackoverflow.com/questions/521825/saving-install-path-to-registry

like image 831
Max Avatar asked Feb 17 '11 13:02

Max


People also ask

What is KeyPath in Wix?

The KeyPath for a Component is a single resource that the Windows Installer uses to determine if a Component "exists" on a machine.


1 Answers

Just remove the # sign, leave only [INSTALLLOCATION] and it should work. The # symbol referes to file keys. Without the # it refers to a property and all directories become properties. See the article about Formatted data type for more details.

like image 191
Yan Sklyarenko Avatar answered Oct 15 '22 15:10

Yan Sklyarenko