After you install a MSI built by a Visual Studio setup project or WiX, you would expect that the registry would hold the path to which you installed your MSI.
The place in the registry to look is: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ProductCode}
where ProductCode is the GUID specified in your setup project.
However the key InstallLocation is always empty. This is because the MSI generated doesn’t contain a value for the ARPINSTALLLOCATION property (see http://msdn.microsoft.com/en-us/library/aa367589(VS.85).aspx).
The solution specified is to include a custom action which should set the ARPINSTALLLOCATION property to [TARGETDIR].
This article shows how to create a postbuild event to run a vbs script to update the MSI.
When you use WiX setup projects instead of Visual Studio setup projects you will need this article.