DotNetCompatibilityCheck Platform #7733
apacker1
started this conversation in
WiX Development
Replies: 2 comments 2 replies
-
Yeah, that seems better. Take a look at the ProcNativeMachine DUtil function; it handles IsWow64Process2. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I submitted a pull request for this at wixtoolset/wix#459 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Currently, DotNetCompatibilityCheck fails if you give it a platform that is not compatible with the current OS, for example "x64" if you're running on an x86 OS. This failure aborts the installation. I am wondering if it would be better to have the DotNetCompatibilityCheck instead set its property to some new error code indicating "requested platform not compatible with OS"?
It seems like this could make it easier to ship one installer for multiple platforms in my case. I have a product that is managed code compiled for AnyCPU. It used to run on .NET Framework, and I had a single MSI built with Wix3 that users on either x86 or x64 could use. If it detected that .NET Framework was not installed, it would bring up a dialog telling them so and pointing them to the appropriate download link. I'm moving the product to .NET 6, and I have already made a wrapper exe that detects the platform and runs the appropriate app host exe. So basically I have one set of files that will work on different platforms if the appropriate .NET is installed, and I'd like to keep a single MSI for all platforms. I am running into problems because I don't see a way to do a DotNetCompatibilityCheck conditionally, and if I include an x64 check, my installer won't run on x86. I see that DotNetCoreSearch has a Condition attribute, but I am not making a bundle.
I have implemented this in src\ext\NetFx\ca\netfxca.cpp. The idea is that the DotNetCompatibilityCheck function, for each platform it detects in the Wix4NetFxDotNetCheck table, calls a helper function to decide if that platform is compatible with the current OS. The helper function uses IsWow64Process2 (if available) or IsWow64Process to determine this. If it decides that the requested platform is not compatible with the current OS, then DotNetCompatibilityCheck does not attempt to run NetCoreCheck.exe, it simply sets the property to -1. This fixes my issue.
If this change makes sense, I am happy to package up my code as a PR and submit it.
Thanks!
Asa
Beta Was this translation helpful? Give feedback.
All reactions