Exemple #1
0
        private static void CopyFFmpeg(string destination, bool include32bit, bool include64bit)
        {
            if (include32bit)
            {
                if (!File.Exists(FFmpeg32bit))
                {
                    string filename = SetupHelpers.DownloadFile("https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.2-win64-static.zip");
                    ZipManager.Extract(filename, ".", false, new List <string>()
                    {
                        "ffmpeg.exe"
                    });
                    File.Move("ffmpeg.exe", FFmpeg32bit);
                }

                SetupHelpers.CopyFile(FFmpeg32bit, destination);
            }

            if (include64bit)
            {
                if (!File.Exists(FFmpeg64bit))
                {
                    string filename = SetupHelpers.DownloadFile("https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.2-win32-static.zip");
                    ZipManager.Extract(filename, ".", false, new List <string>()
                    {
                        "ffmpeg.exe"
                    });
                    File.Move("ffmpeg.exe", FFmpeg64bit);
                }

                SetupHelpers.CopyFile(FFmpeg64bit, destination);
            }
        }
Exemple #2
0
        private static void CopyFFmpeg(string destination, bool include32bit, bool include64bit)
        {
            if (include32bit)
            {
                if (!File.Exists(FFmpeg32bit))
                {
                    string filename = SetupHelpers.DownloadFile("https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.3.1-win32-static.zip");
                    ZipManager.Extract(filename, ".", false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase), 1_000_000_000);
                    File.Move("ffmpeg.exe", FFmpeg32bit);
                }

                SetupHelpers.CopyFile(FFmpeg32bit, destination);
            }

            if (include64bit)
            {
                if (!File.Exists(FFmpeg64bit))
                {
                    string filename = SetupHelpers.DownloadFile("https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.3.1-win64-static.zip");
                    ZipManager.Extract(filename, ".", false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase), 1_000_000_000);
                    File.Move("ffmpeg.exe", FFmpeg64bit);
                }

                SetupHelpers.CopyFile(FFmpeg64bit, destination);
            }
        }
Exemple #3
0
        private static void CopyFFmpeg(string destination, bool include32bit, bool include64bit)
        {
            if (include32bit)
            {
                if (!File.Exists(FFmpeg32bit))
                {
                    string filePath = SetupHelpers.DownloadFile("https://github.com/ShareX/FFmpeg/releases/download/v4.3.1/ffmpeg-4.3.1-win32.zip");
                    ZipManager.Extract(filePath, ".", false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase), 100_000_000);
                    File.Move("ffmpeg.exe", FFmpeg32bit);
                }

                SetupHelpers.CopyFile(FFmpeg32bit, destination);
            }

            if (include64bit)
            {
                if (!File.Exists(FFmpeg64bit))
                {
                    string filePath = SetupHelpers.DownloadFile("https://github.com/ShareX/FFmpeg/releases/download/v4.3.1/ffmpeg-4.3.1-win64.zip");
                    ZipManager.Extract(filePath, ".", false, entry => entry.Name.Equals("ffmpeg.exe", StringComparison.OrdinalIgnoreCase), 100_000_000);
                    File.Move("ffmpeg.exe", FFmpeg64bit);
                }

                SetupHelpers.CopyFile(FFmpeg64bit, destination);
            }
        }
Exemple #4
0
        private static void CreateSteamFolder()
        {
            Console.WriteLine("Creating Steam folder:" + SteamOutputDir);

            if (Directory.Exists(SteamOutputDir))
            {
                Directory.Delete(SteamOutputDir, true);
            }

            Directory.CreateDirectory(SteamOutputDir);

            SetupHelpers.CopyFile(Path.Combine(SteamLauncherDir, "ShareX_Launcher.exe"), SteamOutputDir);
            SetupHelpers.CopyFile(Path.Combine(SteamLauncherDir, "steam_appid.txt"), SteamOutputDir);
            SetupHelpers.CopyFile(Path.Combine(SteamLauncherDir, "installscript.vdf"), SteamOutputDir);
            SetupHelpers.CopyFiles(SteamLauncherDir, "*.dll", SteamOutputDir);

            CreateFolder(SteamDir, SteamUpdatesDir, SetupJobs.CreateSteamFolder);
        }
Exemple #5
0
        private static void CreateFolder(string source, string destination, SetupJobs job)
        {
            Console.WriteLine("Creating folder: " + destination);

            if (Directory.Exists(destination))
            {
                Directory.Delete(destination, true);
            }

            Directory.CreateDirectory(destination);

            SetupHelpers.CopyFile(Path.Combine(source, "ShareX.exe"), destination);
            SetupHelpers.CopyFile(Path.Combine(source, "ShareX.exe.config"), destination);
            SetupHelpers.CopyFiles(source, "*.dll", destination);

            if (job == SetupJobs.CreateWindowsStoreDebugFolder)
            {
                SetupHelpers.CopyFiles(source, "*.pdb", destination);
            }

            SetupHelpers.CopyFiles(Path.Combine(ParentDir, "Licenses"), "*.txt", Path.Combine(destination, "Licenses"));

            if (job != SetupJobs.CreateWindowsStoreFolder && job != SetupJobs.CreateWindowsStoreDebugFolder)
            {
                if (!File.Exists(RecorderDevicesSetupPath))
                {
                    CompileISSFile("Recorder-devices-setup.iss");
                }

                SetupHelpers.CopyFile(RecorderDevicesSetupPath, destination);

                SetupHelpers.CopyFile(Path.Combine(NativeMessagingHostDir, "ShareX_NativeMessagingHost.exe"), destination);
            }

            string[] languages = new string[] { "de", "es", "es-MX", "fa-IR", "fr", "hu", "id-ID", "it-IT", "ko-KR", "nl-NL", "pt-BR", "pt-PT", "ru", "tr", "uk", "vi-VN", "zh-CN", "zh-TW" };

            foreach (string language in languages)
            {
                SetupHelpers.CopyFiles(Path.Combine(source, language), "*.resources.dll", Path.Combine(destination, "Languages", language));
            }

            Helpers.CopyAll(Path.Combine(ParentDir, @"ShareX.ScreenCaptureLib\Stickers"), Path.Combine(destination, "Stickers"));

            if (job == SetupJobs.CreatePortableAppsFolder)
            {
                Helpers.CreateEmptyFile(Path.Combine(destination, "PortableApps"));
            }
            else if (job == SetupJobs.CreateWindowsStoreFolder || job == SetupJobs.CreateWindowsStoreDebugFolder)
            {
                Helpers.CopyAll(WindowsStorePackageFilesDir, destination);
            }
            else if (job == SetupJobs.CreatePortable)
            {
                Helpers.CreateEmptyFile(Path.Combine(destination, "Portable"));

                //FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(releaseDir, "ShareX.exe"));
                //string zipFilename = string.Format("ShareX-{0}.{1}.{2}-portable.zip", versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart);
                string zipPath = Path.Combine(OutputDir, "ShareX-portable.zip");
                ZipManager.Compress(Path.GetFullPath(destination), Path.GetFullPath(zipPath));

                Directory.Delete(destination, true);
            }

            Console.WriteLine("Folder created.");
        }