Rename classes and namespaces

This commit is contained in:
Caelan Sayler
2023-12-31 11:09:44 +00:00
parent eff71d9b3f
commit 1d20f014d6
132 changed files with 454 additions and 479 deletions

View File

@@ -1,8 +1,8 @@
using Microsoft.Extensions.Logging;
using Octokit;
using Squirrel.Sources;
using Velopack.Sources;
namespace Squirrel.Deployment;
namespace Velopack.Deployment;
public class GitHubOptions
{

View File

@@ -6,7 +6,7 @@ using Amazon.S3;
using Amazon.S3.Model;
using Microsoft.Extensions.Logging;
namespace Squirrel.Deployment;
namespace Velopack.Deployment;
public class S3Options
{

View File

@@ -1,7 +1,7 @@
using System.Reflection;
using Microsoft.Extensions.Logging;
namespace Squirrel.Deployment;
namespace Velopack.Deployment;
public class HttpDownloadOptions
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.OSX;
namespace Velopack.Packaging.OSX;
internal class AppInfo
{

View File

@@ -3,7 +3,7 @@ using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
namespace Squirrel.Packaging.OSX.Commands;
namespace Velopack.Packaging.OSX.Commands;
public class OsxBundleCommandRunner
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.OSX.Commands;
namespace Velopack.Packaging.OSX.Commands;
public class OsxBundleOptions
{

View File

@@ -3,7 +3,7 @@ using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
namespace Squirrel.Packaging.OSX.Commands;
namespace Velopack.Packaging.OSX.Commands;
public class OsxReleasifyCommandRunner
{
@@ -141,7 +141,7 @@ public class OsxReleasifyCommandRunner
// create installer package, sign and notarize
if (!options.NoPackage) {
if (SquirrelRuntimeInfo.IsOSX) {
if (VelopackRuntimeInfo.IsOSX) {
var pkgPath = Path.Combine(releaseDir.FullName, $"{packId}-Setup-[{options.TargetRuntime.ToDisplay(RidDisplayType.NoVersion)}].pkg");
Dictionary<string, string> pkgContent = new() {

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.OSX.Commands;
namespace Velopack.Packaging.OSX.Commands;
public class OsxReleasifyOptions
{

View File

@@ -5,7 +5,7 @@ using System.Security;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace Squirrel.Packaging.OSX;
namespace Velopack.Packaging.OSX;
public class HelperExe : HelperFile
{
@@ -248,8 +248,8 @@ public class HelperExe : HelperFile
{
Func<string, int, int> chmod;
if (SquirrelRuntimeInfo.IsOSX) chmod = osx_chmod;
else if (SquirrelRuntimeInfo.IsLinux) chmod = nix_chmod;
if (VelopackRuntimeInfo.IsOSX) chmod = osx_chmod;
else if (VelopackRuntimeInfo.IsLinux) chmod = nix_chmod;
else return; // no-op on windows, all .exe files can be executed.
var filePermissionOctal = Convert.ToInt32("777", 8);

View File

@@ -116,7 +116,7 @@ using System.Text.RegularExpressions;
using System.Xml;
// ASCIIPropertyListParser.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>
@@ -900,7 +900,7 @@ namespace Squirrel.Packaging.OSX
}
// BinaryPropertyListParser.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>
@@ -1467,7 +1467,7 @@ namespace Squirrel.Packaging.OSX
}
// BinaryPropertyListWriter.AddObjectEqualityComparer.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
internal partial class BinaryPropertyListWriter
{
@@ -1504,7 +1504,7 @@ namespace Squirrel.Packaging.OSX
}
// BinaryPropertyListWriter.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>A BinaryPropertyListWriter is a helper class for writing out binary property list files.</para>
@@ -1899,7 +1899,7 @@ namespace Squirrel.Packaging.OSX
}
// BinaryPropertyListWriter.GetObjectEqualityComparer.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
internal partial class BinaryPropertyListWriter
{
@@ -1938,7 +1938,7 @@ namespace Squirrel.Packaging.OSX
}
// NSArray.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>Represents an Array.</summary>
/// @author Daniel Dreibrodt
@@ -2065,15 +2065,15 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSArray" />.
/// <see cref="Velopack.PropertyList.NSArray" />.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSArray" />.
/// <see cref="Velopack.PropertyList.NSArray" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSArray" />; otherwise, <c>false</c>.
/// <see cref="Velopack.PropertyList.NSArray" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
@@ -2088,7 +2088,7 @@ namespace Squirrel.Packaging.OSX
return false;
}
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSArray" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSArray" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -2244,16 +2244,16 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSArray" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSArray" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSArray" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSArray" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSArray" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSArray" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -2273,7 +2273,7 @@ namespace Squirrel.Packaging.OSX
}
// NSArray.IList.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
partial class NSArray : IList<NSObject>
{
@@ -2331,7 +2331,7 @@ namespace Squirrel.Packaging.OSX
}
// NSData.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>NSData objects are wrappers for byte buffers</summary>
/// @author Daniel Dreibrodt
@@ -2390,20 +2390,20 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSData" />.
/// <see cref="Velopack.PropertyList.NSData" />.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSData" />.
/// <see cref="Velopack.PropertyList.NSData" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSData" />; otherwise, <c>false</c>.
/// <see cref="Velopack.PropertyList.NSData" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj) =>
obj.GetType().Equals(GetType()) && ArrayEquals(((NSData)obj).Bytes, Bytes);
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSData" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSData" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -2468,16 +2468,16 @@ namespace Squirrel.Packaging.OSX
internal override void ToASCIIGnuStep(StringBuilder ascii, int level) => ToASCII(ascii, level);
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSData" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSData" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSData" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSData" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSData" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSData" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj) => obj is NSData data && ArrayEquals(Bytes, data.Bytes);
@@ -2488,7 +2488,7 @@ namespace Squirrel.Packaging.OSX
}
// NSDate.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>Represents a date</summary>
/// @author Daniel Dreibrodt
@@ -2556,19 +2556,19 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDate" />.
/// <see cref="Velopack.PropertyList.NSDate" />.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSDate" />.
/// <see cref="Velopack.PropertyList.NSDate" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDate" />; otherwise, <c>false</c>.
/// <see cref="Velopack.PropertyList.NSDate" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj) => obj.GetType().Equals(GetType()) && Date.Equals(((NSDate)obj).Date);
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSDate" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSDate" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -2610,16 +2610,16 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDate" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSDate" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSDate" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSDate" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDate" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSDate" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -2638,7 +2638,7 @@ namespace Squirrel.Packaging.OSX
}
// NSDictionary.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>
@@ -2848,16 +2848,16 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDictionary" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSDictionary" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSDictionary" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSDictionary" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSDictionary" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSDictionary" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -2881,7 +2881,7 @@ namespace Squirrel.Packaging.OSX
return true;
}
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSDictionary" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSDictionary" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -3083,7 +3083,7 @@ namespace Squirrel.Packaging.OSX
/// <param name="value">Where to store the value.</param>
public bool TryGetValue(string key, out NSObject value) => dict.TryGetValue(key, out value);
/// <summary>Gets or sets the <see cref="Squirrel.PropertyList.NSObject" /> at the specified index.</summary>
/// <summary>Gets or sets the <see cref="Velopack.PropertyList.NSObject" /> at the specified index.</summary>
/// <param name="index">Index.</param>
public NSObject this[string index]
{
@@ -3164,7 +3164,7 @@ namespace Squirrel.Packaging.OSX
}
// NSNumber.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>A number whose value is either an integer, a real number or bool.</summary>
/// @author Daniel Dreibrodt
@@ -3329,12 +3329,12 @@ namespace Squirrel.Packaging.OSX
type = BOOLEAN;
}
/// <summary>Compares the current <see cref="Squirrel.PropertyList.NSNumber" /> to the specified object.</summary>
/// <summary>Compares the current <see cref="Velopack.PropertyList.NSNumber" /> to the specified object.</summary>
/// <returns>
/// 0 if the numbers are equal, 1 if the current <see cref="Squirrel.PropertyList.NSNumber" /> is greater than the
/// 0 if the numbers are equal, 1 if the current <see cref="Velopack.PropertyList.NSNumber" /> is greater than the
/// argument and -1 if it is less, or the argument is not a number.
/// </returns>
/// <param name="o">Object to compare to the current <see cref="Squirrel.PropertyList.NSNumber" />.</param>
/// <param name="o">Object to compare to the current <see cref="Velopack.PropertyList.NSNumber" />.</param>
public int CompareTo(object o)
{
double x = ToDouble();
@@ -3426,7 +3426,7 @@ namespace Squirrel.Packaging.OSX
boolValue == number.boolValue;
}
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSNumber" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSNumber" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -3446,9 +3446,9 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Returns a <see cref="System.String" /> that represents the current
/// <see cref="Squirrel.PropertyList.NSNumber" />.
/// <see cref="Velopack.PropertyList.NSNumber" />.
/// </summary>
/// <returns>A <see cref="System.String" /> that represents the current <see cref="Squirrel.PropertyList.NSNumber" />.</returns>
/// <returns>A <see cref="System.String" /> that represents the current <see cref="Velopack.PropertyList.NSNumber" />.</returns>
public override string ToString() => type switch
{
INTEGER => ToLong().ToString(),
@@ -3607,16 +3607,16 @@ namespace Squirrel.Packaging.OSX
};
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSNumber" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSNumber" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSNumber" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSNumber" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSNumber" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSNumber" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -3682,7 +3682,7 @@ namespace Squirrel.Packaging.OSX
}
// NSObject.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>Abstract interface for any object contained in a property list.</para>
@@ -4087,19 +4087,19 @@ namespace Squirrel.Packaging.OSX
/// <summary>Determines if the specific NSObject is the same as the NSObject overriding this method.</summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSObject" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSObject" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSObject" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSObject" />; otherwise, <c>false</c>.
/// </returns>
public abstract bool Equals(NSObject obj);
}
}
// NSSet.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// <para>A set is an interface to an unordered collection of objects.</para>
@@ -4260,7 +4260,7 @@ namespace Squirrel.Packaging.OSX
/// <returns>A Set object.</returns>
internal List<NSObject> GetSet() => set;
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSSet" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSSet" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -4275,15 +4275,15 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSSet" />.
/// <see cref="Velopack.PropertyList.NSSet" />.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSSet" />.
/// <see cref="Velopack.PropertyList.NSSet" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSSet" />; otherwise, <c>false</c>.
/// <see cref="Velopack.PropertyList.NSSet" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
@@ -4443,16 +4443,16 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSSet" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSSet" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSSet" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSSet" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSSet" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSSet" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -4472,7 +4472,7 @@ namespace Squirrel.Packaging.OSX
}
// NSString.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>A NSString contains a string.</summary>
/// @author Daniel Dreibrodt
@@ -4508,9 +4508,9 @@ namespace Squirrel.Packaging.OSX
/// <returns>This NSString as .NET string object.</returns>
public string Content { get; set; }
/// <summary>Compares the current <see cref="Squirrel.PropertyList.NSString" /> to the specified object.</summary>
/// <summary>Compares the current <see cref="Velopack.PropertyList.NSString" /> to the specified object.</summary>
/// <returns>A 32-bit signed integer that indicates the lexical relationship between the two comparands.</returns>
/// <param name="o">Object to compare to the current <see cref="Squirrel.PropertyList.NSString" />.</param>
/// <param name="o">Object to compare to the current <see cref="Velopack.PropertyList.NSString" />.</param>
public int CompareTo(object o) => o switch
{
NSString nsString => string.Compare(Content, nsString.Content, StringComparison.Ordinal),
@@ -4536,19 +4536,19 @@ namespace Squirrel.Packaging.OSX
/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSString" />.
/// <see cref="Velopack.PropertyList.NSString" />.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSString" />.
/// <see cref="Velopack.PropertyList.NSString" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSString" />; otherwise, <c>false</c>.
/// <see cref="Velopack.PropertyList.NSString" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj) => obj is NSString nsString && Content.Equals(nsString.Content);
/// <summary>Serves as a hash function for a <see cref="Squirrel.PropertyList.NSString" /> object.</summary>
/// <summary>Serves as a hash function for a <see cref="Velopack.PropertyList.NSString" /> object.</summary>
/// <returns>
/// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.
@@ -4682,16 +4682,16 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSString" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSString" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.NSString" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.NSString" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.NSString" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.NSString" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj)
{
@@ -4717,7 +4717,7 @@ namespace Squirrel.Packaging.OSX
}
// PropertyListException.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>The exception that is thrown when an property list file could not be processed correctly.</summary>
[Serializable]
@@ -4767,7 +4767,7 @@ namespace Squirrel.Packaging.OSX
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// A PropertyListFormatException is thrown by the various property list format parsers when an error in the
@@ -4784,7 +4784,7 @@ namespace Squirrel.Packaging.OSX
}
// PropertyListParser.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>
/// This class provides methods to parse property lists. It can handle files, input streams and byte arrays. All
@@ -5156,7 +5156,7 @@ namespace Squirrel.Packaging.OSX
}
// UID.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>An UID. Only found in binary property lists that are keyed archives.</summary>
/// @author Daniel Dreibrodt
@@ -5165,7 +5165,7 @@ namespace Squirrel.Packaging.OSX
{
readonly ulong value;
/// <summary>Initializes a new instance of the <see cref="Squirrel.PropertyList.UID" /> class.</summary>
/// <summary>Initializes a new instance of the <see cref="Velopack.PropertyList.UID" /> class.</summary>
/// <param name="bytes">Bytes.</param>
public UID(ReadOnlySpan<byte> bytes)
{
@@ -5179,28 +5179,28 @@ namespace Squirrel.Packaging.OSX
}
/// <summary>
/// Initializes a new instance of the <see cref="Squirrel.PropertyList.UID" /> class using an unsigned 8-bit
/// Initializes a new instance of the <see cref="Velopack.PropertyList.UID" /> class using an unsigned 8-bit
/// number.
/// </summary>
/// <param name="number">Unsigned 8-bit number.</param>
public UID(byte number) => value = number;
/// <summary>
/// Initializes a new instance of the <see cref="Squirrel.PropertyList.UID" /> class using an unsigned 16-bit
/// Initializes a new instance of the <see cref="Velopack.PropertyList.UID" /> class using an unsigned 16-bit
/// number.
/// </summary>
/// <param name="number">Unsigned 16-bit number.</param>
public UID(ushort number) => value = number;
/// <summary>
/// Initializes a new instance of the <see cref="Squirrel.PropertyList.UID" /> class using an unsigned 32-bit
/// Initializes a new instance of the <see cref="Velopack.PropertyList.UID" /> class using an unsigned 32-bit
/// number.
/// </summary>
/// <param name="number">Unsigned 32-bit number.</param>
public UID(uint number) => value = number;
/// <summary>
/// Initializes a new instance of the <see cref="Squirrel.PropertyList.UID" /> class using an unsigned 64-bit
/// Initializes a new instance of the <see cref="Velopack.PropertyList.UID" /> class using an unsigned 64-bit
/// number.
/// </summary>
/// <param name="number">Unsigned 64-bit number.</param>
@@ -5306,16 +5306,16 @@ namespace Squirrel.Packaging.OSX
internal override void ToASCIIGnuStep(StringBuilder ascii, int level) => ToASCII(ascii, level);
/// <summary>
/// Determines whether the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.UID" />.
/// Determines whether the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.UID" />.
/// </summary>
/// <param name="obj">
/// The <see cref="Squirrel.PropertyList.NSObject" /> to compare with the current
/// <see cref="Squirrel.PropertyList.UID" />.
/// The <see cref="Velopack.PropertyList.NSObject" /> to compare with the current
/// <see cref="Velopack.PropertyList.UID" />.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="Squirrel.PropertyList.NSObject" /> is equal to the current
/// <see cref="Squirrel.PropertyList.UID" />; otherwise, <c>false</c>.
/// <c>true</c> if the specified <see cref="Velopack.PropertyList.NSObject" /> is equal to the current
/// <see cref="Velopack.PropertyList.UID" />; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(NSObject obj) => Equals((object)obj);
@@ -5341,7 +5341,7 @@ namespace Squirrel.Packaging.OSX
}
// XmlPropertyListParser.cs
namespace Squirrel.Packaging.OSX
namespace Velopack.Packaging.OSX
{
/// <summary>Parses XML property lists.</summary>
/// @author Daniel Dreibrodt

View File

@@ -2,7 +2,7 @@
using System.Xml;
using Microsoft.Extensions.Logging;
namespace Squirrel.Packaging.OSX;
namespace Velopack.Packaging.OSX;
internal class PlistWriter
{

View File

@@ -1,6 +1,6 @@
// https://github.com/egramtel/dotnet-bundle/blob/master/DotNet.Bundle/StructureBuilder.cs
namespace Squirrel.Packaging.OSX;
namespace Velopack.Packaging.OSX;
public class StructureBuilder
{

View File

@@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace Squirrel.Packaging.Windows
namespace Velopack.Packaging.Windows
{
[SupportedOSPlatform("windows")]
[ExcludeFromCodeCoverage]

View File

@@ -1,10 +1,10 @@
using System.Drawing;
using System.Text;
using Microsoft.Extensions.Logging;
using Squirrel.NuGet;
using Velopack.NuGet;
using FileMode = System.IO.FileMode;
namespace Squirrel.Packaging.Windows.Commands;
namespace Velopack.Packaging.Windows.Commands;
public class WindowsPackCommandRunner
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.Windows.Commands;
namespace Velopack.Packaging.Windows.Commands;
public class WindowsPackOptions : WindowsReleasifyOptions, INugetPackCommand
{

View File

@@ -1,9 +1,9 @@
using System.Text;
using Microsoft.Extensions.Logging;
using Squirrel.NuGet;
using Squirrel.Windows;
using Velopack.NuGet;
using Velopack.Windows;
namespace Squirrel.Packaging.Windows.Commands;
namespace Velopack.Packaging.Windows.Commands;
public class WindowsReleasifyCommandRunner
{
@@ -61,7 +61,7 @@ public class WindowsReleasifyCommandRunner
File.Copy(helper.UpdatePath, updatePath, true);
// update icon for Update.exe if requested
if (setupIcon != null && SquirrelRuntimeInfo.IsWindows) {
if (setupIcon != null && VelopackRuntimeInfo.IsWindows) {
helper.SetExeIcon(updatePath, setupIcon);
} else if (setupIcon != null) {
_logger.Warn("Unable to set icon for Update.exe (only supported on windows).");
@@ -150,7 +150,7 @@ public class WindowsReleasifyCommandRunner
var targetSetupExe = Path.Combine(targetDir, $"{bundledzp.Id}-Setup-[{options.TargetRuntime.ToDisplay(RidDisplayType.NoVersion)}].exe");
File.Copy(helper.SetupPath, targetSetupExe, true);
if (SquirrelRuntimeInfo.IsWindows) {
if (VelopackRuntimeInfo.IsWindows) {
helper.SetPEVersionBlockFromPackageInfo(targetSetupExe, bundledzp, setupIcon);
} else {
_logger.Warn("Unable to set Setup.exe icon (only supported on windows)");
@@ -190,7 +190,7 @@ public class WindowsReleasifyCommandRunner
}
// signtool.exe does not work if we're not on windows.
if (!SquirrelRuntimeInfo.IsWindows) return;
if (!VelopackRuntimeInfo.IsWindows) return;
if (!string.IsNullOrEmpty(signParams)) {
_logger.Info($"Preparing to sign {filePaths.Length} files with embedded signtool.exe with parallelism of {signParallel}");

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.Windows.Commands;
namespace Velopack.Packaging.Windows.Commands;
public class WindowsReleasifyOptions : WindowsSigningOptions
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Packaging.Windows.Commands;
namespace Velopack.Packaging.Windows.Commands;
public class WindowsSigningOptions
{

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
namespace Squirrel.Packaging.Windows;
namespace Velopack.Packaging.Windows;
public class HelperExe : HelperFile
{
@@ -94,7 +94,7 @@ public class HelperExe : HelperFile
public void SignPEFileWithTemplate(string filePath, string signTemplate)
{
if (SquirrelRuntimeInfo.IsWindows && CheckIsAlreadySigned(filePath)) {
if (VelopackRuntimeInfo.IsWindows && CheckIsAlreadySigned(filePath)) {
Log.Debug($"'{filePath}' is already signed, and will not be signed again.");
return;
}

View File

@@ -2,7 +2,7 @@
using Microsoft.NET.HostModel;
using Microsoft.NET.HostModel.AppHost;
namespace Squirrel.Packaging.Windows;
namespace Velopack.Packaging.Windows;
public static class SetupBundle
{

View File

@@ -1,6 +1,6 @@
using Microsoft.Extensions.Logging;
namespace Squirrel.Packaging.Commands
namespace Velopack.Packaging.Commands
{
public class DeltaGenCommandRunner : ICommand<DeltaGenOptions>
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel.Packaging.Commands
namespace Velopack.Packaging.Commands
{
public class DeltaGenOptions
{

View File

@@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Squirrel.Compression;
using Velopack.Compression;
namespace Squirrel.Packaging.Commands
namespace Velopack.Packaging.Commands
{
public class DeltaPatchCommandRunner : ICommand<DeltaPatchOptions>
{
@@ -25,9 +25,9 @@ namespace Squirrel.Packaging.Commands
var helper = new HelperFile(logger);
string updateExe;
if (SquirrelRuntimeInfo.IsWindows)
if (VelopackRuntimeInfo.IsWindows)
updateExe = helper.UpdatePath;
else if (SquirrelRuntimeInfo.IsOSX)
else if (VelopackRuntimeInfo.IsOSX)
updateExe = helper.UpdateMacPath;
else
throw new NotSupportedException("This platform is not supported.");

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel.Packaging.Commands
namespace Velopack.Packaging.Commands
{
public class DeltaPatchOptions
{

View File

@@ -1,9 +1,9 @@
using System.Text;
using Squirrel.Compression;
using Velopack.Compression;
using Microsoft.Extensions.Logging;
using System.IO.MemoryMappedFiles;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
public class DeltaPackageBuilder
{

View File

@@ -7,7 +7,7 @@ using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
public enum DeltaMode
{
@@ -84,7 +84,7 @@ public class HelperFile
};
string zstdPath;
if (SquirrelRuntimeInfo.IsWindows) {
if (VelopackRuntimeInfo.IsWindows) {
zstdPath = FindHelperFile("zstd.exe");
} else {
zstdPath = "zstd";
@@ -97,7 +97,7 @@ public class HelperFile
public void AssertSystemBinaryExists(string binaryName)
{
try {
if (SquirrelRuntimeInfo.IsWindows) {
if (VelopackRuntimeInfo.IsWindows) {
var output = InvokeAndThrowIfNonZero("where", new[] { binaryName }, null);
if (String.IsNullOrWhiteSpace(output) || !File.Exists(output))
throw new ProcessFailedException("", "");

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Squirrel.Packaging
namespace Velopack.Packaging
{
internal interface ICommand<TOpt> where TOpt : class
{

View File

@@ -89,7 +89,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.RegularExpressions;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
[ExcludeFromCodeCoverage]
public class MarkdownOptions

View File

@@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging;
using NuGet.Commands;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
public interface INugetPackCommand
{

View File

@@ -4,7 +4,7 @@ using NugetLogLevel = NuGet.Common.LogLevel;
using INugetLogMessage = NuGet.Common.ILogMessage;
using System.Diagnostics.CodeAnalysis;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
[ExcludeFromCodeCoverage]
public class NugetLoggingWrapper : INugetLogger

View File

@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
[ExcludeFromCodeCoverage]
public class ProcessFailedException : Exception

View File

@@ -4,10 +4,10 @@ using System.Text;
using System.Xml;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
using Squirrel.Compression;
using Squirrel.NuGet;
using Velopack.Compression;
using Velopack.NuGet;
namespace Squirrel.Packaging;
namespace Velopack.Packaging;
public class ReleasePackageBuilder
{

View File

@@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Octokit;
using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands
namespace Velopack.Vpk.Commands
{
public class DeltaGenCommand : BaseCommand
{

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands
namespace Velopack.Vpk.Commands
{
public class DeltaPatchCommand : BaseCommand
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public abstract class GitHubBaseCommand : OutputCommand
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class GitHubDownloadCommand : GitHubBaseCommand
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Extensions.Logging;
using Squirrel.Deployment;
using Velopack.Deployment;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class GitHubUploadCommand : GitHubBaseCommand
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class HttpDownloadCommand : OutputCommand
{

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class OsxBundleCommand : OutputCommand
{

View File

@@ -1,6 +1,6 @@
using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class OsxReleasifyCommand : PlatformCommand
{

View File

@@ -1,5 +1,5 @@

namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class S3BaseCommand : OutputCommand
{

View File

@@ -1,5 +1,5 @@

namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class S3DownloadCommand : S3BaseCommand
{

View File

@@ -1,5 +1,5 @@

namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class S3UploadCommand : S3BaseCommand
{

View File

@@ -1,10 +1,10 @@
using System.Text.RegularExpressions;
using NuGet.Common;
using NuGet.Versioning;
using Squirrel.NuGet;
using Squirrel.Windows;
using Velopack.NuGet;
using Velopack.Windows;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
internal static class SystemCommandLineExtensions
{

View File

@@ -1,7 +1,7 @@

using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class WindowsPackCommand : WindowsReleasifyCommand, INugetPackCommand
{

View File

@@ -1,6 +1,6 @@
using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class WindowsReleasifyCommand : WindowsSigningCommand
{

View File

@@ -1,7 +1,7 @@

using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class WindowsSigningCommand : PlatformCommand
{
@@ -24,7 +24,7 @@ public class WindowsSigningCommand : PlatformCommand
AddOption<bool>((v) => SignSkipDll = v, "--signSkipDll")
.SetDescription("Only signs EXE files, and skips signing DLL files.");
if (SquirrelRuntimeInfo.IsWindows) {
if (VelopackRuntimeInfo.IsWindows) {
var signParams = AddOption<string>((v) => SignParameters = v, "--signParams", "-n")
.SetDescription("Sign files via signtool.exe using these parameters.")
.SetArgumentHelpName("PARAMS");

View File

@@ -1,4 +1,4 @@
namespace Squirrel.Csq.Commands;
namespace Velopack.Vpk.Commands;
public class BaseCommand : CliCommand
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel.Csq.Commands
namespace Velopack.Vpk.Commands
{
public class OutputCommand : BaseCommand
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel.Csq.Commands
namespace Velopack.Vpk.Commands
{
public class PlatformCommand : OutputCommand
{
@@ -14,7 +14,7 @@ namespace Squirrel.Csq.Commands
protected PlatformCommand(string name, string description) : base(name, description)
{
TargetRuntime = SquirrelRuntimeInfo.SystemOs.GetOsShortName();
TargetRuntime = VelopackRuntimeInfo.SystemOs.GetOsShortName();
AddOption<string>((v) => TargetRuntime = v, "-r", "--runtime")
.SetDescription("The target runtime to build packages for.")
@@ -26,7 +26,7 @@ namespace Squirrel.Csq.Commands
.AcceptExistingOnly();
}
public RID GetRid() => RID.Parse(TargetRuntime ?? SquirrelRuntimeInfo.SystemOs.GetOsShortName());
public RID GetRid() => RID.Parse(TargetRuntime ?? VelopackRuntimeInfo.SystemOs.GetOsShortName());
public RuntimeOs GetRuntimeOs() => GetRid().BaseRID;
}

View File

@@ -1,11 +1,11 @@
using System.Runtime.Versioning;
using Squirrel.Csq.Commands;
using Squirrel.Deployment;
using Squirrel.Packaging.Commands;
using Squirrel.Packaging.OSX.Commands;
using Squirrel.Packaging.Windows.Commands;
using Velopack.Vpk.Commands;
using Velopack.Deployment;
using Velopack.Packaging.Commands;
using Velopack.Packaging.OSX.Commands;
using Velopack.Packaging.Windows.Commands;
namespace Squirrel.Csq.Compat;
namespace Velopack.Vpk.Compat;
public class EmbeddedRunner : ICommandRunner
{

View File

@@ -1,7 +1,7 @@
using System.Runtime.Versioning;
using Squirrel.Csq.Commands;
using Velopack.Vpk.Commands;
namespace Squirrel.Csq.Compat;
namespace Velopack.Vpk.Compat;
public interface ICommandRunner
{

View File

@@ -1,8 +1,8 @@
using Microsoft.Extensions.Configuration;
using Squirrel.Csq.Commands;
using Squirrel.Csq.Updates;
using Velopack.Vpk.Commands;
using Velopack.Vpk.Updates;
namespace Squirrel.Csq.Compat;
namespace Velopack.Vpk.Compat;
public class RunnerFactory
{
@@ -44,7 +44,7 @@ public class RunnerFactory
var version = new SquirrelVersionLocator(_logger).Search(solutionDir, CLOWD_PACKAGE_NAME);
if (version.Major == 4) {
var myVer = SquirrelRuntimeInfo.SquirrelNugetVersion;
var myVer = VelopackRuntimeInfo.SquirrelNugetVersion;
if (version != myVer) {
_logger.Warn($"Installed SDK is {version}, while csq is {myVer}, this is not recommended.");
}

View File

@@ -2,7 +2,7 @@
using Microsoft.Build.Construction;
using NuGet.Versioning;
namespace Squirrel.Csq.Compat;
namespace Velopack.Vpk.Compat;
public class SquirrelVersionLocator
{

View File

@@ -1,7 +1,7 @@
using System.Diagnostics;
using Squirrel.Csq.Commands;
using Velopack.Vpk.Commands;
namespace Squirrel.Csq.Compat;
namespace Velopack.Vpk.Compat;
public class V2CompatRunner : EmbeddedRunner
{
@@ -17,7 +17,7 @@ public class V2CompatRunner : EmbeddedRunner
public override async Task ExecutePackWindows(WindowsPackCommand command)
{
if (!SquirrelRuntimeInfo.IsWindows || command.GetRuntimeOs() != RuntimeOs.Windows) {
if (!VelopackRuntimeInfo.IsWindows || command.GetRuntimeOs() != RuntimeOs.Windows) {
throw new NotSupportedException("Squirrel v2.x is only supported on/for Windows.");
}
@@ -48,7 +48,7 @@ public class V2CompatRunner : EmbeddedRunner
public override async Task ExecuteReleasifyWindows(WindowsReleasifyCommand command)
{
if (!SquirrelRuntimeInfo.IsWindows || command.GetRuntimeOs() != RuntimeOs.Windows) {
if (!VelopackRuntimeInfo.IsWindows || command.GetRuntimeOs() != RuntimeOs.Windows) {
throw new NotSupportedException("Squirrel v2.x is only supported on/for Windows.");
}

View File

@@ -2,13 +2,13 @@
using Serilog.Events;
using Serilog;
using Microsoft.Extensions.Configuration;
using Squirrel.Csq.Commands;
using Velopack.Vpk.Commands;
using Microsoft.Extensions.DependencyInjection;
using Squirrel.Csq.Updates;
using Squirrel.Csq.Compat;
using Velopack.Vpk.Updates;
using Velopack.Vpk.Compat;
using System.CommandLine.Help;
namespace Squirrel.Csq;
namespace Velopack.Vpk;
public class Program
{
@@ -51,11 +51,11 @@ public class Program
Runner = new RunnerFactory(logger, host.Services.GetRequiredService<IConfiguration>());
CliRootCommand rootCommand = new CliRootCommand(
$"Squirrel {SquirrelRuntimeInfo.SquirrelDisplayVersion} for creating and distributing Squirrel releases.") {
$"Squirrel {VelopackRuntimeInfo.SquirrelDisplayVersion} for creating and distributing Squirrel releases.") {
VerboseOption,
};
switch (SquirrelRuntimeInfo.SystemOs) {
switch (VelopackRuntimeInfo.SystemOs) {
case RuntimeOs.Windows:
Add(rootCommand, new WindowsPackCommand(), nameof(ICommandRunner.ExecutePackWindows));
Add(rootCommand, new WindowsReleasifyCommand(), nameof(ICommandRunner.ExecuteReleasifyWindows));
@@ -65,7 +65,7 @@ public class Program
Add(rootCommand, new OsxReleasifyCommand(), nameof(ICommandRunner.ExecuteReleasifyOsx));
break;
default:
throw new NotSupportedException("Unsupported OS platform: " + SquirrelRuntimeInfo.SystemOs.GetOsLongName());
throw new NotSupportedException("Unsupported OS platform: " + VelopackRuntimeInfo.SystemOs.GetOsLongName());
}
CliCommand downloadCommand = new CliCommand("download", "Download's the latest release from a remote update source.");

View File

@@ -5,7 +5,7 @@ using NuGet.Protocol.Core.Types;
using NuGet.Versioning;
using NugetLogger = NuGet.Common.ILogger;
namespace Squirrel.Csq.Updates;
namespace Velopack.Vpk.Updates;
public class NugetDownloader
{

View File

@@ -2,7 +2,7 @@
using NugetLogger = NuGet.Common.ILogger;
using NugetMessage = NuGet.Common.ILogMessage;
namespace Squirrel.Csq.Updates;
namespace Velopack.Vpk.Updates;
class NullNugetLogger : NugetLogger
{

View File

@@ -1,7 +1,7 @@
using System.Threading;
using Squirrel.Packaging;
using Velopack.Packaging;
namespace Squirrel.Csq.Updates;
namespace Velopack.Vpk.Updates;
public class UpdateChecker
{
@@ -16,7 +16,7 @@ public class UpdateChecker
{
try {
var cancel = new CancellationTokenSource(3000);
var myVer = SquirrelRuntimeInfo.SquirrelNugetVersion;
var myVer = VelopackRuntimeInfo.SquirrelNugetVersion;
var dl = new NugetDownloader(new NugetLoggingWrapper(_logger));
var package = await dl.GetPackageMetadata("csq", (myVer.IsPrerelease || myVer.HasMetadata) ? "pre" : "latest", cancel.Token).ConfigureAwait(false);
if (package.Identity.Version > myVer)

View File

@@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Compression;
namespace Squirrel.Compression
namespace Velopack.Compression
{
[ExcludeFromCodeCoverage]
internal sealed class BZip2Stream : Stream

View File

@@ -6,7 +6,7 @@ using System.Threading;
// Adapted from https://github.com/LogosBible/bsdiff.net/blob/master/src/bsdiff/BinaryPatchUtility.cs
namespace Squirrel.Compression
namespace Velopack.Compression
{
/*
The original bsdiff.c source code (http://www.daemonology.net/bsdiff/) is

View File

@@ -1,7 +1,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
namespace Squirrel.Compression
namespace Velopack.Compression
{
/// <summary>
/// Represents an error that occurs when a package does not match it's expected SHA checksum

View File

@@ -7,12 +7,12 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using Squirrel.Locators;
using Velopack.Locators;
// https://dev.to/emrahsungu/how-to-compare-two-files-using-net-really-really-fast-2pd9
// https://github.com/SnowflakePowered/vcdiff
namespace Squirrel.Compression
namespace Velopack.Compression
{
internal class DeltaPackage
{
@@ -121,7 +121,7 @@ namespace Squirrel.Compression
} else if (relativeFilePath.EndsWith(".diff", StringComparison.InvariantCultureIgnoreCase)) {
_log.Trace($"Applying msdiff to {relativeFilePath}");
if (SquirrelRuntimeInfo.IsWindows) {
if (VelopackRuntimeInfo.IsWindows) {
MsDeltaCompression.ApplyDelta(inputFile, finalTarget, tempTargetFile);
} else {
throw new InvalidOperationException("msdiff is not supported on non-windows platforms.");

View File

@@ -2,7 +2,7 @@
using System.IO.Compression;
using Microsoft.Extensions.Logging;
namespace Squirrel.Compression
namespace Velopack.Compression
{
internal static class EasyZip
{

View File

@@ -6,7 +6,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace Squirrel.Compression
namespace Velopack.Compression
{
[ExcludeFromCodeCoverage]
[SupportedOSPlatform("windows")]

View File

@@ -2,7 +2,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace Squirrel
namespace Velopack
{
[ExcludeFromCodeCoverage]
internal static class Disposable

View File

@@ -4,11 +4,8 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// Useful enumerable extensions used by Squirrel
/// </summary>
[ExcludeFromCodeCoverage]
internal static class EnumerableExtensions
{

View File

@@ -2,7 +2,7 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Logging;
namespace Squirrel
namespace Velopack
{
[ExcludeFromCodeCoverage]
internal static class LoggerExtensions

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using Microsoft.Extensions.Logging;
namespace Squirrel
namespace Velopack
{
[ExcludeFromCodeCoverage]
internal static class ProcessStartExtensions

View File

@@ -68,12 +68,12 @@ using System.Runtime.Serialization;
using System.Text;
#if !NET5_0_OR_GREATER
using Squirrel.Json.Reflection;
using Velopack.Json.Reflection;
#endif
#if NET5_0_OR_GREATER
namespace Squirrel.Json
namespace Velopack.Json
{
[ExcludeFromCodeCoverage]
internal static class SimpleJson
@@ -90,7 +90,7 @@ namespace Squirrel.Json
// ReSharper disable LoopCanBeConvertedToQuery
// ReSharper disable RedundantExplicitArrayCreation
// ReSharper disable SuggestUseVarKeywordEvident
namespace Squirrel.Json
namespace Velopack.Json
{
/// <summary>
/// Represents the json array.
@@ -505,7 +505,7 @@ namespace Squirrel.Json
}
}
namespace Squirrel.Json
namespace Velopack.Json
{
/// <summary>
/// This class encodes and decodes JSON strings.

View File

@@ -10,9 +10,9 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Squirrel.NuGet;
using Velopack.NuGet;
namespace Squirrel
namespace Velopack
{
internal static class Utility
{
@@ -101,22 +101,22 @@ namespace Squirrel
public static bool FullPathEquals(string path1, string path2)
{
return NormalizePath(path1).Equals(NormalizePath(path2), SquirrelRuntimeInfo.PathStringComparison);
return NormalizePath(path1).Equals(NormalizePath(path2), VelopackRuntimeInfo.PathStringComparison);
}
public static bool PathPartEquals(string part1, string part2)
{
return part1.Equals(part2, SquirrelRuntimeInfo.PathStringComparison);
return part1.Equals(part2, VelopackRuntimeInfo.PathStringComparison);
}
public static bool PathPartStartsWith(string part1, string startsWith)
{
return part1.StartsWith(startsWith, SquirrelRuntimeInfo.PathStringComparison);
return part1.StartsWith(startsWith, VelopackRuntimeInfo.PathStringComparison);
}
public static bool PathPartEndsWith(string part1, string endsWith)
{
return part1.EndsWith(endsWith, SquirrelRuntimeInfo.PathStringComparison);
return part1.EndsWith(endsWith, VelopackRuntimeInfo.PathStringComparison);
}
public static bool FileHasExtension(string filePath, string extension)
@@ -137,7 +137,7 @@ namespace Squirrel
{
var normalizedDir = NormalizePath(directory) + Path.DirectorySeparatorChar;
var normalizedFile = NormalizePath(file);
return normalizedFile.StartsWith(normalizedDir, SquirrelRuntimeInfo.PathStringComparison);
return normalizedFile.StartsWith(normalizedDir, VelopackRuntimeInfo.PathStringComparison);
}
public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo rootPath)
@@ -270,15 +270,15 @@ namespace Squirrel
{
string tempDir;
if (SquirrelRuntimeInfo.IsOSX) {
tempDir = "/tmp/clowd.squirrel";
} else if (SquirrelRuntimeInfo.IsWindows) {
tempDir = Path.Combine(Path.GetTempPath(), "Clowd.Squirrel");
if (VelopackRuntimeInfo.IsOSX) {
tempDir = "/tmp/velopack";
} else if (VelopackRuntimeInfo.IsWindows) {
tempDir = Path.Combine(Path.GetTempPath(), "Velopack");
} else {
throw new NotSupportedException();
}
if (Environment.GetEnvironmentVariable("CLOWD_SQUIRREL_TEMP") is var squirrlTmp
if (Environment.GetEnvironmentVariable("VELOPACK_TEMP") is var squirrlTmp
&& !string.IsNullOrWhiteSpace(squirrlTmp))
tempDir = squirrlTmp;
@@ -409,7 +409,7 @@ namespace Squirrel
private static void DeleteFsiVeryHard(FileSystemInfo fileSystemInfo, ILogger logger)
{
// don't try to delete the running process
if (FullPathEquals(fileSystemInfo.FullName, SquirrelRuntimeInfo.EntryExePath))
if (FullPathEquals(fileSystemInfo.FullName, VelopackRuntimeInfo.EntryExePath))
return;
// try to remove "ReadOnly" attributes
@@ -481,7 +481,7 @@ namespace Squirrel
public static string GetAppUserModelId(string packageId, string exeName)
{
return String.Format("com.squirrel.{0}.{1}", packageId.Replace(" ", ""),
return String.Format("com.velopack.{0}.{1}", packageId.Replace(" ", ""),
exeName.Replace(".exe", "").Replace(" ", ""));
}

View File

@@ -2,12 +2,12 @@
using System.Collections.Generic;
using NuGet.Versioning;
namespace Squirrel.Locators
namespace Velopack.Locators
{
/// <summary>
/// An interface describing where Squirrel can find key folders and files.
/// An interface describing where Velopack can find key folders and files.
/// </summary>
public interface ISquirrelLocator
public interface IVelopackLocator
{
/// <summary> The unique application Id. This is used in various app paths. </summary>
public string AppId { get; }

View File

@@ -3,16 +3,16 @@ using System.IO;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
using Squirrel.NuGet;
using Velopack.NuGet;
namespace Squirrel.Locators
namespace Velopack.Locators
{
/// <summary>
/// The default for OSX. All application files will remain in the '.app'.
/// All additional files (log, etc) will be placed in a temporary directory.
/// </summary>
[SupportedOSPlatform("osx")]
public class OsxSquirrelLocator : SquirrelLocator
public class OsxVelopackLocator : VelopackLocator
{
/// <inheritdoc />
public override string AppId { get; }
@@ -36,19 +36,19 @@ namespace Squirrel.Locators
public override string PackagesDir => CreateSubDirIfDoesNotExist(AppTempDir, "packages");
/// <summary>
/// Creates a new <see cref="OsxSquirrelLocator"/> and auto-detects the
/// Creates a new <see cref="OsxVelopackLocator"/> and auto-detects the
/// app information from metadata embedded in the .app.
/// </summary>
public OsxSquirrelLocator(ILogger logger)
public OsxVelopackLocator(ILogger logger)
: base(logger)
{
if (!SquirrelRuntimeInfo.IsOSX)
if (!VelopackRuntimeInfo.IsOSX)
throw new NotSupportedException("Cannot instantiate OsxLocator on a non-osx system.");
Log.Info("Initialising OsxSquirrelLocator");
Log.Info($"Initialising {nameof(OsxVelopackLocator)}");
// are we inside a .app?
var ourPath = SquirrelRuntimeInfo.EntryExePath;
var ourPath = VelopackRuntimeInfo.EntryExePath;
var ix = ourPath.IndexOf(".app/", StringComparison.InvariantCultureIgnoreCase);
if (ix <= 0) {
Log.Warn($"Unable to locate .app root from '{ourPath}'");

View File

@@ -7,15 +7,15 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
namespace Squirrel.Locators
namespace Velopack.Locators
{
/// <summary>
/// Provides a mock / test implementation of <see cref="SquirrelLocator" />. This can be used to verify that
/// Provides a mock / test implementation of <see cref="VelopackLocator" />. This can be used to verify that
/// your application is able to find and prepare updates from your chosen update source without actually
/// having an installed Squirrel application. This could be used in a CI/CD pipeline, or unit tests etc.
/// having an installed application. This could be used in a CI/CD pipeline, or unit tests etc.
/// </summary>
[ExcludeFromCodeCoverage]
public class TestSquirrelLocator : SquirrelLocator
public class TestVelopackLocator : VelopackLocator
{
/// <inheritdoc />
public override string AppId {
@@ -83,14 +83,14 @@ namespace Squirrel.Locators
private readonly string _root;
private readonly string _appContent;
/// <inheritdoc cref="TestSquirrelLocator" />
public TestSquirrelLocator(string appId, string version, string packagesDir, ILogger logger = null)
/// <inheritdoc cref="TestVelopackLocator" />
public TestVelopackLocator(string appId, string version, string packagesDir, ILogger logger = null)
: this(appId, version, packagesDir, null, null, null, logger)
{
}
/// <inheritdoc cref="TestSquirrelLocator" />
public TestSquirrelLocator(string appId, string version, string packagesDir, string appDir,
/// <inheritdoc cref="TestVelopackLocator" />
public TestVelopackLocator(string appId, string version, string packagesDir, string appDir,
string rootDir, string updateExe, ILogger logger = null)
: base(logger)
{

View File

@@ -8,32 +8,32 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
namespace Squirrel.Locators
namespace Velopack.Locators
{
/// <summary>
/// A base class describing where Squirrel can find key folders and files.
/// A base class describing where Velopack can find key folders and files.
/// </summary>
public abstract class SquirrelLocator : ISquirrelLocator
public abstract class VelopackLocator : IVelopackLocator
{
private static SquirrelLocator _current;
private static VelopackLocator _current;
/// <summary>
/// Auto-detect the platform from the current operating system.
/// </summary>
public static SquirrelLocator GetDefault(ILogger logger)
public static VelopackLocator GetDefault(ILogger logger)
{
var log = logger ?? NullLogger.Instance;
if (_current != null)
return _current;
if (SquirrelRuntimeInfo.IsWindows)
return _current ??= new WindowsSquirrelLocator(log);
if (VelopackRuntimeInfo.IsWindows)
return _current ??= new WindowsVelopackLocator(log);
if (SquirrelRuntimeInfo.IsOSX)
return _current ??= new OsxSquirrelLocator(log);
if (VelopackRuntimeInfo.IsOSX)
return _current ??= new OsxVelopackLocator(log);
throw new NotSupportedException($"OS platform '{SquirrelRuntimeInfo.SystemOs.GetOsLongName()}' is not supported.");
throw new NotSupportedException($"OS platform '{VelopackRuntimeInfo.SystemOs.GetOsLongName()}' is not supported.");
}
/// <inheritdoc/>
@@ -46,7 +46,7 @@ namespace Squirrel.Locators
public abstract string PackagesDir { get; }
/// <inheritdoc/>
public virtual string AppTempDir => CreateSubDirIfDoesNotExist(PackagesDir, "SquirrelClowdTemp");
public virtual string AppTempDir => CreateSubDirIfDoesNotExist(PackagesDir, "VelopackTemp");
/// <inheritdoc/>
public abstract string UpdateExePath { get; }
@@ -57,7 +57,7 @@ namespace Squirrel.Locators
/// <inheritdoc/>
public virtual string ThisExeRelativePath {
get {
var path = SquirrelRuntimeInfo.EntryExePath;
var path = VelopackRuntimeInfo.EntryExePath;
if (path.StartsWith(AppContentDir, StringComparison.OrdinalIgnoreCase)) {
return path.Substring(AppContentDir.Length + 1);
} else {
@@ -72,8 +72,8 @@ namespace Squirrel.Locators
/// <summary> The log interface to use for diagnostic messages. </summary>
protected ILogger Log { get; }
/// <inheritdoc cref="SquirrelLocator"/>
protected SquirrelLocator(ILogger logger)
/// <inheritdoc cref="VelopackLocator"/>
protected VelopackLocator(ILogger logger)
{
Log = logger;
}
@@ -147,27 +147,5 @@ namespace Squirrel.Locators
return null;
}
}
// /// <summary>
// /// Starts Update.exe with the correct arguments to restart this process.
// /// Update.exe will wait for this process to exit, and apply any pending version updates
// /// before re-launching the latest version.
// /// </summary>
// public virtual Process StartRestartingProcess(string exeToStart = null, string arguments = null)
// {
// exeToStart = exeToStart ?? Path.GetFileName(SquirrelRuntimeInfo.EntryExePath);
//
// List<string> args = new() {
// "--processStartAndWait",
// exeToStart,
// };
//
// if (arguments != null) {
// args.Add("-a");
// args.Add(arguments);
// }
//
// return PlatformUtil.StartProcessNonBlocking(UpdateExePath, args, Path.GetDirectoryName(UpdateExePath));
// }
}
}

View File

@@ -4,15 +4,15 @@ using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using NuGet.Versioning;
using Squirrel.NuGet;
using Velopack.NuGet;
namespace Squirrel.Locators
namespace Velopack.Locators
{
/// <summary>
/// An implementation for Windows which uses the Squirrel default paths.
/// </summary>
[SupportedOSPlatform("windows")]
public class WindowsSquirrelLocator : SquirrelLocator
public class WindowsVelopackLocator : VelopackLocator
{
/// <inheritdoc />
public override string AppId { get; }
@@ -32,18 +32,18 @@ namespace Squirrel.Locators
/// <inheritdoc />
public override string PackagesDir => CreateSubDirIfDoesNotExist(RootAppDir, "packages");
/// <inheritdoc cref="WindowsSquirrelLocator" />
public WindowsSquirrelLocator(ILogger logger) : this(SquirrelRuntimeInfo.EntryExePath, logger)
/// <inheritdoc cref="WindowsVelopackLocator" />
public WindowsVelopackLocator(ILogger logger) : this(VelopackRuntimeInfo.EntryExePath, logger)
{
}
/// <summary>
/// Internal use only. Auto detect app details from the specified EXE path.
/// </summary>
internal WindowsSquirrelLocator(string ourExePath, ILogger logger)
internal WindowsVelopackLocator(string ourExePath, ILogger logger)
: base(logger)
{
if (!SquirrelRuntimeInfo.IsWindows)
if (!VelopackRuntimeInfo.IsWindows)
throw new NotSupportedException("Cannot instantiate WindowsLocator on a non-Windows system.");
// We try various approaches here. Firstly, if Update.exe is in the parent directory,
@@ -58,7 +58,7 @@ namespace Squirrel.Locators
var possibleUpdateExe = Path.GetFullPath(Path.Combine(myDirPath, "..\\Update.exe"));
var ixCurrent = ourExePath.LastIndexOf("/current/", StringComparison.InvariantCultureIgnoreCase);
Log.Info("Initialising WindowsSquirrelLocator");
Log.Info($"Initialising {nameof(WindowsVelopackLocator)}");
if (File.Exists(possibleUpdateExe)) {
Log.Info("Update.exe found in parent directory");

View File

@@ -2,7 +2,7 @@
using System.Linq;
using System.Xml;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
internal static class ContentType
{

View File

@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using NuGet.Versioning;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public interface IPackage
{

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public interface IPackageFile
{

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public interface IZipPackage : IPackage
{

View File

@@ -7,7 +7,7 @@ using System.Xml;
using System.Xml.Linq;
using NuGet.Versioning;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
internal static class NugetUtil
{

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Xml.Linq;
using NuGet.Versioning;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public class NuspecManifest : IPackage
{

View File

@@ -5,7 +5,7 @@ using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public class PackageDependency
{

View File

@@ -9,7 +9,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public class ZipPackage : NuspecManifest, IZipPackage
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Squirrel.NuGet
namespace Velopack.NuGet
{
public class ZipPackageFile : IPackageFile, IEquatable<ZipPackageFile>
{

View File

@@ -5,7 +5,7 @@ using System;
using System.Diagnostics;
using System.Text;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// A Version class that also supports a single integer (major only)

View File

@@ -9,9 +9,9 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using NuGet.Versioning;
using Squirrel.NuGet;
using Velopack.NuGet;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// Describes the requested release notes text format.

View File

@@ -4,7 +4,7 @@ using System.IO;
using System.Text.RegularExpressions;
using NuGet.Versioning;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// Represents the information that can be parsed from a release entry filename.

View File

@@ -4,9 +4,9 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Squirrel.Json;
using Velopack.Json;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary> Describes a GitHub release, including attached assets. </summary>
[DataContract]

View File

@@ -4,9 +4,9 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Squirrel.Json;
using Velopack.Json;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// Describes a Gitlab release, plus any assets that are attached.

View File

@@ -6,7 +6,7 @@ using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <inheritdoc cref="IFileDownloader"/>
@@ -15,7 +15,7 @@ namespace Squirrel.Sources
/// <summary>
/// The User-Agent sent with Squirrel requests
/// </summary>
public static ProductInfoHeaderValue UserAgent => new("Squirrel", SquirrelRuntimeInfo.SquirrelNugetVersion.ToFullString());
public static ProductInfoHeaderValue UserAgent => new("Squirrel", VelopackRuntimeInfo.SquirrelNugetVersion.ToFullString());
/// <inheritdoc />
public virtual async Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization, string accept)

View File

@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// A simple abstractable file downloader

View File

@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// Abstraction for finding and downloading updates from a package source / repository.

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// Retrieves available updates from a local or network-attached disk. The directory

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// Retrieves updates from a static file host or other web server.
@@ -38,13 +38,13 @@ namespace Squirrel.Sources
var uri = Utility.AppendPathToUri(BaseUri, GetReleasesFileName());
var args = new Dictionary<string, string>();
if (SquirrelRuntimeInfo.SystemArch != RuntimeCpu.Unknown) {
args.Add("arch", SquirrelRuntimeInfo.SystemArch.ToString());
if (VelopackRuntimeInfo.SystemArch != RuntimeCpu.Unknown) {
args.Add("arch", VelopackRuntimeInfo.SystemArch.ToString());
}
if (SquirrelRuntimeInfo.SystemOs != RuntimeOs.Unknown) {
args.Add("os", SquirrelRuntimeInfo.SystemOs.GetOsShortName());
args.Add("rid", SquirrelRuntimeInfo.SystemRid);
if (VelopackRuntimeInfo.SystemOs != RuntimeOs.Unknown) {
args.Add("os", VelopackRuntimeInfo.SystemOs.GetOsShortName());
args.Add("rid", VelopackRuntimeInfo.SystemRid);
}
if (latestLocalRelease != null) {

View File

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
namespace Squirrel.Sources
namespace Velopack.Sources
{
/// <summary>
/// A base class to provide some common functionality for classes that implement <see cref="IUpdateSource"/>.

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// Holds information about the current version and pending updates, such as how many there are, and access to release notes.

View File

@@ -8,11 +8,11 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using Squirrel.Compression;
using Squirrel.Locators;
using Squirrel.Sources;
using Velopack.Compression;
using Velopack.Locators;
using Velopack.Sources;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// Provides functionality for checking for updates, downloading updates, and applying updates to the current application.
@@ -46,7 +46,7 @@ namespace Squirrel
protected ILogger Log { get; }
/// <summary> The locator to use when searching for local file paths. </summary>
protected ISquirrelLocator Locator { get; }
protected IVelopackLocator Locator { get; }
/// <summary>
/// Creates a new UpdateManager instance using the specified URL or file path to the releases feed, and the specified channel name.
@@ -54,9 +54,9 @@ namespace Squirrel
/// <param name="urlOrPath">A basic URL or file path to use when checking for updates.</param>
/// <param name="channel">Search for releases in the feed of a specific channel name. If null, it will search the default channel.</param>
/// <param name="logger">The logger to use for diagnostic messages.</param>
/// <param name="locator">This should usually be left null. Providing an <see cref="ISquirrelLocator" /> allows you to mock up certain application paths.
/// For example, if you wanted to test that updates are working in a unit test, you could provide an instance of <see cref="TestSquirrelLocator"/>. </param>
public UpdateManager(string urlOrPath, string channel = null, ILogger logger = null, ISquirrelLocator locator = null)
/// <param name="locator">This should usually be left null. Providing an <see cref="IVelopackLocator" /> allows you to mock up certain application paths.
/// For example, if you wanted to test that updates are working in a unit test, you could provide an instance of <see cref="TestVelopackLocator"/>. </param>
public UpdateManager(string urlOrPath, string channel = null, ILogger logger = null, IVelopackLocator locator = null)
: this(CreateSimpleSource(urlOrPath, channel, logger), logger, locator)
{
}
@@ -67,9 +67,9 @@ namespace Squirrel
/// <param name="source">The source describing where to search for updates. This can be a custom source, if you are integrating with some private resource,
/// or it could be one of the predefined sources. (eg. <see cref="SimpleWebSource"/> or <see cref="GithubSource"/>, etc).</param>
/// <param name="logger">The logger to use for diagnostic messages.</param>
/// <param name="locator">This should usually be left null. Providing an <see cref="ISquirrelLocator" /> allows you to mock up certain application paths.
/// For example, if you wanted to test that updates are working in a unit test, you could provide an instance of <see cref="TestSquirrelLocator"/>. </param>
public UpdateManager(IUpdateSource source, ILogger logger = null, ISquirrelLocator locator = null)
/// <param name="locator">This should usually be left null. Providing an <see cref="IVelopackLocator" /> allows you to mock up certain application paths.
/// For example, if you wanted to test that updates are working in a unit test, you could provide an instance of <see cref="TestVelopackLocator"/>. </param>
public UpdateManager(IUpdateSource source, ILogger logger = null, IVelopackLocator locator = null)
: this(logger, locator)
{
if (source == null) {
@@ -78,10 +78,10 @@ namespace Squirrel
Source = source;
}
internal UpdateManager(ILogger logger, ISquirrelLocator locator)
internal UpdateManager(ILogger logger, IVelopackLocator locator)
{
Log = logger ?? NullLogger.Instance;
Locator = locator ?? SquirrelLocator.GetDefault(Log);
Locator = locator ?? VelopackLocator.GetDefault(Log);
}
/// <inheritdoc cref="CheckForUpdatesAsync(CancellationToken)"/>
@@ -227,7 +227,7 @@ namespace Squirrel
}
} catch (Exception ex) {
Log.Warn(ex, "Unable to apply delta updates, falling back to full update.");
if (SquirrelRuntimeInfo.InUnitTestRunner) {
if (VelopackRuntimeInfo.InUnitTestRunner) {
throw;
}
}

View File

@@ -8,47 +8,47 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using Squirrel.Locators;
using Velopack.Locators;
namespace Squirrel
namespace Velopack
{
/// <summary>
/// A delegate type for handling Squirrel startup events
/// A delegate type for handling Velopack startup events
/// </summary>
/// <param name="version">The currently executing version of this application</param>
public delegate void SquirrelHook(SemanticVersion version);
public delegate void VelopackHook(SemanticVersion version);
/// <summary>
/// SquirrelApp helps you to handle Squirrel app activation events correctly.
/// VelopackApp helps you to handle app activation events correctly.
/// This should be used as early as possible in your application startup code.
/// (eg. the beginning of Main() in Program.cs)
/// </summary>
public sealed class SquirrelApp
public sealed class VelopackApp
{
ISquirrelLocator _locator;
SquirrelHook _install;
SquirrelHook _update;
SquirrelHook _obsolete;
SquirrelHook _uninstall;
SquirrelHook _firstrun;
SquirrelHook _restarted;
IVelopackLocator _locator;
VelopackHook _install;
VelopackHook _update;
VelopackHook _obsolete;
VelopackHook _uninstall;
VelopackHook _firstrun;
VelopackHook _restarted;
string[] _args;
bool _autoApply = true;
private SquirrelApp()
private VelopackApp()
{
}
/// <summary>
/// Creates and returns a new Squirrel application builder.
/// </summary>
public static SquirrelApp Build() => new SquirrelApp();
public static VelopackApp Build() => new VelopackApp();
/// <summary>
/// Override the command line arguments used to determine the Squirrel hook to run.
/// If this is not set, the command line arguments passed to the application will be used.
/// </summary>
public SquirrelApp SetArgs(string[] args)
public VelopackApp SetArgs(string[] args)
{
_args = args;
return this;
@@ -57,16 +57,16 @@ namespace Squirrel
/// <summary>
/// Set whether to automatically apply downloaded updates on startup. This is ON by default.
/// </summary>
public SquirrelApp SetAutoApplyOnStartup(bool autoApply)
public VelopackApp SetAutoApplyOnStartup(bool autoApply)
{
_autoApply = autoApply;
return this;
}
/// <summary>
/// Override the default <see cref="ISquirrelLocator"/> used to search for application paths.
/// Override the default <see cref="IVelopackLocator"/> used to search for application paths.
/// </summary>
public SquirrelApp SetLocator(ISquirrelLocator locator)
public VelopackApp SetLocator(IVelopackLocator locator)
{
_locator = locator;
return this;
@@ -75,7 +75,7 @@ namespace Squirrel
/// <summary>
/// This hook is triggered when the application is started for the first time after installation.
/// </summary>
public SquirrelApp WithFirstRun(SquirrelHook hook)
public VelopackApp WithFirstRun(VelopackHook hook)
{
_firstrun = hook;
return this;
@@ -84,7 +84,7 @@ namespace Squirrel
/// <summary>
/// This hook is triggered when the application is restarted by Squirrel after installing updates.
/// </summary>
public SquirrelApp WithRestarted(SquirrelHook hook)
public VelopackApp WithRestarted(VelopackHook hook)
{
_restarted = hook;
return this;
@@ -97,7 +97,7 @@ namespace Squirrel
/// Only supported on windows; On other operating systems, this will never be called.
/// </summary>
[SupportedOSPlatform("windows")]
public SquirrelApp WithAfterInstallFastCallback(SquirrelHook hook)
public VelopackApp WithAfterInstallFastCallback(VelopackHook hook)
{
_install = hook;
return this;
@@ -110,7 +110,7 @@ namespace Squirrel
/// Only supported on windows; On other operating systems, this will never be called.
/// </summary>
[SupportedOSPlatform("windows")]
public SquirrelApp WithAfterUpdateFastCallback(SquirrelHook hook)
public VelopackApp WithAfterUpdateFastCallback(VelopackHook hook)
{
_update = hook;
return this;
@@ -123,7 +123,7 @@ namespace Squirrel
/// Only supported on windows; On other operating systems, this will never be called.
/// </summary>
[SupportedOSPlatform("windows")]
public SquirrelApp WithBeforeUpdateFastCallback(SquirrelHook hook)
public VelopackApp WithBeforeUpdateFastCallback(VelopackHook hook)
{
_obsolete = hook;
return this;
@@ -136,7 +136,7 @@ namespace Squirrel
/// Only supported on windows; On other operating systems, this will never be called.
/// </summary>
[SupportedOSPlatform("windows")]
public SquirrelApp WithBeforeUninstallFastCallback(SquirrelHook hook)
public VelopackApp WithBeforeUninstallFastCallback(VelopackHook hook)
{
_uninstall = hook;
return this;
@@ -150,11 +150,11 @@ namespace Squirrel
{
var args = _args ?? Environment.GetCommandLineArgs().Skip(1).ToArray();
var log = logger ?? NullLogger.Instance;
var locator = _locator ?? SquirrelLocator.GetDefault(log);
var locator = _locator ?? VelopackLocator.GetDefault(log);
// internal hook run by the Squirrel tooling to check everything is working
if (args.Length >= 1 && args[0].Equals("--squirrel-version", StringComparison.OrdinalIgnoreCase)) {
Console.WriteLine(SquirrelRuntimeInfo.SquirrelNugetVersion);
Console.WriteLine(VelopackRuntimeInfo.SquirrelNugetVersion);
Exit(0);
return;
}
@@ -162,7 +162,7 @@ namespace Squirrel
log.Info("Starting Squirrel App (Run).");
// first, we run any fast exit hooks
SquirrelHook defaultBlock = ((v) => { });
VelopackHook defaultBlock = ((v) => { });
var fastExitlookup = new[] {
new { Key = "--squirrel-install", Value = _install ?? defaultBlock },
new { Key = "--squirrel-updated", Value = _update ?? defaultBlock },
@@ -236,7 +236,7 @@ namespace Squirrel
private void Exit(int code)
{
if (!SquirrelRuntimeInfo.InUnitTestRunner) {
if (!VelopackRuntimeInfo.InUnitTestRunner) {
Environment.Exit(code);
}
}

View File

@@ -38,7 +38,7 @@ namespace System.Runtime.CompilerServices
}
#endif
namespace Squirrel
namespace Velopack
{
// constants from winnt.h
/// <summary> The Runtime CPU Architecture </summary>
@@ -77,7 +77,7 @@ namespace Squirrel
/// Convenience class which provides runtime information about the current executing process,
/// in a way that is safe in older and newer versions of the framework.
/// </summary>
public static class SquirrelRuntimeInfo
public static class VelopackRuntimeInfo
{
/// <summary> The current compiled Squirrel display version. </summary>
public static string SquirrelDisplayVersion { get; }
@@ -128,7 +128,7 @@ namespace Squirrel
public static StringComparison PathStringComparison =>
IsWindows ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture;
static SquirrelRuntimeInfo()
static VelopackRuntimeInfo()
{
EntryExePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
BaseDirectory = AppContext.BaseDirectory;

Some files were not shown because too many files have changed in this diff Show More