Detours
Detours copied to clipboard
Detours via Nuget package ?
I need to use Detours in a project so the simplest answer is "use Detours' nuget package" - except that doesn't exist :-(
I tried adding Detours source into my project but for complicated reasons its fails and requires invasive changes to my project settings and/or structure
I could clone Detours source + makefiles and make a project whose sole purpose is to run make to build Detours' static lib for my project to consume but that's irksome (to live with as well as to setup - local builds, build pipelines, etc)
Is there a reason Detours offers no Nuget package?
You can use the vcpkg package. NuGet is generally a poor package manager for native dependencies.
Yea, the vcpkg that @sylveon contributed is a good option. See: https://github.com/microsoft/vcpkg/tree/master/ports/detours
@sylveon Be that as it may Nuget has a certain currency in my process. An official nuget from the Detours team would be ideal
@bgianfo I'm not familiar with vcpkg. How do I use that? Do I have to build something or can I point VS2019 at something to import it?
If you follow the instructions in the vcpkg readme for setting it up and then run vcpkg install detours:x64-windows
(replace x64 by the preferred architecture), it should be automatically picked up by Visual Studio under <detours/detours.h>
I built and installed the 4 flavors of Detours vcpkgs
mklink /j c:\vcpkg c:\users\howard\source\repos\vcpkg
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
c:\vcpkg install detours:x86-windows
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
c:\vcpkg install detours:x64-windows
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=x64 -arch=arm
c:\vcpkg install detours:arm-windows
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=x64 -arch=arm64
c:\vcpkg install detours:arm64-windows
and then added vcpkg to VS2019
c:\vcpkg integrate project
then as directed I opened my solution in VS2019 and at the nuget console ran
Install-Package vcpkg.C.vcpkg -Source "C:\vcpkg\scripts\buildsystems"
but it only updated 1 of my solution's 4 projects
Speak to me like I've never used of vcpkg before...
Also, once I git commit will this require every dev working on the project to do something locally (install vcpkg?) or will the project be self-contained and ready for use by anyone who opens the solution?
but it only updated 1 of my solution's 4 projects
That's normal, the NuGet console is per-project:
Also, once I git commit will this require every dev working on the project to do something locally (install vcpkg?) or will the project be self-contained and ready for use by anyone who opens the solution?
Yes, it requires them to install vcpkg locally. The NuGet package provided by vcpkg is a redirect that will make projects able to use all of the locally installed vcpkg libraries. It's effectively the same than vcpkg integrate install
but at a per-project scope.
Also, pro tip: you don't need to run vcpkg in a VS developer command prompt at all, it'll automatically pick up the right (cross-)compiler by itself.
@sylveon That's normal, the NuGet console is per-project That makes sense. Thanks
@sylveon Yes, it requires them to install vcpkg locally. Ugh. Not so appealing.
I renew my ask for a Nuget package
Lacking that I'll have to slurp up the code into my own project. I already tried that but the flood of errors was irksome. The Detours source wasn't happy with precompiled header settings and I didn't even get close to unwinding whatever was horribly wrong with headers, missing symbols and redefinitions :-(
Ping
Still using a forked copy of Detours source and still interested in prebuilt Nuget packages
I think I am using a nuget package and it works well enough. 4.0.1
Ping
Any news?
Ping. Any update?
No updates as of yet, sorry.
@DrusTheAxe Do you or the WindowsAppSDK team have cycles to help contribute the Nuget creation automation? That would certainly help move the needle here.
No updates as of yet, sorry.
@DrusTheAxe Do you or the WindowsAppSDK team have cycles to help contribute the Nuget creation automation? That would certainly help move the needle here.
I don't anytime soon. Will ask around but folks are generally pretty booked with higher pri work
FYI, there is this nuget package: https://www.nuget.org/packages/Detours
which to the nuget package manager looks like it's created by Microsoft:
but turns out it isn't:
kinda scary that it's this easy to spoof being microsoft