Installers should be aware of multi-arch OSes and warn users as appropriate
See original GitHub issueMost OSes are becoming multi-arch, in the sense that it’s possible to run multiple different architectures on the same machine. For example:
- Windows x64 and x86 - existing problem
- Apple M1 x64 and arm64
- Windows x64 and arm64
- and so on (pending future support for platform/architecture matrix)
On all platforms, the default installers will put the location of dotnet
into PATH
. But if they install the second architecture, the resulting experience is confusing to the users. For example:
- Install x64 .NET 5 on Windows (
C:\Program Files\dotnet
is added to thePATH
) - Install x86 .NET 3.1 on Windows (
C:\Program Files (x86)\dotnet
is appended to thePATH
) The end result is that both x64 and x86 are onPATH
, but the first one wins, so running:dotnet --info
Will run the x64 version and only list 5.0 as installed. Alsodotnet app.dll
won’t work on 3.1 app, even though it was just installed.
Installers should recognize that another architecture is already on the machine and that it’s on PATH
and inform user about this behavior.
See https://github.com/dotnet/runtime/issues/3820#issuecomment-817382832 for another great example of this problem and how installer warning would help.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:17 (13 by maintainers)
Top Results From Across the Web
package management - How to disable multiarch support?
Since 12.10. dpkg --remove-architecture i386. to get rid of multiarch on an amd64 installation. In case you will have message, like:
Read more >UEFI - Debian Wiki
debian-installer will now warn the user if it is booted in UEFI mode but can find it only non-UEFI existing OS installations. It...
Read more >Ask HN: How are you dealing with the M1/ARM migration?
My colleague wrote a sort of wrapper script that uses Multipass instead but Multipass can't do x86-on-ARM emulation.
Read more >4.2. Installing, Step by Step
Here we follow the process of an installation from a Multi-Arch DVD-ROM; ... The Debian installer will warn the user if they try...
Read more >R for Windows FAQ
It is biased towards users of 64-bit Windows and since R 4.2.0, only 64-bit builds of R are provided. 2 Installation and Usage....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@joeloff To detect ARM64 from an x64 MSI you’ll likely need a custom action DLL written in native code. The Win32 API you’ll want is
IsWOW64Process2
. It requires Win10 v1709 (aka v10.0.16299.0) despite the docs saying v1511. If the OS is pre-1709, and it says it’s x64, then you’re on x64 for real. Otherwise query that API.NETCoreCheck provides a custom actions DLL for detecting .NET 5/6 from an MSI, so you might be able use that as a template for building your own CA DLL. https://github.com/dotnet/deployment-tools/tree/main/src/clickonce/native/projects/NetCoreCheck/CA
edit: Here’s my code that I’m using in Paint.NET as part of my setup chainer, adapt as you see fit https://gist.github.com/rickbrew/aec72f8b430375b663c1e690a5dfc01c
There are two aspects of this:
PATH
for multiple .NET architectures on a machine?Here is my proposal:
PATH
.