mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 03:00:22 +12:00
Code refactoring
This commit is contained in:
parent
b6dd838cfe
commit
ec02677775
|
@ -402,7 +402,13 @@ private static void DownloadFFmpeg()
|
|||
{
|
||||
if (!File.Exists(FFmpegPath))
|
||||
{
|
||||
string filePath = SetupHelpers.DownloadFile(FFmpegDownloadURL);
|
||||
string fileName = Path.GetFileName(FFmpegDownloadURL);
|
||||
string filePath = Path.Combine(OutputDir, fileName);
|
||||
|
||||
Console.WriteLine("Downloading: " + FFmpegDownloadURL);
|
||||
URLHelpers.DownloadFile(FFmpegDownloadURL, filePath);
|
||||
|
||||
Console.WriteLine("Extracting: " + filePath);
|
||||
ZipManager.Extract(filePath, OutputDir, false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,18 +33,6 @@ namespace ShareX.Setup
|
|||
{
|
||||
internal class SetupHelpers
|
||||
{
|
||||
public static string DownloadFile(string url)
|
||||
{
|
||||
string fileName = Path.GetFileName(url);
|
||||
string filePath = Path.GetFullPath(fileName);
|
||||
|
||||
Console.WriteLine($"Downloading: \"{url}\" -> \"{filePath}\"");
|
||||
|
||||
URLHelpers.DownloadFile(url, filePath);
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public static void CopyFile(string path, string toFolder)
|
||||
{
|
||||
CopyFiles(new string[] { path }, toFolder);
|
||||
|
|
Loading…
Reference in a new issue