Skip to content

Commit

Permalink
Merge pull request #24 from heaths/develop
Browse files Browse the repository at this point in the history
Merge 'develop' to create new release
  • Loading branch information
heaths committed Sep 11, 2017
2 parents 0004190 + cc8d04e commit 7a54ee9
Show file tree
Hide file tree
Showing 143 changed files with 7,680 additions and 718 deletions.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -43,4 +43,9 @@ The Windows Installer PowerShell module is licensed under the [MIT License](LICE

## Status

[![Build status](https://ci.appveyor.com/api/projects/status/251twb4wvywq0vei/branch/master?svg=true)](https://ci.appveyor.com/project/heaths/psmsi/branch/master)
[Project build status](https://ci.appveyor.com/project/heaths/psmsi) for release and development branches.

Branch | Status
--- | ---
**master** | [![Build status](https://ci.appveyor.com/api/projects/status/251twb4wvywq0vei/branch/master?svg=true)](https://ci.appveyor.com/project/heaths/psmsi/branch/master)
**develop** | [![Build status](https://ci.appveyor.com/api/projects/status/251twb4wvywq0vei/branch/develop?svg=true)](https://ci.appveyor.com/project/heaths/psmsi/branch/develop)
16 changes: 14 additions & 2 deletions appveyor.yml
Expand Up @@ -3,9 +3,15 @@ pull_requests:
do_not_increment_build_number: true
skip_tags: true

notifications:
- provider: GitHubPullRequest
on_build_success: true
on_build_failure: true

branches:
only:
- master
- develop

cache:
- packages -> **\packages.config
Expand Down Expand Up @@ -34,7 +40,6 @@ deploy:
auth_token:
secure: 5K94QY8dHKlbjvlBpQaXwAkmDf+LQE3g5WlU9snnNMjDjf0UT4xDoOBCLWcmwZOm
artifact: installer, package
prerelease: true
on:
branch: master

Expand All @@ -44,6 +49,13 @@ deploy:
secure: 4STrzCp6wDsDBj/wCtmImMVL7wUI8DCGjdMBXGqQf9JZJ8LjmW5YSY8wtcHAv0XW
artifact: package
skip_symbols: true
prerelease: true
on:
branch: master

- provider: NuGet
server: https://nuget.smbsrc.net/
api_key:
secure: WPxjuSouwbCdM6I771BfIbOk8gA883+l9RKUCfFknaUT1vYPmTpT2ABF9r+J0JgR
artifact: /.*\.symbols\.nupkg/
on:
branch: master
3 changes: 3 additions & 0 deletions inc/Common.csproj.targets
Expand Up @@ -22,6 +22,9 @@
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(IncludeDir)KeyFile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\inc\Common.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(IncludeDir)BrandingInfo.cs">
<Link>Properties\BrandingInfo.cs</Link>
Expand Down
22 changes: 22 additions & 0 deletions inc/Common.ruleset
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Solution Rules" Description=" " ToolsVersion="14.0">
<Include Path="minimumrecommendedrules.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.Features" RuleNamespace="Microsoft.CodeAnalysis.CSharp.Features">
<Rule Id="IDE0002" Action="None" />
<Rule Id="IDE0003" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1009" Action="None" />
<Rule Id="SA1100" Action="None" />
<Rule Id="SA1111" Action="None" />
<Rule Id="SA1124" Action="None" />
<Rule Id="SA1131" Action="None" />
<Rule Id="SA1201" Action="None" />
<Rule Id="SA1202" Action="None" />
<Rule Id="SA1310" Action="None" />
<Rule Id="SA1401" Action="None" />
<Rule Id="SA1515" Action="None" />
<Rule Id="SA1516" Action="None" />
<Rule Id="SA1652" Action="None" />
</Rules>
</RuleSet>
24 changes: 23 additions & 1 deletion src/PowerShell/ActionText.cs
@@ -1,4 +1,26 @@
using System;
// The MIT License (MIT)
//
// Copyright (c) Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using System.Globalization;
using System.Resources;

Expand Down
22 changes: 11 additions & 11 deletions src/PowerShell/AttributeColumn.cs
Expand Up @@ -39,7 +39,7 @@ private enum UndefinedType
}

/// <summary>
/// Creates a new instance of the <see cref="AttributeColumn"/> class.
/// Initializes a new instance of the <see cref="AttributeColumn"/> class.
/// </summary>
/// <param name="type">The type of the enumeration.</param>
/// <param name="value">The value of the enumeration.</param>
Expand Down Expand Up @@ -173,10 +173,10 @@ internal bool HasValue(string name)
// A 32-bit integer is the largest integer supported by Windows Installer.

/// <summary>
/// Converts an <see cref="AttributeColumn"/> to an <see cref="Int32"/>.
/// Converts an <see cref="AttributeColumn"/> to an <see cref="int"/>.
/// </summary>
/// <param name="column">The <see cref="AttributeColumn"/> to convert.</param>
/// <returns>The <see cref="Int32"/> value of the <see cref="AttributeColumn"/>.</returns>
/// <returns>The <see cref="int"/> value of the <see cref="AttributeColumn"/>.</returns>
public static implicit operator int(AttributeColumn column)
{
if (null != column)
Expand All @@ -188,20 +188,20 @@ internal bool HasValue(string name)
}

/// <summary>
/// Converts an <see cref="Int32"/> to an <see cref="AttributeColumn"/>.
/// Converts an <see cref="int"/> to an <see cref="AttributeColumn"/>.
/// </summary>
/// <param name="value">The <see cref="Int32"/> value to convert.</param>
/// <returns>The <see cref="AttributeColumn"/> with the value of the <see cref="Int32"/>.</returns>
/// <param name="value">The <see cref="int"/> value to convert.</param>
/// <returns>The <see cref="AttributeColumn"/> with the value of the <see cref="int"/>.</returns>
public static implicit operator AttributeColumn(int value)
{
return new AttributeColumn(null, value);
}

/// <summary>
/// Converts an <see cref="AttributeColumn"/> to a nullable <see cref="Int32"/>.
/// Converts an <see cref="AttributeColumn"/> to a nullable <see cref="int"/>.
/// </summary>
/// <param name="column">The <see cref="AttributeColumn"/> to convert.</param>
/// <returns>The nullable <see cref="Int32"/> value of the <see cref="AttributeColumn"/>.</returns>
/// <returns>The nullable <see cref="int"/> value of the <see cref="AttributeColumn"/>.</returns>
public static implicit operator int?(AttributeColumn column)
{
if (null != column)
Expand All @@ -213,10 +213,10 @@ internal bool HasValue(string name)
}

/// <summary>
/// Converts a nullable <see cref="Int32"/> to an <see cref="AttributeColumn"/>.
/// Converts a nullable <see cref="int"/> to an <see cref="AttributeColumn"/>.
/// </summary>
/// <param name="value">The nullable <see cref="Int32"/> value to convert.</param>
/// <returns>The <see cref="AttributeColumn"/> with the value of the nullable <see cref="Int32"/>.</returns>
/// <param name="value">The nullable <see cref="int"/> value to convert.</param>
/// <returns>The <see cref="AttributeColumn"/> with the value of the nullable <see cref="int"/>.</returns>
public static implicit operator AttributeColumn(int? value)
{
return new AttributeColumn(null, value);
Expand Down
7 changes: 4 additions & 3 deletions src/PowerShell/Cache.cs
Expand Up @@ -38,14 +38,15 @@ internal sealed class Cache<TKey, TValue>
private CacheItemSorter sorter;

/// <summary>
/// Creates a new instance of the <see cref="Cache&lt;TKey, TValue&gt;"/> class.
/// Initializes a new instance of the <see cref="Cache{TKey, TValue}"/> class.
/// </summary>
internal Cache() : this(DefaultCapacity)
internal Cache()
: this(DefaultCapacity)
{
}

/// <summary>
/// Creates a new instance of the <see cref="Cache&lt;TKey, TValue&gt;"/> class using the given <paramref name="capacity"/>.
/// Initializes a new instance of the <see cref="Cache{TKey, TValue}"/> class.
/// </summary>
/// <param name="capacity">The initial capacity that should not be exceeded.</param>
internal Cache(int capacity)
Expand Down
19 changes: 9 additions & 10 deletions src/PowerShell/CharComparer.cs
Expand Up @@ -20,13 +20,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using System.Collections.Generic;

namespace Microsoft.Tools.WindowsInstaller
{
/// <summary>
/// Equality comparer for a <see cref="Char"/>.
/// Equality comparer for a <see cref="char"/>.
/// </summary>
internal sealed class CharComparer : IEqualityComparer<char>
{
Expand All @@ -45,30 +44,30 @@ private CharComparer(bool ignoreCase)
/// <summary>
/// Gets whether <paramref name="x"/> and <paramref name="y"/> are equal.
/// </summary>
/// <param name="x">The first <see cref="Char"/> to compare.</param>
/// <param name="y">The second <see cref="Char"/> to compare.</param>
/// <param name="x">The first <see cref="char"/> to compare.</param>
/// <param name="y">The second <see cref="char"/> to compare.</param>
/// <returns>True if <paramref name="x"/> equals <paramref name="y"/>.</returns>
public bool Equals(char x, char y)
{
if (this.ignoreCase)
{
x = Char.ToLowerInvariant(x);
y = Char.ToLowerInvariant(y);
x = char.ToLowerInvariant(x);
y = char.ToLowerInvariant(y);
}

return x.Equals(y);
}

/// <summary>
/// Gets the hash code of the given <see cref="Char"/>.
/// Gets the hash code of the given <see cref="char"/>.
/// </summary>
/// <param name="obj">The <see cref="Char"/> from which to get the hash code.</param>
/// <returns>The hash code of the given <see cref="Char"/>.</returns>
/// <param name="obj">The <see cref="char"/> from which to get the hash code.</param>
/// <returns>The hash code of the given <see cref="char"/>.</returns>
public int GetHashCode(char obj)
{
if (this.ignoreCase)
{
obj = Char.ToLowerInvariant(obj);
obj = char.ToLowerInvariant(obj);
}

return obj.GetHashCode();
Expand Down
11 changes: 5 additions & 6 deletions src/PowerShell/Column.cs
Expand Up @@ -20,10 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using Microsoft.Deployment.WindowsInstaller;
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Deployment.WindowsInstaller;

namespace Microsoft.Tools.WindowsInstaller
{
Expand Down Expand Up @@ -53,7 +53,7 @@ internal sealed class Column
};

/// <summary>
/// Creates a new instance of the <see cref="Column"/> class from a <see cref="View"/> and column index.
/// Initializes a new instance of the <see cref="Column"/> class.
/// </summary>
/// <param name="view">The <see cref="View"/> from which column information is retrieved.</param>
/// <param name="index">The index of the column within the <see cref="View"/>.</param>
Expand All @@ -63,7 +63,6 @@ internal sealed class Column
internal Column(View view, int index, string table, string name, string key)
{
// Internal constructor will assume valid parameters.

this.Index = index;
var column = view.Columns[index];

Expand Down Expand Up @@ -101,11 +100,11 @@ internal Column(View view, int index, string table, string name, string key)
}
else if (typeof(short) == type)
{
this.ColumnType = typeof(Nullable<short>);
this.ColumnType = typeof(short?);
}
else
{
this.ColumnType = typeof(Nullable<int>);
this.ColumnType = typeof(int?);
}
}

Expand All @@ -120,7 +119,7 @@ internal Column(View view, int index, string table, string name, string key)
internal int Index { get; private set; }

/// <summary>
/// Gets whether the column is a primary key in its containing table.
/// Gets a value indicating whether the column is a primary key in its containing table.
/// </summary>
internal bool IsPrimaryKey { get; private set; }

Expand Down
8 changes: 4 additions & 4 deletions src/PowerShell/ColumnCollection.cs
Expand Up @@ -20,11 +20,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using Microsoft.Deployment.WindowsInstaller;
using Microsoft.Tools.WindowsInstaller.Properties;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.Deployment.WindowsInstaller;
using Microsoft.Tools.WindowsInstaller.Properties;

namespace Microsoft.Tools.WindowsInstaller
{
Expand All @@ -37,7 +37,7 @@ internal sealed class ColumnCollection : KeyedCollection<string, Column>
private static readonly char[] NameSeparators = new char[] { '.' };

/// <summary>
/// Creates a new instance of the <see cref="Column"/> class from the specified <see cref="View"/>.
/// Initializes a new instance of the <see cref="ColumnCollection"/> class.
/// </summary>
/// <param name="view">The <see cref="View"/> from which column information is retrieved.</param>
/// <exception cref="InvalidOperationException">A column name was defined by multiple tables.</exception>
Expand Down Expand Up @@ -131,7 +131,7 @@ private static string[] GetColumns(View view)
{
// Return only specified columns.
return columns
.Replace("`", "")
.Replace("`", string.Empty)
.Split(ColumnCollection.ColumnSeparators, StringSplitOptions.RemoveEmptyEntries);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/PowerShell/ComponentSearcher.cs
Expand Up @@ -20,8 +20,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using Microsoft.Deployment.WindowsInstaller;
using System.Collections.Generic;
using Microsoft.Deployment.WindowsInstaller;

namespace Microsoft.Tools.WindowsInstaller
{
Expand Down
13 changes: 6 additions & 7 deletions src/PowerShell/EncodingConverter.cs
Expand Up @@ -20,7 +20,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using Microsoft.Deployment.WindowsInstaller;
using System;
using System.ComponentModel;
using System.Globalization;
Expand All @@ -35,33 +34,33 @@ namespace Microsoft.Tools.WindowsInstaller
internal sealed class EncodingConverter : TypeConverter
{
/// <summary>
/// Returns True when <paramref name="sourceType"/> is a <see cref="String"/> or <see cref="Int32"/>.
/// Returns True when <paramref name="sourceType"/> is a <see cref="string"/> or <see cref="int"/>.
/// </summary>
/// <param name="context">Additional context for conversion.</param>
/// <param name="sourceType">The type of the source object.</param>
/// <returns>True if the <paramref name="sourceType"/> is a <see cref="String"/> or <see cref="Int32"/>.</returns>
/// <returns>True if the <paramref name="sourceType"/> is a <see cref="string"/> or <see cref="int"/>.</returns>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return typeof(string) == sourceType || IsNumeric(sourceType) || base.CanConvertFrom(context, sourceType);
}

/// <summary>
/// Returns True when <paramref name="destinationType"/> is a <see cref="String"/> or <see cref="Int32"/>.
/// Returns True when <paramref name="destinationType"/> is a <see cref="string"/> or <see cref="int"/>.
/// </summary>
/// <param name="context">Additional context for conversion.</param>
/// <param name="destinationType">The type of the destination object.</param>
/// <returns>True if the <paramref name="destinationType"/> is a <see cref="String"/> or <see cref="Int32"/>.</returns>
/// <returns>True if the <paramref name="destinationType"/> is a <see cref="string"/> or <see cref="int"/>.</returns>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return typeof(string) == destinationType || IsNumeric(destinationType) || base.CanConvertTo(context, destinationType);
}

/// <summary>
/// Converts a <see cref="String"/> or <see cref="Int32"/> to an <see cref="Encoding"/>.
/// Converts a <see cref="string"/> or <see cref="int"/> to an <see cref="Encoding"/>.
/// </summary>
/// <param name="context">Additional context for conversion.</param>
/// <param name="culture">The culture to use for conversion.</param>
/// <param name="value">The <see cref="String"/> or <see cref="Int32"/> value to convert.</param>
/// <param name="value">The <see cref="string"/> or <see cref="int"/> value to convert.</param>
/// <returns>The <see cref="Encoding"/> for the string.</returns>
/// <exception cref="ArgumentException">No <see cref="Encoding"/> could be matched to the string or code page integer.</exception>
/// <remarks>
Expand Down

0 comments on commit 7a54ee9

Please sign in to comment.