forked from Mercury/2dxAutoClip
remove FFMPEG from artifacts, as it gets downloaded automatically on application startup
This commit is contained in:
parent
944c6c90a0
commit
d4c662ca4c
Binary file not shown.
|
@ -4,10 +4,12 @@ using System.Text;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using NAudio.CoreAudioApi;
|
using NAudio.CoreAudioApi;
|
||||||
using NAudio.Wave;
|
using NAudio.Wave;
|
||||||
|
using System.Net;
|
||||||
// ReSharper disable PossibleInvalidCastExceptionInForeachLoop
|
// ReSharper disable PossibleInvalidCastExceptionInForeachLoop
|
||||||
|
|
||||||
namespace _2dxAutoClip;
|
namespace _2dxAutoClip;
|
||||||
#pragma warning disable CA1416
|
#pragma warning disable CA1416
|
||||||
|
#pragma warning disable SYSLIB0014
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
@ -25,7 +27,7 @@ class Program
|
||||||
|
|
||||||
private static async Task Main(string[] args)
|
private static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
// Load settings from prop.txt
|
DownloadFFmpeg();
|
||||||
LoadSettingsFromPropFile();
|
LoadSettingsFromPropFile();
|
||||||
|
|
||||||
var gameProcesses = Process.GetProcessesByName(_gameProcessName);
|
var gameProcesses = Process.GetProcessesByName(_gameProcessName);
|
||||||
|
@ -39,7 +41,32 @@ class Program
|
||||||
Console.WriteLine($"Unable to find {_gameProcessName}. Is the game running and TickerHook enabled?");
|
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()
|
private static void LoadSettingsFromPropFile()
|
||||||
{
|
{
|
||||||
const string filePath = "prop.txt";
|
const string filePath = "prop.txt";
|
||||||
|
|
Loading…
Reference in a new issue