diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
index 5902e79f7e..c8be17cd9e 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
@@ -239,7 +239,7 @@ namespace ICSharpCode.WixBinding
string wixToolPath = @"$(SharpDevelopBinPath)\Tools\Wix";
AddGuardedProperty("WixToolPath", wixToolPath, false);
- AddGuardedProperty("ToolPath", "$(WixToolPath)", false);
+ SetProperty("ToolPath", "$(WixToolPath)", false);
AddGuardedProperty("WixMSBuildExtensionsPath", wixToolPath, false);
this.AddImport(DefaultTargetsFile, null);
diff --git a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
index f7876d8bd2..310a8b0434 100644
--- a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
@@ -6,10 +6,12 @@
//
using System;
+using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
+using MSBuild = Microsoft.Build.BuildEngine;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@@ -81,18 +83,39 @@ namespace WixBinding.Tests.Project
Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixToolPath"));
}
+ [Test]
+ public void WixToolPathCondition()
+ {
+ MSBuild.BuildProperty property = GetMSBuildProperty("WixToolPath");
+ Assert.AreEqual(" '$(WixToolPath)' == '' ", property.Condition);
+ }
+
[Test]
public void ToolPath()
{
Assert.AreEqual(@"$(WixToolPath)", project.GetUnevalatedProperty("ToolPath"));
}
+ [Test]
+ public void ToolPathHasNoCondition()
+ {
+ MSBuild.BuildProperty property = GetMSBuildProperty("ToolPath");
+ Assert.IsTrue(String.IsNullOrEmpty(property.Condition), "ToolPath should not have a condition: " + property.Condition);
+ }
+
[Test]
public void WixMSBuildExtensionsPath()
{
Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixMSBuildExtensionsPath"));
}
+ [Test]
+ public void WixMSBuildExtensionsPathCondition()
+ {
+ MSBuild.BuildProperty property = GetMSBuildProperty("WixMSBuildExtensionsPath");
+ Assert.AreEqual(" '$(WixMSBuildExtensionsPath)' == '' ", property.Condition);
+ }
+
[Test]
public void DebugConfiguration()
{
@@ -122,5 +145,22 @@ namespace WixBinding.Tests.Project
{
Assert.AreEqual(LanguageProperties.None, project.LanguageProperties);
}
+
+ ///
+ /// Gets the MSBuild build property with the specified name from the WixProject.
+ ///
+ MSBuild.BuildProperty GetMSBuildProperty(string name)
+ {
+ MSBuild.Project msbuildProject = project.MSBuildProject;
+ foreach (MSBuild.BuildPropertyGroup g in Linq.ToList(Linq.CastTo(msbuildProject.PropertyGroups))) {
+ if (!g.IsImported) {
+ MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, name);
+ if (property != null) {
+ return property;
+ }
+ }
+ }
+ return null;
+ }
}
}