ShareX/ShareX.Setup/Program.cs

486 lines
19 KiB
C#
Raw Permalink Normal View History

#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
2025-01-08 03:46:27 +03:00
Copyright (c) 2007-2025 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
2022-12-03 08:49:53 +03:00
using Microsoft.Win32;
2018-03-03 00:06:40 +03:00
using ShareX.HelpersLib;
using System;
using System.Diagnostics;
using System.IO;
2023-03-27 09:19:32 +03:00
using System.Text.RegularExpressions;
2014-12-10 22:25:20 +02:00
namespace ShareX.Setup
{
internal class Program
{
2016-08-27 03:28:05 +03:00
[Flags]
private enum SetupJobs
{
2016-08-27 03:28:05 +03:00
None = 0,
CreateSetup = 1,
CreatePortable = 1 << 1,
2022-10-23 08:46:34 +03:00
CreateDebug = 1 << 2,
CreateSteamFolder = 1 << 3,
CreateMicrosoftStoreFolder = 1 << 4,
CreateMicrosoftStoreDebugFolder = 1 << 5,
CompileAppx = 1 << 6,
2025-05-07 19:45:51 +03:00
DownloadTools = 1 << 7,
CreateChecksumFile = 1 << 8,
2022-10-23 08:46:34 +03:00
OpenOutputDirectory = 1 << 9,
2016-08-27 03:28:05 +03:00
2025-05-07 19:45:51 +03:00
Release = CreateSetup | CreatePortable | DownloadTools | OpenOutputDirectory,
Debug = CreateDebug | DownloadTools | OpenOutputDirectory,
Steam = CreateSteamFolder | DownloadTools | OpenOutputDirectory,
MicrosoftStore = CreateMicrosoftStoreFolder | CompileAppx | DownloadTools | OpenOutputDirectory,
MicrosoftStoreDebug = CreateMicrosoftStoreDebugFolder | CompileAppx | DownloadTools | OpenOutputDirectory
}
2022-11-08 07:52:26 +03:00
private static SetupJobs Job { get; set; } = SetupJobs.Release;
private static bool Silent { get; set; } = false;
2022-11-14 17:47:45 +03:00
private static bool AppVeyor { get; set; } = false;
2015-09-27 15:46:29 +03:00
2022-11-02 18:06:49 +03:00
private static string ParentDir;
private static string Configuration;
private static string AppVersion;
2022-12-03 08:49:53 +03:00
private static string WindowsKitsDir;
2022-11-08 07:47:30 +03:00
private static string SolutionPath => Path.Combine(ParentDir, "ShareX.sln");
2022-10-23 09:31:26 +03:00
private static string BinDir => Path.Combine(ParentDir, "ShareX", "bin", Configuration);
private static string SteamLauncherDir => Path.Combine(ParentDir, "ShareX.Steam", "bin", Configuration);
private static string ExecutablePath => Path.Combine(BinDir, "ShareX.exe");
private static string OutputDir => Path.Combine(ParentDir, "Output");
2016-08-27 03:02:43 +03:00
private static string PortableOutputDir => Path.Combine(OutputDir, "ShareX-portable");
2022-10-23 08:46:34 +03:00
private static string DebugOutputDir => Path.Combine(OutputDir, "ShareX-debug");
private static string SteamOutputDir => Path.Combine(OutputDir, "ShareX-Steam");
private static string MicrosoftStoreOutputDir => Path.Combine(OutputDir, "ShareX-MicrosoftStore");
2023-01-01 13:37:17 +03:00
private static string MicrosoftStoreDebugOutputDir => Path.Combine(OutputDir, "ShareX-MicrosoftStore-debug");
2017-04-22 20:38:19 +03:00
private static string SetupDir => Path.Combine(ParentDir, "ShareX.Setup");
private static string InnoSetupDir => Path.Combine(SetupDir, "InnoSetup");
private static string MicrosoftStorePackageFilesDir => Path.Combine(SetupDir, "MicrosoftStore");
2016-08-27 03:02:43 +03:00
2022-11-01 15:36:31 +03:00
private static string SetupPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-setup.exe");
2022-10-14 01:44:23 +03:00
private static string PortableZipPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-portable.zip");
2022-10-23 08:46:34 +03:00
private static string DebugZipPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-debug.zip");
2016-08-26 04:51:37 +03:00
private static string SteamUpdatesDir => Path.Combine(SteamOutputDir, "Updates");
2022-10-14 01:44:23 +03:00
private static string SteamZipPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-Steam.zip");
private static string MicrosoftStoreAppxPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}.appx");
2023-01-01 13:37:17 +03:00
private static string MicrosoftStoreDebugAppxPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-debug.appx");
private static string FFmpegPath => Path.Combine(OutputDir, "ffmpeg.exe");
private static string RecorderDevicesSetupPath => Path.Combine(OutputDir, $"recorder-devices-{RecorderDevicesVersion}-setup.exe");
2025-05-07 19:45:51 +03:00
private static string ExifToolPath => Path.Combine(OutputDir, "exiftool.exe");
2022-12-03 08:49:53 +03:00
private static string MakeAppxPath => Path.Combine(WindowsKitsDir, "x64", "makeappx.exe");
2016-08-27 03:02:43 +03:00
2022-11-02 18:06:49 +03:00
private const string InnoSetupCompilerPath = @"C:\Program Files (x86)\Inno Setup 6\ISCC.exe";
2025-01-24 05:12:57 +03:00
private const string FFmpegVersion = "7.1";
private static string FFmpegDownloadURL = $"https://github.com/ShareX/FFmpeg/releases/download/v{FFmpegVersion}/ffmpeg-{FFmpegVersion}-win64.zip";
private const string RecorderDevicesVersion = "0.12.10";
private static string RecorderDevicesDownloadURL = $"https://github.com/ShareX/RecorderDevices/releases/download/v{RecorderDevicesVersion}/recorder-devices-{RecorderDevicesVersion}-setup.exe";
2025-05-07 19:45:51 +03:00
private const string ExifToolVersion = "13.29";
private static string ExifToolDownloadURL = $"https://github.com/ShareX/ExifTool/releases/download/v{ExifToolVersion}/exiftool-{ExifToolVersion}-win64.zip";
private static void Main(string[] args)
{
2016-08-27 03:28:05 +03:00
Console.WriteLine("ShareX setup started.");
2016-08-26 03:01:05 +03:00
2022-10-15 01:28:50 +03:00
CheckArgs(args);
2016-08-27 03:28:05 +03:00
2022-11-02 18:06:49 +03:00
Console.WriteLine("Job: " + Job);
2016-08-27 03:28:05 +03:00
2022-11-02 18:06:49 +03:00
UpdatePaths();
2022-10-14 02:35:03 +03:00
2016-08-27 03:32:02 +03:00
if (Directory.Exists(OutputDir))
{
Console.WriteLine("Cleaning output directory: " + OutputDir);
Directory.Delete(OutputDir, true);
}
2025-05-07 19:45:51 +03:00
if (Job.HasFlag(SetupJobs.DownloadTools))
{
DownloadFFmpeg();
DownloadRecorderDevices();
2025-05-07 19:45:51 +03:00
DownloadExifTool();
}
2016-08-27 03:28:05 +03:00
if (Job.HasFlag(SetupJobs.CreateSetup))
{
CompileSetup();
}
if (Job.HasFlag(SetupJobs.CreatePortable))
2016-08-26 03:01:05 +03:00
{
2022-10-23 09:31:26 +03:00
CreateFolder(BinDir, PortableOutputDir, SetupJobs.CreatePortable);
2023-01-01 13:37:17 +03:00
CreateZipFile(PortableOutputDir, PortableZipPath);
2016-08-26 03:01:05 +03:00
}
2022-10-23 08:46:34 +03:00
if (Job.HasFlag(SetupJobs.CreateDebug))
{
2022-10-23 09:31:26 +03:00
CreateFolder(BinDir, DebugOutputDir, SetupJobs.CreateDebug);
2023-01-01 13:37:17 +03:00
CreateZipFile(DebugOutputDir, DebugZipPath);
2022-10-23 08:46:34 +03:00
}
2016-08-27 03:28:05 +03:00
if (Job.HasFlag(SetupJobs.CreateSteamFolder))
{
CreateSteamFolder();
2023-01-01 13:37:17 +03:00
CreateZipFile(SteamOutputDir, SteamZipPath);
2016-08-27 03:28:05 +03:00
}
if (Job.HasFlag(SetupJobs.CreateMicrosoftStoreFolder))
2017-04-21 02:17:34 +03:00
{
2022-10-23 09:31:26 +03:00
CreateFolder(BinDir, MicrosoftStoreOutputDir, SetupJobs.CreateMicrosoftStoreFolder);
2023-01-01 13:37:17 +03:00
if (Job.HasFlag(SetupJobs.CompileAppx))
{
CompileAppx(MicrosoftStoreOutputDir, MicrosoftStoreAppxPath);
}
2017-04-21 20:08:29 +03:00
}
if (Job.HasFlag(SetupJobs.CreateMicrosoftStoreDebugFolder))
2017-04-21 20:08:29 +03:00
{
2023-01-01 13:37:17 +03:00
CreateFolder(BinDir, MicrosoftStoreDebugOutputDir, SetupJobs.CreateMicrosoftStoreDebugFolder);
2017-04-21 02:17:34 +03:00
2023-01-01 13:37:17 +03:00
if (Job.HasFlag(SetupJobs.CompileAppx))
{
CompileAppx(MicrosoftStoreDebugOutputDir, MicrosoftStoreDebugAppxPath);
}
2021-11-10 11:57:10 +03:00
}
2022-11-14 17:47:45 +03:00
if (AppVeyor)
{
FileHelpers.CopyAll(OutputDir, ParentDir);
}
2022-11-08 07:52:26 +03:00
if (!Silent && Job.HasFlag(SetupJobs.OpenOutputDirectory))
2016-08-27 03:28:05 +03:00
{
2022-10-15 01:46:28 +03:00
FileHelpers.OpenFolder(OutputDir, false);
2016-08-27 03:28:05 +03:00
}
2015-09-06 12:32:34 +03:00
2016-08-27 03:28:05 +03:00
Console.WriteLine("ShareX setup successfully completed.");
2016-08-26 03:01:05 +03:00
}
2022-10-15 01:28:50 +03:00
private static void CheckArgs(string[] args)
{
2022-10-15 01:28:50 +03:00
CLIManager cli = new CLIManager(args);
cli.ParseCommands();
2022-11-08 07:52:26 +03:00
Silent = cli.IsCommandExist("Silent");
2022-11-14 17:47:45 +03:00
AppVeyor = cli.IsCommandExist("AppVeyor");
2022-10-15 01:28:50 +03:00
2022-11-08 07:52:26 +03:00
if (Silent)
{
2022-11-08 07:52:26 +03:00
Console.WriteLine("Silent: " + Silent);
2022-11-05 23:54:09 +03:00
}
2022-10-15 01:28:50 +03:00
2022-11-05 23:54:09 +03:00
CLICommand command = cli.GetCommand("Job");
2022-10-15 01:28:50 +03:00
2022-11-05 23:54:09 +03:00
if (command != null)
{
string parameter = command.Parameter;
2022-10-15 01:28:50 +03:00
2022-11-05 23:54:09 +03:00
if (Enum.TryParse(parameter, out SetupJobs job))
2022-10-15 01:28:50 +03:00
{
2022-11-05 23:54:09 +03:00
Job = job;
2022-10-15 01:28:50 +03:00
}
else
{
2022-11-05 23:54:09 +03:00
Console.WriteLine("Invalid job: " + parameter);
2022-10-15 01:28:50 +03:00
Environment.Exit(0);
}
}
}
2022-11-02 18:06:49 +03:00
private static void UpdatePaths()
2022-10-15 01:46:28 +03:00
{
2022-11-08 07:47:30 +03:00
ParentDir = Directory.GetCurrentDirectory();
if (!File.Exists(SolutionPath))
2022-11-02 18:06:49 +03:00
{
2022-11-08 07:47:30 +03:00
Console.WriteLine("Invalid parent directory: " + ParentDir);
2022-11-02 18:06:49 +03:00
ParentDir = FileHelpers.GetAbsolutePath(@"..\..\..\");
2022-11-08 07:47:30 +03:00
if (!File.Exists(SolutionPath))
{
Console.WriteLine("Invalid parent directory: " + ParentDir);
Environment.Exit(0);
}
2022-11-02 18:06:49 +03:00
}
Console.WriteLine("Parent directory: " + ParentDir);
if (Job.HasFlag(SetupJobs.CreateDebug))
{
Configuration = "Debug";
}
else if (Job.HasFlag(SetupJobs.CreateSteamFolder))
{
Configuration = "Steam";
}
else if (Job.HasFlag(SetupJobs.CreateMicrosoftStoreFolder))
{
Configuration = "MicrosoftStore";
}
else if (Job.HasFlag(SetupJobs.CreateMicrosoftStoreDebugFolder))
{
Configuration = "MicrosoftStoreDebug";
}
else
{
Configuration = "Release";
}
Console.WriteLine("Configuration: " + Configuration);
2022-10-15 01:46:28 +03:00
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(ExecutablePath);
2023-01-16 03:23:40 +03:00
AppVersion = versionInfo.ProductVersion;
2022-11-02 18:06:49 +03:00
Console.WriteLine("Application version: " + AppVersion);
2022-12-03 08:49:53 +03:00
2022-12-05 08:15:46 +03:00
if (Job.HasFlag(SetupJobs.CompileAppx))
{
string sdkInstallationFolder = RegistryHelpers.GetValueString(@"SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0",
"InstallationFolder", RegistryHive.LocalMachine);
string sdkProductVersion = RegistryHelpers.GetValueString(@"SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0",
"ProductVersion", RegistryHive.LocalMachine);
WindowsKitsDir = Path.Combine(sdkInstallationFolder, "bin", Helpers.NormalizeVersion(sdkProductVersion).ToString());
2022-12-03 08:49:53 +03:00
2022-12-05 08:15:46 +03:00
Console.WriteLine("Windows Kits directory: " + WindowsKitsDir);
}
2022-10-15 01:46:28 +03:00
}
2014-11-21 15:34:50 +02:00
private static void CompileSetup()
{
CompileISSFile("ShareX-setup.iss");
2022-11-01 15:36:31 +03:00
CreateChecksumFile(SetupPath);
}
2021-12-12 00:21:19 +03:00
private static void CompileISSFile(string fileName)
2016-08-26 06:41:34 +03:00
{
if (File.Exists(InnoSetupCompilerPath))
{
2021-12-12 00:21:19 +03:00
Console.WriteLine("Compiling setup file: " + fileName);
2016-08-26 06:41:34 +03:00
2018-12-06 21:51:41 +03:00
using (Process process = new Process())
{
ProcessStartInfo psi = new ProcessStartInfo()
{
FileName = InnoSetupCompilerPath,
2022-11-02 18:06:49 +03:00
WorkingDirectory = InnoSetupDir,
2022-11-02 23:31:57 +03:00
Arguments = $"/Q \"{fileName}\"",
2018-12-06 21:51:41 +03:00
UseShellExecute = false
};
process.StartInfo = psi;
process.Start();
process.WaitForExit();
}
2016-08-26 06:41:34 +03:00
2022-11-02 23:31:57 +03:00
Console.WriteLine("Setup file compiled: " + fileName);
}
else
{
Console.WriteLine("InnoSetup compiler is missing: " + InnoSetupCompilerPath);
}
2016-08-26 06:41:34 +03:00
}
2023-01-01 13:37:17 +03:00
private static void CompileAppx(string contentDirectory, string outputPackageName)
2022-11-01 15:36:31 +03:00
{
2023-01-01 13:37:17 +03:00
Console.WriteLine("Compiling appx file: " + contentDirectory);
2022-11-01 15:36:31 +03:00
using (Process process = new Process())
{
ProcessStartInfo psi = new ProcessStartInfo()
{
2022-12-03 08:49:53 +03:00
FileName = MakeAppxPath,
2023-01-01 13:37:17 +03:00
Arguments = $"pack /d \"{contentDirectory}\" /p \"{outputPackageName}\" /l /o",
2022-11-04 21:30:39 +03:00
UseShellExecute = false
2022-11-01 15:36:31 +03:00
};
process.StartInfo = psi;
process.Start();
process.WaitForExit();
}
2023-01-01 13:37:17 +03:00
Console.WriteLine("Appx file compiled: " + outputPackageName);
2022-11-01 15:51:44 +03:00
2023-01-01 13:37:17 +03:00
CreateChecksumFile(outputPackageName);
2022-11-01 15:36:31 +03:00
}
2015-09-06 12:32:34 +03:00
private static void CreateSteamFolder()
{
2022-11-01 15:36:31 +03:00
Console.WriteLine("Creating Steam folder: " + SteamOutputDir);
2016-08-26 04:51:37 +03:00
if (Directory.Exists(SteamOutputDir))
2015-09-06 12:32:34 +03:00
{
2016-08-26 04:51:37 +03:00
Directory.Delete(SteamOutputDir, true);
2015-09-06 12:32:34 +03:00
}
2016-08-26 04:51:37 +03:00
Directory.CreateDirectory(SteamOutputDir);
2015-09-06 12:32:34 +03:00
2022-11-02 20:04:28 +03:00
FileHelpers.CopyFiles(Path.Combine(SteamLauncherDir, "ShareX_Launcher.exe"), SteamOutputDir);
FileHelpers.CopyFiles(Path.Combine(SteamLauncherDir, "steam_appid.txt"), SteamOutputDir);
FileHelpers.CopyFiles(Path.Combine(SteamLauncherDir, "installscript.vdf"), SteamOutputDir);
FileHelpers.CopyFiles(SteamLauncherDir, SteamOutputDir, "*.dll");
2015-09-06 12:32:34 +03:00
2022-10-23 09:31:26 +03:00
CreateFolder(BinDir, SteamUpdatesDir, SetupJobs.CreateSteamFolder);
2015-09-06 12:32:34 +03:00
}
2017-04-21 20:08:29 +03:00
private static void CreateFolder(string source, string destination, SetupJobs job)
2017-04-21 02:17:34 +03:00
{
2017-04-21 20:08:29 +03:00
Console.WriteLine("Creating folder: " + destination);
2017-04-21 02:17:34 +03:00
2017-04-21 20:08:29 +03:00
if (Directory.Exists(destination))
2017-04-21 02:17:34 +03:00
{
2017-04-21 20:08:29 +03:00
Directory.Delete(destination, true);
2017-04-21 02:17:34 +03:00
}
2017-04-21 20:08:29 +03:00
Directory.CreateDirectory(destination);
2017-04-21 02:17:34 +03:00
2022-11-02 20:04:28 +03:00
FileHelpers.CopyFiles(Path.Combine(source, "ShareX.exe"), destination);
FileHelpers.CopyFiles(Path.Combine(source, "ShareX.exe.config"), destination);
FileHelpers.CopyFiles(source, destination, "*.dll");
2022-10-23 08:46:34 +03:00
if (job == SetupJobs.CreateDebug || job == SetupJobs.CreateMicrosoftStoreDebugFolder)
2014-11-14 01:28:07 +02:00
{
2022-11-02 20:04:28 +03:00
FileHelpers.CopyFiles(source, destination, "*.pdb");
2014-11-14 01:28:07 +02:00
}
2022-11-02 20:04:28 +03:00
FileHelpers.CopyFiles(Path.Combine(ParentDir, "Licenses"), Path.Combine(destination, "Licenses"), "*.txt");
2016-08-28 01:08:18 +03:00
if (job != SetupJobs.CreateMicrosoftStoreFolder && job != SetupJobs.CreateMicrosoftStoreDebugFolder)
{
if (File.Exists(RecorderDevicesSetupPath))
{
FileHelpers.CopyFiles(RecorderDevicesSetupPath, destination);
}
FileHelpers.CopyFiles(Path.Combine(source, "ShareX_File_Icon.ico"), destination);
FileHelpers.CopyFiles(Path.Combine(source, "ShareX_NativeMessagingHost.exe"), destination);
FileHelpers.CopyFiles(Path.Combine(source, "host-manifest-chrome.json"), destination);
FileHelpers.CopyFiles(Path.Combine(source, "host-manifest-firefox.json"), destination);
}
2023-03-27 09:19:32 +03:00
foreach (string directory in Directory.GetDirectories(source))
2015-01-04 18:53:04 +02:00
{
2023-03-27 09:19:32 +03:00
string language = Path.GetFileName(directory);
if (Regex.IsMatch(language, "^[a-z]{2}(?:-[A-Z]{2})?$"))
{
FileHelpers.CopyFiles(Path.Combine(source, language), Path.Combine(destination, "Languages", language), "*.resources.dll");
}
2015-01-04 18:53:04 +02:00
}
if (File.Exists(FFmpegPath))
{
2022-11-02 20:04:28 +03:00
FileHelpers.CopyFiles(FFmpegPath, destination);
}
2025-05-07 19:45:51 +03:00
if (File.Exists(ExifToolPath))
{
FileHelpers.CopyFiles(ExifToolPath, destination);
FileHelpers.CopyAll(Path.Combine(OutputDir, "exiftool_files"), Path.Combine(destination, "exiftool_files"));
}
FileHelpers.CopyAll(Path.Combine(ParentDir, @"ShareX.ScreenCaptureLib\Stickers"), Path.Combine(destination, "Stickers"));
2018-03-16 22:58:25 +03:00
2022-10-14 01:44:23 +03:00
if (job == SetupJobs.CreatePortable)
2017-04-21 02:17:34 +03:00
{
2022-10-14 01:44:23 +03:00
FileHelpers.CreateEmptyFile(Path.Combine(destination, "Portable"));
2022-11-02 23:31:57 +03:00
}
else if (job == SetupJobs.CreateMicrosoftStoreFolder || job == SetupJobs.CreateMicrosoftStoreDebugFolder)
{
FileHelpers.CopyAll(MicrosoftStorePackageFilesDir, destination);
}
Console.WriteLine("Folder created: " + destination);
}
2014-01-12 18:05:31 +02:00
2022-11-01 15:36:31 +03:00
private static void CreateZipFile(string source, string archivePath)
{
Console.WriteLine("Creating zip file: " + archivePath);
2022-11-02 18:06:49 +03:00
ZipManager.Compress(source, archivePath);
2022-11-01 15:36:31 +03:00
CreateChecksumFile(archivePath);
}
private static void DownloadFFmpeg()
2016-08-27 20:57:46 +03:00
{
if (!File.Exists(FFmpegPath))
{
2022-11-02 19:27:16 +03:00
string fileName = Path.GetFileName(FFmpegDownloadURL);
string filePath = Path.Combine(OutputDir, fileName);
Console.WriteLine("Downloading: " + FFmpegDownloadURL);
2023-10-29 09:58:20 +03:00
WebHelpers.DownloadFileAsync(FFmpegDownloadURL, filePath).GetAwaiter().GetResult();
2022-11-02 19:27:16 +03:00
Console.WriteLine("Extracting: " + filePath);
2022-11-01 18:22:43 +03:00
ZipManager.Extract(filePath, OutputDir, false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase));
}
2016-08-27 20:57:46 +03:00
}
2022-11-01 15:36:31 +03:00
private static void DownloadRecorderDevices()
{
if (!File.Exists(RecorderDevicesSetupPath))
{
string fileName = Path.GetFileName(RecorderDevicesDownloadURL);
string filePath = Path.Combine(OutputDir, fileName);
Console.WriteLine("Downloading: " + RecorderDevicesDownloadURL);
WebHelpers.DownloadFileAsync(RecorderDevicesDownloadURL, filePath).GetAwaiter().GetResult();
}
}
2025-05-07 19:45:51 +03:00
private static void DownloadExifTool()
{
if (!File.Exists(ExifToolPath))
{
string fileName = Path.GetFileName(ExifToolDownloadURL);
string filePath = Path.Combine(OutputDir, fileName);
Console.WriteLine("Downloading: " + ExifToolDownloadURL);
WebHelpers.DownloadFileAsync(ExifToolDownloadURL, filePath).GetAwaiter().GetResult();
Console.WriteLine("Extracting: " + filePath);
ZipManager.Extract(filePath, OutputDir);
}
}
2022-11-01 15:36:31 +03:00
private static void CreateChecksumFile(string filePath)
{
if (Job.HasFlag(SetupJobs.CreateChecksumFile))
{
Console.WriteLine("Creating checksum file: " + filePath);
Helpers.CreateChecksumFile(filePath);
}
}
}
}