summaryrefslogtreecommitdiff
path: root/Building-Locally.md
diff options
context:
space:
mode:
authorMatt <[email protected]>2024-09-23 19:43:48 -0700
committerGitHub <[email protected]>2024-09-23 19:43:48 -0700
commit5c4ceaef72f0af992966a7d2ac7ac7d897f091d3 (patch)
treec41e92721ba8d9e6ce01b18aa806268c9c9a901e /Building-Locally.md
parent66f7736077b6fb6573418885390076e24a4daef6 (diff)
Deprecate WDK VSIX Install (#1219)
* Deprecate WDK vsix install * Fix WDK extension version print * Remove unecessary splitting on version * Minor build info refactor * Fix indentation of output info * Enough messing with volume size output * Cleanup comment for vsix version * More cleanup and doc update * Remove deprecation statement and install vsix script. * Fixes and updates to building locally documentation. * Dont code scan on license or .md files. * Code scanning ignore changes to .md when pull request is made
Diffstat (limited to 'Building-Locally.md')
-rw-r--r--Building-Locally.md70
1 files changed, 44 insertions, 26 deletions
diff --git a/Building-Locally.md b/Building-Locally.md
index e3db8dde..312c5967 100644
--- a/Building-Locally.md
+++ b/Building-Locally.md
@@ -2,16 +2,19 @@
## Step 1: Install Tools
-```
+```powershell
winget install --id Microsoft.Powershell --source winget
winget install --id Git.Git --source winget
```
For using WDK NuGet feed based build additionally:
-```
+
+```powershell
winget install --id Microsoft.NuGet --source winget
```
+---
+
## Step 2: Optional: Disable Strong Name Validation
When: This step is only required if you will be using pre-release versions of the WDK.
@@ -26,16 +29,20 @@ reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,31bf3856
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,31bf3856ad364e35 /v TestPublicKey /t REG_SZ /d 00240000048000009400000006020000002400005253413100040000010001003f8c902c8fe7ac83af7401b14c1bd103973b26dfafb2b77eda478a2539b979b56ce47f36336741b4ec52bbc51fecd51ba23810cec47070f3e29a2261a2d1d08e4b2b4b457beaa91460055f78cc89f21cd028377af0cc5e6c04699b6856a1e49d5fad3ef16d3c3d6010f40df0a7d6cc2ee11744b5cfb42e0f19a52b8a29dc31b0 /f
```
+---
+
## Step 3: Optional: Install Microsoft .NET Framework 4.7.2 Targeting Pack and Microsoft .NET Framework 4.8.1 SDK
When: This step is only required to build sample usb\usbview .
### Option A: Install VS Components
+
Easy: If you will install Visual Studio (see later) you may at that point select to add both of following individual components:
* .NET Framework 4.7.2 targeting pack
* .NET Framework 4.8.1 SDK
### Option B: Use EWDK
+
Easy: If you use EWDK, then all necessary prequisites are included.
### Option C: Install Developer Pack
@@ -52,24 +59,30 @@ This will install following Apps:
* Microsoft .NET Framework 4.8.1 Targeting Pack
* Microsoft .NET Framework 4.8.1 Targeting Pack (ENU)
+---
+
## Step 4: Clone Windows Driver Samples and checkout relevant branch
-```
-cd path\to\your\repos
-git clone --recurse-submodules https://github.com/microsoft/Windows-driver-samples.git
-cd Windows-driver-samples
+```powershell
+cd "path\to\your\repos"
+git clone --recurse-submodules "https://github.com/microsoft/Windows-driver-samples.git"
+cd ".\Windows-driver-samples"
```
If you are planning to use in-market WDK, then you would typically want to use the 'main' branch:
+
```
git checkout main
```
If you are planning to use a WDK Preview or WDK EEAP release, then you would typically want to use the 'develop' branch:
+
```
git checkout develop
```
+---
+
## Step 5: Create a "driver build environment"
To build the Windows Driver Samples you need a "driver build environment". In essence an environment that consist of following prerequisites:
@@ -78,53 +91,55 @@ To build the Windows Driver Samples you need a "driver build environment". In e
* The Windows Driver Kit.
### Option A: Use WDK NuGet Packages
-* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK.
-* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix).
- * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse.
- * In the search bar type: `Windows Driver Kit`.
- * Find the `Microsoft` signed extension.
- * Click the Install button.
+
+* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete `Step 1`. You do not need to install the SDK or the WDK.
* Launch a "Developer Command Prompt for VS 2022".
* Restore WDK packages from feed :
-```
->cd path\to\your\repos\Windows-driver-samples
->nuget restore -PackagesDirectory .\packages
+```powershell
+cd "path\to\your\repos\Windows-driver-samples"
+nuget restore -PackagesDirectory ".\packages"
```
-* When this is done you should have a .\packages folder that looks exactly as follows:
-```
->cd path\to\your\repos\Windows-driver-samples
->dir /b packages
+* When this is done you should have a .\packages folder that looks like example below:
+
+```powershell
+cd "path\to\your\repos\Windows-driver-samples"
+dir /b packages
Microsoft.Windows.SDK.CPP.10.0.26000.1
Microsoft.Windows.SDK.CPP.x64.10.0.26000.1
Microsoft.Windows.SDK.CPP.arm64.10.0.26000.1
Microsoft.Windows.WDK.x64.10.0.26000.1
Microsoft.Windows.WDK.arm64.10.0.26000.1
```
+
### Option B: Use the Windows Driver Kit
+
* Here you will install each of above prerequisites one at a time.
* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, SDK, and WDK.
* Launch a "Developer Command Prompt for VS 2022".
### Option C: Use an Enterprise WDK
+
* You can also simply use the Enterprise WDK (EWDK), a standalone, self-contained command-line environment for building drivers that contains all prerequisites in one combined ISO.
* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to download the EWDK.
* Mount ISO image
* Open a terminal
* `.\LaunchBuildEnv`
+---
## Step 6: Check all samples builds with expected results for all flavors
-```
+```powershell
pwsh
.\Build-AllSamples
```
Above builds all samples for all configurations and platforms.
You can refine what exact samples to build, what configurations, and platforms to build. build Here are a few examples:
-```
+
+```powershell
# Get Help:
Get-Help .\Build-AllSamples
@@ -144,9 +159,9 @@ Get-Help .\Build-AllSamples
.\Build-AllSamples -Samples '^tools.' -Configurations 'Debug' -Platforms 'x64'
```
-Expected output:
+Example of expected output:
+
```
-PS > .\build-AllSamples.ps1
Build Environment: NuGet
Build Number: 26100
Samples: 132
@@ -190,6 +205,8 @@ Log files directory: .\_logs
Overview report: .\_overview.htm
```
+---
+
## 7: NuGet - Additional Notes
To restore a specific version of our WDK NuGet packages:
@@ -201,12 +218,13 @@ Follow these steps before running "nuget restore" command:
* Now you can run "nuget restore"
A few examples of how to interact with nuget:
-```
+
+```powershell
# To add an alternative online NuGet source:
-nuget sources add -Name "MyNuGetFeed" -Source https://nugetserver.com/_packaging/feedname/nuget/v3/index.json
+nuget sources add -Name "MyNuGetFeed" -Source "https://nugetserver.com/_packaging/feedname/nuget/v3/index.json"
# To add an alternative local NuGet source:
-nuget sources add -Name "MyNuGetFeed" -Source \\path\to\mylocalrepo
+nuget sources add -Name "MyNuGetFeed" -Source "\\path\to\mylocalrepo"
# To remove an alternative NuGet source:
nuget sources remove -Name "MyNuGetFeed"