I have the following code in my HyperlinkLargeTheme.xml:
<Editbox Name="InstallDir" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes">[InstallDir]</Editbox>
<Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3">Browse</Button>
Here is the code how bootstrapper is used in C#:
var bootstrapper =
new Bundle(ProductInformation.ProductName, netPckg, cppRedistributables, erlangPackage, rabbitMqPackage, sdkPackage, webPackage)
{
OutFileName = ProductInformation.ProductName,
Manufacturer = ProductInformation.Manufacturer,
Version = new Version(ProductInformation.Version),
UpgradeCode = new Guid(ProductInformation.UpgradeCodeBundle),
StringVariablesDefinition = @"InstallDir=[ProgramFilesFolder][WixBundleManufacturer];ServerIp=127.0.0.1;ServerPort=12543;DbConnStr=;WebSitePort=80"
};
bootstrapper.DisableModify = "yes";
bootstrapper.IncludeWixExtension(WixExtension.Util);
bootstrapper.Application.LogoFile = @"Images\WizardSmallImageFile.bmp";
bootstrapper.Application.Attributes.Add("ThemeFile", @"Theme\HyperlinkLargeTheme.xml");
bootstrapper.Application.LocalizationFile = @"Theme\HyperlinkTheme.wxl";
bootstrapper.WixSourceGenerated += Bootstrapper_WixSourceGenerated;
bootstrapper.IconFile = ProductInformation.IconFile;
bootstrapper.OutFileName = ProductInformation.ProductName + " " + ProductInformation.Version;
bootstrapper.OutDir = AppDomain.CurrentDomain.BaseDirectory;
bootstrapper.PreserveTempFiles = true;
var productMsi = bootstrapper.Build();
The content of the editbox is then used by the installer to put files in the right destination. However when browsing for folder using the BrowseButton the content of the editbox is not changed. If I chenge the name attribute of the Editbox to "FolderEditbox" the browse button works as expexted, but then the files get installed to the default install directory regardless of the content of the editbox. How can I accomplish both browsing with button and installing to the selected directory?