Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            ProgramArgs = ParseArgs(args);

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                if (Restart("-cleanup"))
                {
                    return;
                }

                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.CleanupAppxSignature();
                Build.CleanupBuildEnvironment();

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.BuildPublicHeaderFiles();
            }
            else if (ProgramArgs.ContainsKey("-graph"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment("changelog", true, false);

                if (Win32.GetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), out ConsoleMode mode))
                {
                    Win32.SetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), mode | ConsoleMode.ENABLE_VIRTUAL_TERMINAL_PROCESSING);
                }

                Console.WriteLine(Build.GetBuildLogString());

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.CopyKProcessHacker(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug
                    );

                BuildSdk(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                    );
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose
                                         ))
                {
                    return;
                }

                BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose);

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-bin"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment("bin", false, true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment("debug", true, true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!BuildSdk(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                        ))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.BuildDebug))
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment("nightly", true, true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }
                if (!Build.BuildChecksumsFile())
                {
                    return;
                }
                if (!Build.BuildUpdateSignature())
                {
                    return;
                }

                if (Build.AppveyorUploadBuildFiles())
                {
                    Build.WebServiceUpdateConfig();
                }
            }
            else if (ProgramArgs.ContainsKey("-appxbuild"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment("appx", true, true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }

                Build.BuildAppxPackage(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose);

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-appxmakecert"))
            {
                if (Restart("-appxmakecert"))
                {
                    return;
                }

                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment("appxcert", true, true);

                Build.BuildAppxSignature();

                Build.ShowBuildStats();
            }
            else
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment("release", true, true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }
                Build.BuildPdbZip();
                Build.BuildSdkZip();
                Build.BuildSrcZip();

                Build.ShowBuildStats();
            }
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            ProgramArgs = ParseArgs(args);

            if (!Build.InitializeBuildEnvironment())
            {
                return;
            }

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                Build.CleanupBuildEnvironment();
                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                Build.BuildPublicHeaderFiles();
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                Build.CopyKProcessHacker(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug
                    );

                Build.BuildSdk(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                    );
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                Build.BuildSdk(
                    BuildFlags.Build32bit |
                    BuildFlags.Build64bit |
                    BuildFlags.BuildVerbose
                    );

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-bin"))
            {
                Build.SetupBuildEnvironment(false);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSdk(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                        ))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.BuildDebug))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyTextFiles())
                {
                    Environment.Exit(1);
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    Environment.Exit(1);
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildBinZip())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildSetupExe())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildPdbZip())
                {
                    Environment.Exit(1);
                }
                //if (!Build.BuildSdkZip())
                //    Environment.Exit(1);
                //if (!Build.BuildSrcZip())
                //    Environment.Exit(1);
                //if (!Build.BuildChecksumsFile())
                //    Environment.Exit(1);
                if (!Build.BuildDeployUploadArtifacts())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildDeployUpdateConfig())
                {
                    Environment.Exit(1);
                }
            }
            else
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }
                Build.BuildPdbZip();
                Build.BuildSdkZip();
                //Build.BuildSrcZip();
                Build.BuildChecksumsFile();
                Build.ShowBuildStats();
            }

            Environment.Exit(Environment.ExitCode);
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            if (Win32.GetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), out ConsoleMode mode))
            {
                Win32.SetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), mode | ConsoleMode.ENABLE_VIRTUAL_TERMINAL_PROCESSING);
            }

            ProgramArgs = ParseArgs(args);

            if (!Build.InitializeBuildEnvironment())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            if (ProgramArgs.ContainsKey("-updaterev"))
            {
                PrintColorMessage("Updating header version...", ConsoleColor.Cyan);
                Build.ShowBuildEnvironment();
                Build.UpdateHeaderFileVersion();
                return;
            }

            if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                PrintColorMessage("Building public headers...", ConsoleColor.Cyan);
                Build.BuildPublicHeaderFiles();
                return;
            }

            if (ProgramArgs.ContainsKey("-sign"))
            {
                Build.BuildKphSignatureFile();
                return;
            }

            if (ProgramArgs.ContainsKey("-sdk"))
            {
                PrintColorMessage("Copying SDK headers...", ConsoleColor.Cyan);
                if (!Build.CopyPluginSdkHeaders())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                PrintColorMessage("Copying version headers...", ConsoleColor.Cyan);
                if (!Build.CopyVersionHeader())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                PrintColorMessage("Building sdk resource header...", ConsoleColor.Cyan);
                if (!Build.FixupResourceHeader())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                PrintColorMessage("Copying plugin linker files...", ConsoleColor.Cyan);
                if (!Build.CopyLibFiles())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                Build.CleanupBuildEnvironment();
                Build.ShowBuildStats();
                return;
            }

            if (ProgramArgs.ContainsKey("-exe"))
            {
                if (!Build.BuildBinZip())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                if (!Build.BuildSetupExe())
                {
                    Build.CleanupBuildEnvironment();
                    return;
                }

                Build.BuildSrcZip();
                Build.BuildSdkZip();
                return;
            }

            PrintColorMessage("Setting up build environment...", ConsoleColor.Cyan);
            Build.ShowBuildEnvironment();
            Build.BuildSecureFiles();

            if (!Build.BuildSolution("ProcessHacker.sln"))
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Building KPH signature...", ConsoleColor.Cyan);
            if (!Build.BuildKphSignatureFile())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying text files...", ConsoleColor.Cyan);
            if (!Build.CopyTextFiles())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying KPH driver...", ConsoleColor.Cyan);
            if (!Build.CopyKProcessHacker())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying SDK headers...", ConsoleColor.Cyan);
            if (!Build.CopyPluginSdkHeaders())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying version headers...", ConsoleColor.Cyan);
            if (!Build.CopyVersionHeader())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Building sdk resource header...", ConsoleColor.Cyan);
            if (!Build.FixupResourceHeader())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying plugin linker files...", ConsoleColor.Cyan);
            if (!Build.CopyLibFiles())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            if (!Build.BuildSolution("plugins\\Plugins.sln"))
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Copying Wow64 support files...", ConsoleColor.Cyan);
            if (!Build.CopyWow64Files())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Building build-setup.exe...", ConsoleColor.Cyan);
            if (!Build.BuildSetupExe())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Building build-bin.zip...", ConsoleColor.Cyan);
            if (!Build.BuildBinZip())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            //Build.BuildSrcZip();
            //Build.BuildSdkZip();
            //Build.BuildPdbZip();

            PrintColorMessage("Building build-checksums.txt...", ConsoleColor.Cyan);
            if (!Build.BuildChecksumsFile())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            PrintColorMessage("Building release signature...", ConsoleColor.Cyan);
            Build.BuildUpdateSignature();

            PrintColorMessage("Moving build-setup.exe...", ConsoleColor.Cyan);
            if (!Build.MoveBuildFiles())
            {
                Build.CleanupBuildEnvironment();
                return;
            }

            Build.UpdateBuildWebService();
            Build.CleanupBuildEnvironment();
            Build.ShowBuildStats();

            Console.ReadKey();
        }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            ProgramArgs = ParseArgs(args);

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }


                Build.CleanupBuildEnvironment();
                return;
            }
            else if (ProgramArgs.ContainsKey("-updaterev"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.UpdateHeaderFileVersion();
                return;
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.BuildPublicHeaderFiles();
                return;
            }
            else if (ProgramArgs.ContainsKey("-sign"))
            {
                Build.BuildKphSignatureFile(false);
                return;
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }

                if (!Build.CopyVersionHeader())
                {
                    return;
                }

                if (!Build.FixupResourceHeader())
                {
                    return;
                }

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                Build.ShowBuildStats(false);
                return;
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }

                if (!Build.CopyVersionHeader())
                {
                    return;
                }

                if (!Build.FixupResourceHeader())
                {
                    return;
                }

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                Build.ShowBuildStats(false);
                return;
            }
            else if (ProgramArgs.ContainsKey("-bin"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }

                if (!Build.CopyTextFiles())
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }

                if (!Build.CopyVersionHeader())
                {
                    return;
                }

                if (!Build.FixupResourceHeader())
                {
                    return;
                }

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }

                Build.ShowBuildStats(false);
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment(true);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, true, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(true))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(true))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(true))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, true, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(true))
                {
                    return;
                }

                Build.ShowBuildStats(true);
            }
            else if (ProgramArgs.ContainsKey("-release"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }

                Build.BuildSdkZip();

                Build.BuildSrcZip();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }

                if (!Build.BuildChecksumsFile())
                {
                    return;
                }
                if (!Build.BuildUpdateSignature())
                {
                    return;
                }

                if (Build.AppveyorUploadBuildFiles())
                {
                    Build.WebServiceUpdateConfig();
                }
            }
            else
            {
                Console.WriteLine("Invalid arguments.\n");
            }
        }