installer icon indicating copy to clipboard operation
installer copied to clipboard

Warn users when installing x64 SDK on non-x64 machine

Open ericstj opened this issue 3 years ago • 5 comments

CC @richlander

We've seen a lot of reports of folks installing x64 on ARM64 / M1 and expecting the default experience. We should consider warning them in the installer UI in case they did this unintentionally.

On Mac we might use installation-check of type warning: https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW12

I'm not sure if our WiX bootstrapper supports customization that's dependent on runtime detection, but a place to start is here: https://wixtoolset.org/documentation/manual/v3/bundle/wixstdba/wixstdba_customize.html

ericstj avatar Nov 18 '21 20:11 ericstj

We can use System.Management namespace, then we can notify the user with a message box 😊

static void Main(string[] args)
{
    Console.WriteLine(GetDataWitdh() ? "CPU x64" : "Noooooo");
}

static bool GetDataWitdh()
{
    var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor");
    ManagementObjectCollection cpus = searcher.Get();
    object dataWidth = null;
    foreach (ManagementObject queryObj in cpus)
    {
       dataWidth = queryObj["DataWidth"];
    }
    return dataWidth.ToString() == "64";
}

dotnetgoo avatar Nov 21 '21 18:11 dotnetgoo

@MrTukhtaboyev for detection we will use NativeMachine which was added to Wix for this purpose: https://wixtoolset.org/documentation/manual/v3/bundle/bundle_built_in_variables.html

The open question here is how to make the bundle change the UI based on bundle variables. I'm not particularly familiar with that. I'd expect @marcpopMSFT or @joeloff might have an idea.

ericstj avatar Nov 22 '21 20:11 ericstj

We have limited options, but can condition UI text. We do that in the hosting bundle today to warn users when we fail to detect the IIS is installed, but otherwise omit the text.

As long as we have a property that can be set, we can use that and then condition the UI text so we have two strings, one conditioned on the property being set, the other on it not being set and then select one of them at runtime.

joeloff avatar Nov 22 '21 20:11 joeloff

@joeloff Can you share your linkedin contact? Pls.

dotnetgoo avatar Nov 23 '21 08:11 dotnetgoo

The reverse is true where users can try to install the ARM64 .NET Runtime (and reference packages) on x64 macos (for those who build targeting packs and runtime packs into separate installers) from the arcade sdks.

AraHaan avatar Dec 14 '21 19:12 AraHaan

Old issue triage: We think this is hard to do and we have lived with it for a couple of years.

marcpopMSFT avatar Jul 09 '24 20:07 marcpopMSFT