0

I am working on a WixSharp windows forms application that lets the user choose an install directory and install some files at that location. Right now I don't know how to pass the installation directory path (stored as a string) selected by the user in the form to the "wix side of things" so that the files would go to the desired location. My project is based on the ("Samples\Custom_UI\EmbeddedUI"), if you are familiar with the files.

Mihai
  • 307
  • 2
  • 6
  • 14

1 Answers1

0

have you tied adding a property to your project for INSTALLDIR like:

            new Project("App101",
                new Property("INSTALLDIR", "C:\App101"),
                new Dir(new Id("INSTALLDIR"), new Files( ....

then in your class that calls 'StartInstall', have a property 'DestinationFolder' that is bound to the UI, then you StartInstall command will look like:

base.StartInstall($"CUSTOM_UI=true ADDLOCAL=FeatureA,FeatureB INSTALLDIR=\"{DestinationFolder}\"");

which passes the UI DestinationFolder to the MSI as a property.

Ron
  • 71
  • 2
  • 6