Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: Getting/Setting INSTALLDIR from WPF external UI

$
0
0
I'll answer my own question, though this is not a satisfying answer.

As part of this class:

public class ProductSetup : GenericSetup
{
// ... add the following
    string installDirectory;

    public string InstallDirectory
    {
        get { return installDirectory; }
        set
        {
            installDirectory = value;
            OnPropertyChanged("InstallDirectory");
        }
    }
// ... modify this as shown
    public void StartInstall()
    {
        string param = string.Format("CUSTOM_UI=true INSTALLDIR=\"{0}\"", InstallDirectory);

        base.StartInstall(param);
    }
Then modify MainWindow.xaml and add a binding to some input mechanism for InstallDirectory. Set InstallDirectory to something like:

InsatallDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "xxxProductDir"

during initialization.

What I was hoping for was a way to extract the "INSTALLDIR" details that are embedded in the MSI when it is built. Having the ability to extract this information would be more correct since everything is being driven by the setup project rather than duplication of some details in another layer. I haven't dug deeply enough to find out what would be involved in supporting the ability to extract the INSTALLDIR value, but it looks like this is doable.

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>