@@ -125,7 +125,7 @@ project(my_driver LANGUAGES C CXX)
125125include(cmake/CPM.cmake)
126126
127127set(CRTSYS_NTL_MAIN ON)
128- CPMAddPackage("gh:ntoskrnl7/crtsys@0.1.10 ")
128+ CPMAddPackage("gh:ntoskrnl7/crtsys@<version> ")
129129include(${crtsys_SOURCE_DIR}/cmake/CrtSys.cmake)
130130
131131crtsys_add_driver(my_driver src/main.cpp)
@@ -163,121 +163,45 @@ cmake --build build_x64 --config Debug
163163
164164## NuGet Package
165165
166- ` crtsys ` can be distributed as a native NuGet package for Visual Studio/MSBuild
167- projects. The package includes public NTL headers, internal compatibility
168- headers, native MSBuild imports, and prebuilt ` crtsys.lib ` /` Ldk.lib ` driver
169- binaries.
170-
171- The package has two consumer modes:
172-
173- - App mode: normal Visual C++ application projects get the public NTL headers
174- and C++ compatibility options only. No driver libraries, forced include, or
175- driver entry point are added.
176- - Driver mode: WDK driver projects get the CMake-equivalent driver settings:
177- ` crtsys ` include paths, MSVC/STL compatibility headers before WDK ` km\crt ` ,
178- forced include setup, preprocessor definitions, ` crtsys.lib ` , ` Ldk.lib ` ,
179- ` libcntpr.lib ` , ` /FORCE:MULTIPLE ` , and the ` CrtSysDriverEntry ` entry point
180- for the default ` ntl::main ` flow.
181-
182- Driver mode is enabled automatically when MSBuild sees a driver project
183- (` ConfigurationType=Driver ` or ` DriverType ` is set). It can also be forced with
184- ` CrtSysUseDriverSupport=true ` . The package does not turn a normal C++ project,
185- console application, static library, or CMake project into a WDK driver project,
186- and it does not install or replace the WDK toolset.
187-
188- Driver builds may emit ` LNK4088 ` because ` crtsys ` intentionally uses
189- ` /FORCE:MULTIPLE ` for known duplicate CRT/runtime symbols between ` libcntpr ` ,
190- ` Ldk ` , ` ntoskrnl ` , and the runtime glue. Treat that as an expected build
191- warning only when the remaining link output contains no unresolved symbols and
192- the duplicate symbols are in the known runtime boundary. Final drivers still
193- need load, verifier, signing, and target-OS validation.
194-
195- The current binary package targets:
196-
197- - Visual Studio 2022
198- - Windows SDK/WDK ` 10.0.22621.0 `
199- - App header builds on ` x86 ` , ` x64 ` , and ` ARM64 `
200- - Driver library builds on ` x64 ` and ` ARM64 `
201- - Debug/Release ` crtsys.lib ` , ` Ldk.lib ` , and WDK ` libcntpr.lib `
202-
203- Install it from Visual Studio's ** Manage NuGet Packages** UI. In the Package
204- Manager Console, select your app or driver project as the default project and
205- run:
166+ ` crtsys ` NuGet distribution is:
206167
207- ``` powershell
208- Install-Package crtsys
209- ```
210-
211- For an app project, include headers such as ` ntl/rpc/client ` directly.
212-
213- For a driver project, define ` ntl::main ` :
168+ - ` crtsys.<version>.nupkg ` : install from Visual Studio/MSBuild.
214169
215- ``` cpp
216- #include < ntl/driver>
170+ Install from VS/MSBuild:
217171
218- ntl::status ntl::main (ntl::driver& driver,
219- const std::wstring& registry_path) {
220- driver.on_unload([ ] ( ) {});
221- return ntl::status::ok();
222- }
172+ ``` powershell
173+ Install-Package crtsys
223174```
224175
225- For native MSBuild consumers, the package also exposes `$(CrtSysRoot)`.
226- See [NTL usage examples](./docs/usage-examples.md) for the app/driver RPC and
227- raw IOCTL skeletons.
176+ ## GitHub Release Prebuilt Bundle
228177
229- Pack locally :
178+ GitHub Release publishes these offline-only assets :
230179
231- ```powershell
232- .\scripts\nuget\Build-CrtSysNuGetLibs.ps1
233- .\scripts\nuget\Pack-CrtSysNuGet.ps1
234- ```
180+ - ` crtsys-<version>-prebuilt.zip ` : headers, docs, CMake helpers,
181+ and prebuilt ` x64/ARM64 ` ` Debug ` /` Release ` libraries.
182+ - ` crtsys-<version>-SHA256SUMS.txt `
235183
236- Publish with an API key in the environment :
184+ Use the prebuilt bundle for WDK CMake/offline bootstrap :
237185
238186``` powershell
239- $env:NUGET_API_KEY = '<nuget-api-key>'
240- .\scripts\nuget\Push-CrtSysNuGet.ps1 -SkipDuplicate
187+ Expand-Archive .\crtsys-<version>-prebuilt.zip .
241188```
242189
243- GitHub Actions builds the prebuilt libraries and package on pull requests and
244- pushes. A tag such as ` v0.1.12 ` publishes to nuget.org through NuGet Trusted
245- Publishing when the tag version matches ` include/.internal/version ` .
246- The same tag build also creates GitHub Release assets. Manual workflow runs can
247- set ` github_release=true ` to create or update the matching GitHub Release
248- without pushing a tag.
249-
250- Release assets include:
251-
252- - ` crtsys.<version>.nupkg ` for offline NuGet installation.
253- - ` crtsys-<version>-native.zip ` with headers, docs, CMake helpers, native
254- MSBuild imports, and prebuilt x64/ARM64 Debug/Release driver libraries.
255- - ` crtsys-<version>-SHA256SUMS.txt ` for asset checksums.
256-
257- The native zip includes ` cmake/CrtSys.cmake ` , and the same ` crtsys_add_driver `
258- API can consume the prebuilt driver libraries when it is included from the
259- unpacked bundle. A WDK CMake project can unpack the zip and use:
260-
261190``` cmake
262191include(path/to/crtsys-<version>/cmake/CrtSys.cmake)
263192crtsys_add_driver(my_driver src/main.cpp)
264193```
265194
266- For GitHub Actions publishing, create a nuget.org Trusted Publishing policy
267- with the package owner shown by nuget.org, repository owner ` ntoskrnl7 ` ,
268- repository ` crtsys ` , workflow file ` package.yml ` , and no environment
269- restriction. Set the GitHub Actions repository variable
270- ` NUGET_TRUSTED_PUBLISHING_USER ` to the nuget.org user that created the policy.
195+ For full packaging and publishing command details, see ` nuget/README.md ` .
271196
272- To prepare a release without manually editing ` include/.internal/version ` , run
273- the release helper from an up-to-date ` main ` branch:
197+ To publish a new version from ` main ` :
274198
275199``` powershell
276- .\scripts\release\Prepare-CrtSysRelease.ps1 -Version 0.1.13 -Push
200+ .\scripts\release\Prepare-CrtSysRelease.ps1 -Version <version> -Push
277201```
278202
279203The helper updates ` include/.internal/version ` , commits the version bump,
280- creates the matching ` v0.1.13 ` tag, and pushes both the commit and tag. The tag
204+ creates the matching ` v<version> ` tag, and pushes both the commit and tag. The tag
281205push starts the ` Package ` workflow.
282206
283207The same flow is also available from the GitHub UI: open ** Actions** ,
0 commit comments