-
Notifications
You must be signed in to change notification settings - Fork 190
Drop 32-bit and add ARM64 architecture check #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Here is new API browser compatibility It may not work with earlier Windows browsers, and I didn't look to see if Git-For-Windows still supports earlier Windows versions (e.g. Windows 7 or Windows 10 earlier version) If these earlier versions have been discarded, we can safely merge this PR. |
Thank you for your contribution! You're absolutely correct, the i686 version should no longer be advertised, and the Windows/ARM64 version should be advertised.
Unfortunately, this does not seem to be supported very well: Firefox, for example, seems not to support this at all: It does seem as if your method is recommended, but I do want to have a fallback in case It does seem as if But the best course of action would most likely be to use uaparser.dev instead, i.e. vendor in https://github.com/faisalman/ua-parser-js/raw/refs/tags/2.0.3/dist/ua-parser.pack.js, import it in the const uap = new UAParser(navigator.userAgent)
const isWinARM64 = uap.getOS().name === 'Windows' && uap.getCPU() === 'arm64' @rbqvq what do you think about this approach? |
I installed Firefox and Google Chrome arm64 version on my snapdragon computer. UserAgent
I think the current implementation is sufficient, VSCode and Google Chrome official website cannot read the system architecture in Firefox When this API call fails, the download link will not be replaced, but redirected to the release page for users to manually select |
I just tested Google Chrome, and its automatic installation is arm64. Manually copying the x64 installation package fails to install (I'm not sure if the old version of Chrome has this check) As for MS Edge, it comes with the system, so don't worry about it |
It might be changed in firefox 127, See Release Notes
And I find early version firefox UA at https://useragents.io/uas/mozilla-5-0-windows-nt-10-0-win64-arm64-rv121-0-gecko-20100101-firefox-121-0_8990edbc4e595b80909d7f0cf230d5b5 So if u want to add string |
You've got good points. Okay, so let's just go with a Chrome/Edge-only solution. Could you fix the code, though, so that it does not throw an exception in Firefox because |
|
I am thinking about a guard like |
In my hands, this works well in Edge and in Firefox (in the latter, it simply does not show anything): navigator.userAgentData?.getHighEntropyValues(["architecture", "platform", "bitness"]).then(console.log) |
if (!href || !version || !navigator.userAgentData)
throw 0; How about it? |
New Git-For-Windows does not have Git-32-bit.exe, drop 32-Bit. Add ARM64 architecture check, I find this check code in VSCode website. Signed-off-by: Coia Prant <coiaprant@gmail.com>
a1ad7f9
to
607efe1
Compare
Firefox said in Win11 it reported as x86_64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! I agree with you that this is the best we can do for now.
New Git-For-Windows does not have Git-32-bit.exe, drop 32-Bit.
Add ARM64 architecture check, I find this check code in VSCode website.
I do not test it, So please test it at first