Thursday, August 7, 2008

Use Windows Installer Properties When Setting Registry Key Values

Whew! That's a mouthful!

I needed to set a registry key value based on the the installation directory of the package. Turns out you can use Windows Installer properties enclosed in square brackets.
Like this...

[TARGETDIR]bob.exe

... to get at the bob.exe in its install directory. This expands to...

C:\Program Files\Bob Application\bob.exe

... in the registry during installation.

You can use properties like
  • TARGETDIR
  • ProgramFilesFolder
  • Manufacturer
  • ProductName
  • SystemFolder

No comments: