Ejemplo n.º 1
0
		static int Main(string[] args)
		{
			// Never comma under decimal/floating points
			Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

			// Modify current working directory, portable!
			Environment.CurrentDirectory = Global.Folder.Root;

			// Essential Stuff
			Title = $"{Global.App.Name} Console";

			// Make WinForms much pretty
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			// Display this program header text
			Head();

			// Load settings
			SettingsLoad();

			// Upgrade settings
			SettingsUpgrade();

			// Command
			if (Command(args) == 0)
				return 0;

#if !STEAM
			// Update check
			if (!ApplyUpdate)
			{
				string version = new Download().GetString("https://x265.github.io/update/version.txt");
				Global.App.NewRelease = string.IsNullOrEmpty(version) ? false : string.Equals(Global.App.VersionRelease, version) ? false : true;
			}
#endif

			// Splash Screen, loading and update
			SplashScreen();

			// Main Form
			MainForm();

			// Clean temp file
			MediaEncoder.CleanUp();

			// Save settings and exit
			Default.Save();
			return 0;
		}
Ejemplo n.º 2
0
		public static void Update()
		{
			foreach (var item in Extension.Items)
			{
				string version = string.Empty;
				string link = string.Empty;

				Console.Write($"\nChecking for update: {item.Name}");

				if (string.IsNullOrEmpty(item.UrlVersion))
					continue;

				version = new Download().GetString(item.UrlVersion);

				if (string.Equals(item.Version, version ?? "0"))
					continue;

				link = string.Format(item.UrlDownload, version);

				new Download().GetFileExtract(link, Global.Folder.Extension);
			}
		}
Ejemplo n.º 3
0
		public static void Update()
		{
			foreach (var item in List)
			{
				var obj = item.Value;
				Console.Write($"\nChecking for update: {obj.Profile.Name}");

				if (string.IsNullOrEmpty(obj.Provider.Update))
					continue;

				var version = new Download().GetString(obj.Provider.Update);

				if (string.IsNullOrEmpty(version))
					continue;

				if (string.Equals(obj.Profile.Ver, version))
					continue;

				new Download().GetFileExtract(obj.Provider.Download, Global.Folder.Plugins);
			}
		}
Ejemplo n.º 4
0
		private void bgwThread_DoWork(object sender, DoWorkEventArgs e)
		{
			// Check x265, just incase user remove folder
			if (!Directory.Exists(Path.Combine(Global.Folder.Plugins, $"x265{Default.Compiler}")))
			{
				if (OS.IsWindows)
				{
					if (OS.Is64bit)
					{
						Default.Compiler = "gcc";
					}
					else
					{
						Default.Compiler = "msvc";
					}
				}
				else
				{
					Default.Compiler = "gcc";
				}
			}

			// Check x265 compiler binary
			if (Directory.Exists(Path.Combine(Global.Folder.Plugins, "x265gcc")))
				Plugin.IsExistHEVCGCC = true;

			if (Directory.Exists(Path.Combine(Global.Folder.Plugins, "x265icc")))
				Plugin.IsExistHEVCICC = true;

			if (Directory.Exists(Path.Combine(Global.Folder.Plugins, "x265msvc")))
				Plugin.IsExistHEVCMSVC = true;

#if !STEAM
			Console.Write("Checking version...");
			string version = new Download().GetString("https://x265.github.io/update/version.txt");
			Global.App.NewRelease = string.IsNullOrEmpty(version) ? false : string.Equals(Global.App.VersionRelease, version) ? false : true;
			Console.WriteLine($"{(Global.App.NewRelease ? "New version is available to download!" : "This is latest version!")}");
#endif

			// Profile
			Profile.Load();

			// Plugin 
			Plugin.Repo(); // check repo
			Plugin.Load(); // load to memory
			if (!Program.ApplyUpdate) { Plugin.Update(); Plugin.Load(); }

			// Extension
			Extension.Load();
			Extension.CheckDefault();
			if (!Program.ApplyUpdate) { Extension.Update(); Extension.Load(); }

			// Language
			if (!File.Exists(Path.Combine(Global.Folder.Language, $"{Default.Language}.ini")))
			{
				Default.Language = "en";
				Console.WriteLine($"\nLanguage file {Default.Language}.ini not found, make sure file name and CODE are same");
			}
			Language.Display();
			Console.WriteLine($"\nLoading language file: {Default.Language}.ini");

			// Detect AviSynth
			if (Plugin.IsExistAviSynth)
				Console.WriteLine("AviSynth detected!");
			else
				Console.WriteLine("AviSynth not detected!");

			// Format fix
			Console.WriteLine("Loading codec fingerprint");
			new Download().GetFile("https://github.com/Anime4000/IFME/raw/master/ifme/format.ini", Path.Combine(Global.Folder.App, "format.ini"));

			// AviSynth filter, allow IFME to find real file
			Console.WriteLine("Loading AviSynth filter");
			new Download().GetFile("https://github.com/Anime4000/IFME/raw/master/ifme/avisynthsource.code", Path.Combine(Global.Folder.App, "avisynthsource.code"));

			// Thanks to our donor
			Console.WriteLine("Loading our donor list :) you can see via \"About IFME\"");
			new Download().GetFile("http://x265.github.io/supporter.txt", Path.Combine(Global.Folder.App, "metauser.if"));

			// Save all settings
			Default.Save();

			// For fun
			Console.WriteLine("\nEstablishing battlefield control, standby!");
			Thread.Sleep(3000);
		}