Migration to git.mikx.xyz + Auto Updater
This commit is contained in:
parent
c4a3b747e6
commit
d744553931
|
@ -5,12 +5,6 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace PoE_MxFilterGen
|
||||
{
|
||||
|
@ -18,11 +12,11 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
private static DateTime dt = DateTime.Now;
|
||||
|
||||
public static string version = "8.2.0";
|
||||
public static string version = "8.3.0";
|
||||
public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year);
|
||||
|
||||
public static string api = "";
|
||||
public static string giturl = "https://raw.githubusercontent.com/mikxqc";
|
||||
public static string giturl = "https://git.mikx.xyz/mikx";
|
||||
|
||||
public static string section = "";
|
||||
public static string league = "";
|
||||
|
@ -34,7 +28,7 @@ namespace PoE_MxFilterGen
|
|||
public static int sprog = 0;
|
||||
public static int stotal = 0;
|
||||
|
||||
public static bool deb = true;
|
||||
public static bool deb = false;
|
||||
|
||||
public class REMVAR
|
||||
{
|
||||
|
@ -66,23 +60,26 @@ namespace PoE_MxFilterGen
|
|||
if (!File.Exists("settings.json"))
|
||||
{
|
||||
msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3);
|
||||
web.DownloadFile("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_temp_settings.json", "settings.json");
|
||||
web.DownloadFile("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_temp_settings.json", "settings.json");
|
||||
}
|
||||
|
||||
msg.Splash();
|
||||
|
||||
//Update Logic
|
||||
msg.CMW("Checking for update...",true,1);
|
||||
string remote_version = web.ReadString(@"https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/txt/mxfiltergen_version.txt");
|
||||
string remote_version = web.ReadString(@"https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/txt/mxfiltergen_version.txt");
|
||||
if (remote_version != version && deb == false)
|
||||
{
|
||||
web.DownloadFile("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/bin/mxfiltergen_updater.exe", "PoE-MxFilterGen-Updater.exe");
|
||||
Process.Start("PoE-MxFilterGen-Updater.exe");
|
||||
web.DownloadFile("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/bin/mxfiltergen_updater.exe", "PoE-MxFilterGen-Updater.exe");
|
||||
Process p = new Process();
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.StartInfo.FileName = "PoE-MxFilterGen-Updater.exe";
|
||||
p.Start();
|
||||
Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
|
||||
// Get current league from MxD
|
||||
var ls = web.ReadString("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_var.json");
|
||||
var ls = web.ReadString("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_var.json");
|
||||
REMVAR lj = JsonConvert.DeserializeObject<REMVAR>(ls);
|
||||
league = lj.league;
|
||||
|
||||
|
@ -138,7 +135,7 @@ namespace PoE_MxFilterGen
|
|||
string filter_name = "MxFilter";
|
||||
|
||||
// Get the structure list
|
||||
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/master/{f}.json");
|
||||
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}.json");
|
||||
RootStructure j = JsonConvert.DeserializeObject<RootStructure>(js);
|
||||
|
||||
// Read the structure one by one to process gen
|
||||
|
@ -153,8 +150,9 @@ namespace PoE_MxFilterGen
|
|||
fprog = fprog + 1;
|
||||
msg.drawProgress(fprog, ftotal);
|
||||
//msg.CMW(string.Format("REMOTE_GEN {0}", sec.section), true, 1);
|
||||
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/master/{f}/{sec.section}.dll", $@"structure\{sec.section}.dll");
|
||||
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}/{sec.section}.dll", $@"structure\{sec.section}.dll");
|
||||
json.settings.WriteSection(sec.section);
|
||||
|
||||
var bytes = GenerateAssemblyAndGetRawBytes(sec.section);
|
||||
|
||||
var appDomain = AppDomain.CreateDomain(sec.section, null, new AppDomainSetup
|
||||
|
@ -174,7 +172,7 @@ namespace PoE_MxFilterGen
|
|||
fprog = fprog + 1;
|
||||
msg.drawProgress(fprog, ftotal);
|
||||
//msg.CMW($@"REMOTE_GET {sec.section}", true, 1);
|
||||
web.SaveString($@"{giturl}/PoE-MxFilter-Structure/master/{f}/{sec.section}.filter", $"structure/{sec.section}.filter");
|
||||
web.SaveString($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}/{sec.section}.filter", $"structure/{sec.section}.filter");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,7 +202,7 @@ namespace PoE_MxFilterGen
|
|||
|
||||
// Download the sounds from the remote list
|
||||
msg.CMW($@"Downloading the latest sound...", true, 1);
|
||||
var sl = web.ReadString("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_sound.json");
|
||||
var sl = web.ReadString("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_sound.json");
|
||||
REMSND slj = JsonConvert.DeserializeObject<REMSND>(sl);
|
||||
stotal = slj.sound.Count;
|
||||
foreach (string s in slj.sound)
|
||||
|
@ -212,7 +210,7 @@ namespace PoE_MxFilterGen
|
|||
sprog = sprog + 1;
|
||||
msg.drawProgress(sprog, stotal);
|
||||
if (File.Exists($@"{path}\My Games\Path of Exile\{s}")) { File.Delete($@"{path}\My Games\Path of Exile\{s}"); }
|
||||
web.DownloadFile($"https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/mp3/{s}", $@"{path}\My Games\Path of Exile\{s}");
|
||||
web.DownloadFile($"https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/mp3/{s}", $@"{path}\My Games\Path of Exile\{s}");
|
||||
}
|
||||
|
||||
// Clean all generated data
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue