コード例 #1
0
        private static bool BuildSdk(BuildFlags Flags)
        {
            PrintColorMessage("Copying Plugin SDK...", ConsoleColor.Cyan);

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

            return(true);
        }
コード例 #2
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();
        }
コード例 #3
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");
            }
        }