diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs index 02b132f7f6..f524adba3f 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; +using System.Diagnostics; using System.IO; using ICSharpCode.SharpDevelop.Dom; @@ -60,7 +61,7 @@ namespace ICSharpCode.WixBinding base.Start(false); // debugging not supported } - public override System.Diagnostics.ProcessStartInfo CreateStartInfo() + public override ProcessStartInfo CreateStartInfo() { switch (StartAction) { case StartAction.Project: @@ -109,12 +110,21 @@ namespace ICSharpCode.WixBinding /// public string GetInstallerFullPath() { - string outputPath = GetEvaluatedProperty("OutputPath") ?? String.Empty; - string outputType = GetEvaluatedProperty("OutputType") ?? String.Empty; - string outputName = GetEvaluatedProperty("OutputName") ?? String.Empty; + string outputPath = GetEvaluatedPropertyOrEmptyString("OutputPath"); + string outputType = GetEvaluatedPropertyOrEmptyString("OutputType"); + string outputName = GetEvaluatedPropertyOrEmptyString("OutputName"); string fileName = String.Concat(outputName, GetInstallerExtension(outputType)); return Path.Combine(Directory, outputPath, fileName); } + + string GetEvaluatedPropertyOrEmptyString(string propertyName) + { + return GetEvaluatedProperty(propertyName) ?? String.Empty; + } + + public override string OutputAssemblyFullPath { + get { return GetInstallerFullPath(); } + } /// /// Adds a set of Wix libraries (.wixlib) to the project. @@ -177,7 +187,7 @@ namespace ICSharpCode.WixBinding /// public string GetPreprocessorVariableValue(string name) { - string constants = GetEvaluatedProperty("DefineConstants") ?? String.Empty; + string constants = GetEvaluatedProperty("DefineConstants"); NameValuePairCollection nameValuePairs = new NameValuePairCollection(constants); return WixPropertyParser.Parse(nameValuePairs.GetValue(name), this); } @@ -214,7 +224,7 @@ namespace ICSharpCode.WixBinding /// AssemblyName must be implemented correctly - used when renaming projects. /// public override string AssemblyName { - get { return GetEvaluatedProperty("OutputName") ?? Name; } + get { return GetEvaluatedProperty("OutputName"); } set { SetProperty("OutputName", value); } } diff --git a/src/AddIns/BackendBindings/WixBinding/Test/Project/WixProjectTests.cs b/src/AddIns/BackendBindings/WixBinding/Test/Project/WixProjectTests.cs new file mode 100644 index 0000000000..cdf758e2ea --- /dev/null +++ b/src/AddIns/BackendBindings/WixBinding/Test/Project/WixProjectTests.cs @@ -0,0 +1,37 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using ICSharpCode.WixBinding; +using NUnit.Framework; +using WixBinding.Tests.Utils; + +namespace WixBinding.Tests.Project +{ + [TestFixture] + public class WixProjectTests + { + WixProject project; + + void CreateProject() + { + project = WixBindingTestsHelper.CreateEmptyWixProject(); + } + + [Test] + public void OutputAssemblyFullPath_ProjectOutputTypeIsPackage_FileExtensionIsMsi() + { + CreateProject(); + project.FileName = @"d:\projects\MySetup\MySetup.wixproj"; + project.AssemblyName = "MySetup"; + project.SetProperty("OutputPath", @"bin\debug"); + project.SetProperty("OutputType", "Package"); + + string assemblyFullPath = project.OutputAssemblyFullPath; + + string expectedAssemblyFullPath = @"d:\projects\MySetup\bin\debug\MySetup.msi"; + + Assert.AreEqual(expectedAssemblyFullPath, assemblyFullPath); + } + } +} diff --git a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj index c3ae0f9c80..5d2b677729 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj @@ -107,6 +107,7 @@ +