Browse Source

Fixed SD2-1349 - WiX setup files editor shows misleading error when unable to find any TARGETDIR Directory or DirectoryRef elements.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3567 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
567c4e9e48
  1. BIN
      data/resources/StringResources.es-mx.resources
  2. BIN
      data/resources/StringResources.es.resources
  3. BIN
      data/resources/StringResources.nl.resources
  4. 5
      src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixPackageFilesControl.cs
  5. 6
      src/AddIns/BackendBindings/WixBinding/Project/Src/IWixPackageFilesView.cs
  6. 2
      src/AddIns/BackendBindings/WixBinding/Project/Src/WixPackageFilesEditor.cs
  7. 60
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoRootDirectoryFoundTestFixture.cs
  8. 4
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoWixProductFileTestFixture.cs
  9. 12
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockWixPackageFilesView.cs
  10. 1
      src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj
  11. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

5
src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixPackageFilesControl.cs

@ -184,6 +184,11 @@ namespace ICSharpCode.WixBinding @@ -184,6 +184,11 @@ namespace ICSharpCode.WixBinding
}
}
public void ShowNoRootDirectoryFoundMessage()
{
ShowErrorMessage(StringParser.Parse("${res:ICSharpCode.WixBinding.PackageFilesView.NoRootDirectoryFoundMessage}"));
}
public void ShowNoSourceFileFoundMessage(string projectName)
{
ShowErrorMessage(String.Format(StringParser.Parse("${res:ICSharpCode.WixBinding.PackageFilesView.NoWixFileFoundInProjectMessage}"), projectName));

6
src/AddIns/BackendBindings/WixBinding/Project/Src/IWixPackageFilesView.cs

@ -29,6 +29,12 @@ namespace ICSharpCode.WixBinding @@ -29,6 +29,12 @@ namespace ICSharpCode.WixBinding
/// files could not be read because they contain errors.
/// </summary>
void ShowSourceFilesContainErrorsMessage();
/// <summary>
/// Displays a message indicating that no //w:Product/w:Directory[@Id="TARGETDIR"] or
/// //w:DirectoryRef[@Id="TARGETDIR"] element could be found.
/// </summary>
void ShowNoRootDirectoryFoundMessage();
/// <summary>
/// Adds the directories that will be displayed. Each directory may contain its

2
src/AddIns/BackendBindings/WixBinding/Project/Src/WixPackageFilesEditor.cs

@ -81,7 +81,7 @@ namespace ICSharpCode.WixBinding @@ -81,7 +81,7 @@ namespace ICSharpCode.WixBinding
if (errors) {
view.ShowSourceFilesContainErrorsMessage();
} else if (document == null) {
view.ShowNoSourceFileFoundMessage(project.Name);
view.ShowNoRootDirectoryFoundMessage();
} else {
SelectedElementChanged();
}

60
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoRootDirectoryFoundTestFixture.cs

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using System;
using System.IO;
using WixBinding.Tests.Utils;
namespace WixBinding.Tests.PackageFiles
{
/// <summary>
/// Tests that the package editor will display an error message indicating that no target directory
/// could be found the WiX files. Previously the editor would display an error message that
/// there were no WiX files - SD2-1349.
/// </summary>
[TestFixture]
public class NoRootDirectoryFoundFixture : PackageFilesTestFixtureBase
{
[TestFixtureSetUp]
public void SetUpFixture()
{
base.InitFixture();
}
[Test]
public void NoSourceFileFoundErrorNotShown()
{
Assert.IsFalse(view.IsNoSourceFileFoundMessageDisplayed);
}
[Test]
public void NoRootDirectoryFoundMessageIsShown()
{
Assert.IsTrue(view.IsNoRootDirectoryFoundMessageDisplayed);
}
/// <summary>
/// Deliberately use WiX 2.0's namespace so the test fixture will not find any
/// target directory element.
/// </summary>
protected override string GetWixXml()
{
return "<Wix xmlns=\"http://schemas.microsoft.com/wix/2003/1/wi\">\r\n" +
"\t<Product Name=\"MySetup\" \r\n" +
"\t Manufacturer=\"\" \r\n" +
"\t Id=\"F4A71A3A-C271-4BE8-B72C-F47CC956B3AA\" \r\n" +
"\t Language=\"1033\" \r\n" +
"\t Version=\"1.0.0.0\">\r\n" +
"\t\t<Package Id=\"6B8BE64F-3768-49CA-8BC2-86A76424DFE9\"/>\r\n" +
"\t</Product>\r\n" +
"</Wix>";
}
}
}

4
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoWixProductFileTestFixture.cs

@ -34,9 +34,9 @@ namespace WixBinding.Tests.PackageFiles @@ -34,9 +34,9 @@ namespace WixBinding.Tests.PackageFiles
}
[Test]
public void NoSourceFileFound()
public void NoRootDirectoryFound()
{
Assert.IsTrue(view.IsNoSourceFileFoundMessageDisplayed);
Assert.IsTrue(view.IsNoRootDirectoryFoundMessageDisplayed);
}
protected override string GetWixXml()

12
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockWixPackageFilesView.cs

@ -19,6 +19,7 @@ namespace WixBinding.Tests.Utils @@ -19,6 +19,7 @@ namespace WixBinding.Tests.Utils
bool noSourceFileFoundMessageDisplayed;
bool sourceFilesContainErrorsMessageDisplayed;
bool noDifferencesFoundMessageDisplayed;
bool noRootDirectoryFoundMessageDisplayed;
string projectName;
WixDirectoryElement rootDirectory;
bool selectedItemAccessed;
@ -37,6 +38,11 @@ namespace WixBinding.Tests.Utils @@ -37,6 +38,11 @@ namespace WixBinding.Tests.Utils
{
}
public void ShowNoRootDirectoryFoundMessage()
{
noRootDirectoryFoundMessageDisplayed = true;
}
public void ShowNoSourceFileFoundMessage(string projectName)
{
noSourceFileFoundMessageDisplayed = true;
@ -198,6 +204,12 @@ namespace WixBinding.Tests.Utils @@ -198,6 +204,12 @@ namespace WixBinding.Tests.Utils
return noDifferencesFoundMessageDisplayed;
}
}
public bool IsNoRootDirectoryFoundMessageDisplayed {
get {
return noRootDirectoryFoundMessageDisplayed;
}
}
public WixPackageFilesDiffResult[] DiffResults {
get {

1
src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj

@ -57,6 +57,7 @@ @@ -57,6 +57,7 @@
<Compile Include="Gui\WixFileTreeNodeTestFixture.cs" />
<Compile Include="Gui\WixProjectWithWixExtensionItemsTestFixture.cs" />
<Compile Include="PackageFiles\AddFilesToDirectoryTestFixture.cs" />
<Compile Include="PackageFiles\NoRootDirectoryFoundTestFixture.cs" />
<Compile Include="Project\AddWixExtensionTestFixture.cs" />
<Compile Include="Project\AddWixLibraryTestFixture.cs" />
<Compile Include="Gui\AddWixProjectNodeTestFixture.cs" />

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save