|
@@ -29,18 +29,35 @@ namespace BepInEx
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public SemVer.Version Version { get; protected set; }
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public BepInPlugin(string GUID, string Name, string Version)
|
|
|
{
|
|
|
this.GUID = GUID;
|
|
|
this.Name = Name;
|
|
|
- this.Version = SemVer.Version.TryParse(Version, out var v) ? v : null;
|
|
|
+ this.Version = TryParseLongVersion(Version);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static SemVer.Version TryParseLongVersion(string version)
|
|
|
+ {
|
|
|
+ if (SemVer.Version.TryParse(version, out var v))
|
|
|
+ return v;
|
|
|
+
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var longVersion = new System.Version(version);
|
|
|
+
|
|
|
+ return new SemVer.Version(longVersion.Major, longVersion.Minor, longVersion.Build);
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
internal static BepInPlugin FromCecilType(TypeDefinition td)
|
|
@@ -93,7 +110,7 @@ namespace BepInEx
|
|
|
public SemVer.Range VersionRange { get; protected set; }
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -106,7 +123,7 @@ namespace BepInEx
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|