Hi there,
Just before we dive in I want to let you know that you can use Wix# XML extensions for simplifying your XML manipulations. Thus your XML event can also be implemented like this:
Now about your problem. Indeed there is a logical problem with auto assigning WIXUI_INSTALLDIR. The current implementation sets it to the
Thus the proper solution would be to allow user to nominate a directory to be an InstallDir.
I have logged the issue on your behalf (https://wixsharp.codeplex.com/workitem/117).
The feature is already implemented and the binaries are available form Git. But if you have to wait until a full or a NuGet release then you will need to use your XML-based work around.
Just before we dive in I want to let you know that you can use Wix# XML extensions for simplifying your XML manipulations. Thus your XML event can also be implemented like this:
project.WixSourceGenerated += document => { document.FindAll("Property") .Where(p=>p.HasAttribute("Id", "WIXUI_INSTALLDIR")) .First() .SetAttribute("Value=INSTALLDIR"); };
GetTopLevelDir()
value, which is fine for all cases except yours. Thus the proper solution would be to allow user to nominate a directory to be an InstallDir.
I have logged the issue on your behalf (https://wixsharp.codeplex.com/workitem/117).
The feature is already implemented and the binaries are available form Git. But if you have to wait until a full or a NuGet release then you will need to use your XML-based work around.