We have an installer created using WIX. As part of this install we would like to show the currently selected installation path. I thought this would be much easier than it is, apparently. I have tried using the a public property “INSTALLDIR” (I know we’re not using Installshield, this value is a directory ID.)
<Directory Id="INSTALLDIR" Name="AcmeInc">
I can also see where INSTALLDIR gets set when running the install
MSI(EC:6C) Dir (target): Key: INSTALLDIR , Object: C:\Program Files\AcmeInc\
but when I try to show this on the UI using a Text attribute I get “...\.” which doesn’t even look to be a relative path.
I know there has got to be something simple I’m missing here.
Assuming you’re using WiX 3.5 and the
MajorUpgradeelement – the following should work (I usually useAPPLICATIONFOLDERinstead ofINSTALLDIR– but they should be interchangeable).First, let’s set
ARPINSTALLOCATIONas described on http://robmensching.com/blog/posts/2011/1/14/ARPINSTALLLOCATION-and-how-to-set-it-with-the-WiX-toolsetNow lets set the selected installation folder to the previous installation folder, if one previously existed that is.
And during the UI sequence, we want this value to be set ‘early’