34

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

1
  • And now the question itself is no more Jun 8, 2017 at 13:11

1 Answer 1

43

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.

4
  • 4
    The # symbol referes to file keys. Without the # refers to a property and all directories become properties. Feb 17, 2011 at 13:36
  • 1
    See "Formatted (Windows)" msdn.microsoft.com/en-us/library/aa368609(v=vs.85).aspx Feb 17, 2011 at 13:58
  • Thanks! I tried to find how to do this but it seems the wix documentation is not that great.. (I think).
    – Max
    Feb 17, 2011 at 14:08
  • 1
    I get a warning with this: "Warning: The 'WIXUI_INSTALLDIR' Property contains '[INSTALLLOCATION]' in its value which is an illegal reference to another property. If this value is a string literal, not a property reference, please ignore this warning. To set a property with the value of another property, use a CustomAction with Property and Value attributes." stackoverflow.com/a/7180242/1061602 Mar 7, 2014 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.