How can I add attributes to a Dir?

Aug 4, 2015 at 10:12 PM
I've run into a scenario where I need to add some custom attributes to some of my Dir objects. I looked over the Custom Attributes sample, and I've come up with this code:
Dir someDir = new Dir(@"path\to\dir", new Files(@"path\to\files"));

someDir.Attributes = new Attributes() { { "DiskId", "2"} };
//or
someDir.AttributesDefinition = "DiskId=2";
The trouble is when I run Complier.BuildWxs(), the attributes I add are not reflected in the generated .wxs file. Due to some debugging, I know the attribute does exist in my Project object, but I'm a little unclear as to why it isn't shown in the wxs after compilation. How can I add these attributes so they show up properly?
Aug 5, 2015 at 2:53 AM
It is a defect. I have logged it Issue#55

The fix (Changeset#850675c7726b) is committed and will be available with the next release. Though you can start using it right away if you download the binaries from Git.
Aug 5, 2015 at 9:48 PM
Ok, thank you. Would this bug effect the adding of environment variables as well? I'm attempting the following with similar results:
project.AddEnvironmentVariabl(new EnvironmentVariable("someVar", "Some value");
Aug 6, 2015 at 4:49 AM
Could you elaborate?
project.AddEnvironmentVariabl(new EnvironmentVariable("someVar", "Some value") {  AttributesDefinition = "DiskId=2" });
produces
<Environment Id="someVar" Name="someVar" Action="set" Value="Some value" DiskId="2" />
Aug 6, 2015 at 2:17 PM
Well, it turns out that this works completely fine. Apparently, the command prompt doesn't dynamically update environment variables. I didn't realize that yesterday, and it tripped me up. My bad.