Hello, i have a setup like this
project.Dirs = new Dir
Dirs = new Dir
new Dir("ServidorADMINET_X", this.ObtenerArchivos("ServidorADMINET") ),
new Dir("ConsolaADMINET_X", this.ObtenerArchivos("ConsolaADMINET") ),
new Dir("ConsolaCopiaADMINIS_X", this.ObtenerArchivos("ConsolaCopiaADMINIS") )
ADMINET is the main dir, but has no files in it, only subfolders. I set the UI to InstallDir so the user can change this folder.
project.UI = WUI.WixUI_InstallDir;
But this, emits a wxs with the property:
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR.ServidorADMINET_X" />
So when I execute the msi, the default folder is C:\ADMINET\ServidorADMINET_X
I found a workaround, by modifying the resulting xml like this:
Compiler.WixSourceGenerated += document =>
var product = document.Root.Select( "Product" );
var prop = ( from el in product.Elements()
where el.Name.LocalName == "Property" && (string) el.Attribute( "Id" ) == "WIXUI_INSTALLDIR"
select el ).FirstOrDefault();
if ( prop != null )
prop.SetAttributeValue( "Value", "INSTALLDIR" );
I've seen in the wixsharp code that there is a method that defines this WIXUI_INSTALLDIR as the first Dir which has some File or Shorcut elements in it. I would be nice to override this behaviour by setting some kind of property.