question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installers should be aware of multi-arch OSes and warn users as appropriate

See original GitHub issue

Most 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 the PATH)
  • Install x86 .NET 3.1 on Windows (C:\Program Files (x86)\dotnet is appended to the PATH) The end result is that both x64 and x86 are on PATH, but the first one wins, so running: dotnet --info Will run the x64 version and only list 5.0 as installed. Also dotnet 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
rickbrewcommented, Aug 9, 2021

@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

1reaction
richlandercommented, Apr 14, 2021

There are two aspects of this:

  • How do we handle the PATH for multiple .NET architectures on a machine?
  • How do we handle .NET versions that are not available/legal for a given architecture?

Here is my proposal:

  • No longer automatically add the non-native .NET install directory to the PATH.
  • Teach the muxer to see all .NET installs (installed to the normal location) on the machine for the purpose of good error messages.
  • Write guidance on how someone should target both .NET Core 3.1 (x64) and .NET 6 (Arm64) on the same machine. Say they are working on two different apps, day in and day out. How do they make that efficient and delightful? This might inspire/require us to make more product changes.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found