I am having trouble with with my directories, I want my InstallDir to be my top parent directory and for any other Dir to be contained within this folder structure. I have tried this multiple ways and can't seem to work it out but what I am aiming for is to be able to use the installDirDialog to change the install location. The directory left unchanged installs correctly, but if i was to change the install location it only builds the new folder structure and the files install install to the default location. I know why it's installing to this location because its referencing a static string, I only used the below as an example to simplify the problem I am having.
string dirs = @"%ProgramFiles%\My Company\My Product";
var project = new ManagedProject("MyProduct",
new InstallDir(dirs),
new Dir(dirs + @"\DataAPI",
new Files(@"E:\Temp\installertemp\DataAPI\*.*")));
Another approach was to use an MSI property and set that as the install path.
public class General
{
public static string Product = "PRODUCT";
public static string InstallLocation = "INSTALLDIRECTORY";
}
In setup.cs
string dirs = General.InstallLocation;
I then set this property in the install dialog.
MsiRuntime.Session[General.InstallLocation] = installDir.Text;
This didn't work either and only passed INSTALLDIRECTORY as the path.