Note: if you only want to build the PresentData/ library, or the PresentMon Console application you only need Visual Studio: open or build PresentMon.sln
.
-
Visual Studio 2022
-
Download and install vcpkg, which will be used to obtain source package dependencies during the build:
> cd PresentMonRepoDir > git clone https://github.com/Microsoft/vcpkg.git build\vcpkg > build\vcpkg\bootstrap-vcpkg.bat > build\vcpkg\vcpkg.exe integrate install > build\vcpkg\vcpkg.exe install
-
Build the Chromium Embedded Framework (CEF)
-
Download the CEF 114.2.11 distribution and extract it to a local folder (e.g., CefDir): https://cef-builds.spotifycdn.com/index.html
-
The "Minimal Distribution" is sufficient.
-
Proximal versions will most likely be compatible, but are not officially supported.
-
-
Build 64-bit Debug and Release configurations (replace "CefDir" with the directory you downloaded into):
> cmake -G "Visual Studio 17" -A x64 -DUSE_SANDBOX=OFF -S CefDir -B CefDir\build > cmake --build CefDir\build --config Debug > cmake --build CefDir\build --config Release
-
Copy the required build outputs into AppCef by running the following:
> IntelPresentMon\AppCef\Batch\pull-cef.bat CefDir
-
You can now delete the local cef directory if you wish.
-
-
Download and build the web asset dependencies via NPM. This only needs to be run once on fresh clone, or after new packages are added:
> pushd IntelPresentMon\AppCef\Web > npm ci > npm run build > popd
Note: instead of using the production build as described above, you can use a development process with a local server with hotloading support. To do this, use
npm run serve
instead, and use the--p2c-url=http://localhost:8080/
command line argument when running the PresentMon Capture Application. This causes the app to load web content from localhost rather than the files in Web/. -
Create and install a trusted test certificate. This is only required for the Release build. Open a command shell as administrator and run the following:
> makecert -r -pe -n "CN=Test Certificate - For Internal Use Only" -ss PrivateCertStore testcert.cer > certutil -addstore root testcert.cer
Build PresentMon2.sln
in Visual Studio or msbuild. e.g.:
> msbuild /p:Platform=x64,Configuration=Release PresentMon2.sln
-
PresentMon Console Application:
build\Release\PresentMon-dev-x64.exe
-
PresentMon Console Tests:
build\Release\PresentMonTests-dev-x64.exe
-
PresentMon Service Command Line Interface:
build\Release\PresentMonCli.exe
-
PresentMon Installer:
build\Release\en-us\PresentMon.msi
To start the service, open a command window as Administrator, then run the following commands (using the full binPath to your build executable):
> sc.exe create PresentMonService binPath="C:\...\PresentMonRepoDir\build\Release\PresentMonService.exe"
> sc.exe start PresentMonService
When you are finished, stop and remove the service with:
> sc.exe stop PresentMonService
> sc.exe delete PresentMonService
You must run the PresentMon Capture Application from its directory, with the PresentMon Service already running. e.g.:
> cd build\Debug
> PresentMon.exe
Further, for the Release build, the application must be run from a secure location (e.g. "Program Files" or "System32") so it will need to be copied there first. The Release build also cannot be started from Visual Studio, irregardless of whether the debugger is attached, and even if VS is running with admin privilege.