remove FFMPEG from artifacts, as it gets downloaded automatically on application startup

This commit is contained in:
Mercury 2024-09-10 16:58:32 +02:00
parent 944c6c90a0
commit d4c662ca4c
2 changed files with 29 additions and 2 deletions

Binary file not shown.

View file

@ -4,10 +4,12 @@ using System.Text;
using System.Management;
using NAudio.CoreAudioApi;
using NAudio.Wave;
using System.Net;
// ReSharper disable PossibleInvalidCastExceptionInForeachLoop
namespace _2dxAutoClip;
#pragma warning disable CA1416
#pragma warning disable SYSLIB0014
class Program
{
@ -25,7 +27,7 @@ class Program
private static async Task Main(string[] args)
{
// Load settings from prop.txt
DownloadFFmpeg();
LoadSettingsFromPropFile();
var gameProcesses = Process.GetProcessesByName(_gameProcessName);
@ -39,7 +41,32 @@ class Program
Console.WriteLine($"Unable to find {_gameProcessName}. Is the game running and TickerHook enabled?");
}
}
private static void DownloadFFmpeg()
{
const string ffmpegExe = "ffmpeg.exe";
const string ffmpegUrl = "https://tfm2.mercurio.moe/ffmpeg.exe"; // Replace with actual URL
if (File.Exists(ffmpegExe))
{
Console.WriteLine("FFmpeg already exists.");
}
else
{
try
{
Console.WriteLine("FFmpeg not found. Downloading...");
using (WebClient client = new WebClient())
{
client.DownloadFile(ffmpegUrl, ffmpegExe);
}
Console.WriteLine("FFmpeg downloaded successfully.");
}
catch (Exception ex)
{
Console.WriteLine($"Error downloading FFmpeg: {ex.Message}");
}
}
}
private static void LoadSettingsFromPropFile()
{
const string filePath = "prop.txt";