|
|
@@ -2,6 +2,7 @@ |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Drawing; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
@@ -53,6 +54,19 @@ namespace GCMM |
|
|
|
catch (BadImageFormatException) |
|
|
|
{ //Not a .NET assembly |
|
|
|
} |
|
|
|
try |
|
|
|
{ |
|
|
|
string mmpath = "GCMM.exe"; |
|
|
|
if (File.Exists(mmpath)) |
|
|
|
{ |
|
|
|
var an = AssemblyName.GetAssemblyName(mmpath); |
|
|
|
gcmm.Version = an.Version; |
|
|
|
gcmm.LastUpdated = File.GetLastWriteTime(mmpath); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (BadImageFormatException) |
|
|
|
{ //Not a .NET assembly |
|
|
|
} |
|
|
|
return installed; |
|
|
|
} |
|
|
|
|
|
|
@@ -75,7 +89,15 @@ namespace GCMM |
|
|
|
AddUpdateModInList(mod); |
|
|
|
} |
|
|
|
} |
|
|
|
await FetchModInfo(gcipa, preview, false); |
|
|
|
if (gcmm.LatestVersion == null) //Only check once |
|
|
|
{ |
|
|
|
await FetchModInfo(gcipa, preview, false); |
|
|
|
await FetchModInfo(gcmm, preview, false); |
|
|
|
if (gcmm.Updatable) |
|
|
|
if (MessageBox.Show("There is a GCMM update available! Do you want to download it now? If yes, extract it over this installation.", "Mod Manager update", MessageBoxButtons.YesNo) |
|
|
|
== DialogResult.Yes) |
|
|
|
Process.Start(gcmm.DownloadURL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<bool> FetchModInfo(ModInfo mod, bool preview, bool desc) |
|
|
|