Skip to content

Commit

Permalink
Merge pull request #10 from processhacker/master
Browse files Browse the repository at this point in the history
[pull] master from processhacker:master
  • Loading branch information
pull[bot] authored Sep 23, 2020
2 parents 45139a0 + 636a86b commit bc13bcb
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 179 deletions.
15 changes: 15 additions & 0 deletions build/build_verbose.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
@setlocal enableextensions
@cd /d "%~dp0\..\"

call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64

msbuild ProcessHacker.sln -property:Configuration=Debug -property:Platform=Win32 -verbosity:normal
msbuild ProcessHacker.sln -property:Configuration=Debug -property:Platform=x64 -verbosity:normal

tools\CustomBuildTool\bin\Release\CustomBuildTool.exe -sdk

msbuild Plugins\Plugins.sln -property:Configuration=Debug -property:Platform=Win32 -verbosity:normal
msbuild Plugins\Plugins.sln -property:Configuration=Debug -property:Platform=x64 -verbosity:normal

pause
285 changes: 151 additions & 134 deletions tools/CustomBuildTool/Build.cs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tools/CustomBuildTool/CustomBuildTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<None Include="Properties\PublishProfiles\32bit.pubxml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
</ItemGroup>
</Project>
13 changes: 8 additions & 5 deletions tools/CustomBuildTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ public static void Main(string[] args)
))
return;

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

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

if (!Build.BuildSolution("plugins\\Plugins.sln",
Expand All @@ -99,6 +96,8 @@ public static void Main(string[] args)
))
return;

if (!Build.CopyTextFiles())
return;
if (!Build.CopyWow64Files(BuildFlags.None))
return;
if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
Expand Down Expand Up @@ -179,6 +178,8 @@ public static void Main(string[] args)
))
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))
Expand Down Expand Up @@ -224,6 +225,8 @@ public static void Main(string[] args)
))
return;

if (!Build.CopyTextFiles())
return;
if (!Build.CopyWow64Files(BuildFlags.None))
return;
if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
Expand Down
86 changes: 48 additions & 38 deletions tools/CustomBuildTool/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static string HashFile(string FileName)

public static string GetPath(string FileName)
{
return "\\tools\\CustomSignTool\\Resources\\" + FileName;
return "tools\\CustomSignTool\\Resources\\" + FileName;
}

public static string GetCustomSignToolFilePath()
Expand Down Expand Up @@ -249,23 +249,24 @@ public static class VisualStudio

public static string GetOutputDirectoryPath()
{
string folder = Environment.CurrentDirectory + "\\build\\output";
return Environment.CurrentDirectory + "\\build\\output";
}

public static void CreateOutputDirectory()
{
string folder = GetOutputDirectoryPath();

if (File.Exists(folder))
return folder;
return;

try
{
Directory.CreateDirectory(folder);

return folder;
}
catch (Exception ex)
{
Program.PrintColorMessage("Error creating output directory. " + ex, ConsoleColor.Red);
Program.PrintColorMessage("Error creating output directory: " + ex, ConsoleColor.Red);
}

return null;
}

public static VisualStudioInstance GetVisualStudioInstance()
Expand Down Expand Up @@ -349,6 +350,13 @@ public static string GetVswhereFilePath()
return file;
}

{
string file = Win32.SearchFile("vswhere.exe");

if (File.Exists(file))
return file;
}

return null;
}

Expand Down Expand Up @@ -408,36 +416,38 @@ public static string GetMsbuildFilePath()
return MsBuildFilePath;
}

//private static readonly string[] GitPathArray =
//{
// "%ProgramFiles%\\Git\\bin\\git.exe",
// "%ProgramFiles(x86)%\\Git\\bin\\git.exe",
// "%ProgramW6432%\\Git\\bin\\git.exe"
//};
//
//public static string GetGitFilePath()
//{
// string git = Win32.SearchFile("git.exe");
//
// if (File.Exists(git))
// return git;
//
// foreach (string path in GitPathArray)
// {
// git = Environment.ExpandEnvironmentVariables(path);
//
// if (File.Exists(git))
// return git;
// }
//
// return null;
//}
//
//public static string GetGitWorkPath(string Directory)
//{
// return "--git-dir=\"" + Directory + "\\.git\" --work-tree=\"" + Directory + "\" "; ;
//}
//
public static string GetGitFilePath()
{
string[] gitPathArray =
{
"%ProgramFiles%\\Git\\bin\\git.exe",
"%ProgramFiles(x86)%\\Git\\bin\\git.exe",
"%ProgramW6432%\\Git\\bin\\git.exe"
};

foreach (string path in gitPathArray)
{
string file = Environment.ExpandEnvironmentVariables(path);

if (File.Exists(file))
return file;
}

{
string file = Win32.SearchFile("git.exe");

if (File.Exists(file))
return file;
}

return null;
}

public static string GetGitWorkPath()
{
return "--git-dir=\"" + Environment.CurrentDirectory + "\\.git\" --work-tree=\"" + Environment.CurrentDirectory + "\" "; ;
}

//public static string GetMsbuildFilePath()
//{
// VisualStudioInstance instance;
Expand Down
Binary file modified tools/CustomBuildTool/bin/Release/CustomBuildTool.exe
Binary file not shown.
Binary file removed tools/CustomBuildTool/bin/Release/git2-106a5f2.dll
Binary file not shown.
Binary file removed tools/CustomBuildTool/bin/Release/git2-106a5f2.pdb
Binary file not shown.
24 changes: 23 additions & 1 deletion tools/CustomBuildTool/config.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
using System;
/*
* Process Hacker Toolchain -
* Build script
*
* Copyright (C) dmex
*
* This file is part of Process Hacker.
*
* Process Hacker 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 3 of the License, or
* (at your option) any later version.
*
* Process Hacker 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 Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Text;

Expand Down

0 comments on commit bc13bcb

Please sign in to comment.