I've been working on external UI for my installer, generated with WixSharp.
WixSharp samples library has a quite good example on how to create WPF external UI, but I don't understand, how to prompt user to change installation path of my application. Obviously, I have a Setup class, derived from GenericSetup andI can pass a parameter to my MSI file when calling base.StartInstall()
method. But how can I get installation directory ftom my MSI to show it for user in a first place?
It's actually quite simple. MSI is a database by it's nature, and we can read it. WixSharp provides neat MsiParser
class, that can read some of the properties, stored in MSI.
It can be used in such way:
var msi = new MsiParser(MsiFile);
var dir = msi.GetDirectoryPath("INSTALLDIR");
This question was originally answered by Oleg Shilo on github issue thread