Skip to content

Commit 3794294

Browse files
committed
Windows: Stop referring to 32-bit/64-bit, refer to x64/ARM64 instead
As of v2.47.1, Git for Windows provides an ARM64 version, and as of v2.49.0 it stopped providing an i686 version. The preceding commit updated the information in `hugo.yml` to reflect this, and now it is time to use that information to present the download links accordingly. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4bac078 commit 3794294

File tree

3 files changed

+39
-26
lines changed

3 files changed

+39
-26
lines changed

assets/js/application.js

+30-17
Original file line numberDiff line numberDiff line change
@@ -593,26 +593,39 @@ var Downloads = {
593593
return `<strong>${ago}</strong>, `;
594594
},
595595

596-
adjustFor32BitWindows: function() {
597-
// adjust the auto-link for Windows 32-bit setups
598-
const is32BitWindows = window.session.browser.os === 'Windows'
599-
&& !navigator.userAgent.match(/WOW64|Win64|x64|x86_64/)
600-
if (!is32BitWindows) return;
601-
602-
const link = $('#auto-download-link');
603-
const version = $('#auto-download-version');
604-
const bitness = $('#auto-download-bitness');
605-
const date = $('#auto-download-date');
606-
if (link.length && version.length && bitness.length && date.length) {
607-
bitness.html('32-bit');
608-
link.attr('href', '{{ .Site.Params.windows_installer.installer32.url }}');
609-
version.html('{{ .Site.Params.windows_installer.installer32.version }}');
610-
date.html('{{ .Site.Params.windows_installer.installer32.release_date }}');
611-
}
596+
adjustForWindowsARM64: function() {
597+
/*
598+
* Windows/ARM64 cannot be reliably detected via the User-Agent string;
599+
* Instead, we use the UAData, but that is not available in all browsers.
600+
* For more details, see
601+
* https://github.com/git-for-windows/git-for-windows.github.io/pull/61
602+
*/
603+
if (!navigator.userAgentData) return;
604+
605+
navigator.userAgentData.getHighEntropyValues(['architecture', 'platform', 'bitness'])
606+
.then(function(browser) {
607+
if (
608+
browser.platform !== 'Windows'
609+
|| browser.bitness !== '64'
610+
|| browser.architecture !== 'arm'
611+
) return;
612+
613+
// adjust the auto-link for Windows/ARM64 setups
614+
const link = $('#auto-download-link');
615+
const version = $('#auto-download-version');
616+
const architecture = $('#auto-download-architecture');
617+
const date = $('#auto-download-date');
618+
if (link.length && version.length && architecture.length && date.length) {
619+
architecture.html('ARM64');
620+
link.attr('href', '{{ .Site.Params.windows_installer.installer_arm64.url }}');
621+
version.html('{{ .Site.Params.windows_installer.installer_arm64.version }}');
622+
date.html('{{ .Site.Params.windows_installer.installer_arm64.release_date }}');
623+
}
624+
})
612625
},
613626

614627
postProcessDownloadPage: function() {
615-
Downloads.adjustFor32BitWindows();
628+
Downloads.adjustForWindowsARM64();
616629
$('#relative-release-date').html(Downloads.postProcessReleaseDate);
617630
},
618631
}

content/downloads/win.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
<div id="main">
99
<h1>Download for Windows</h1>
1010
<p>
11-
<strong><a id="auto-download-link" href="{{< site-param windows_installer.installer64.url >}}">Click here to download </a></strong>
12-
the latest (<strong id="auto-download-version">{{< site-param windows_installer.installer64.version >}}</strong>)
13-
<strong id="auto-download-bitness">64-bit</strong> version of <strong>Git for Windows</strong>.
11+
<strong><a id="auto-download-link" href="{{< site-param windows_installer.installer_x64.url >}}">Click here to download </a></strong>
12+
the latest (<strong id="auto-download-version">{{< site-param windows_installer.installer_x64.version >}}</strong>)
13+
<strong id="auto-download-architecture">x64</strong> version of <strong>Git for Windows</strong>.
1414
This is the most recent <a href="https://git-for-windows.github.io/">maintained build</a>.
15-
It was released <span id="relative-release-date"></span>on <span id="auto-download-date">{{< site-param windows_installer.installer64.release_date >}}</span>.
15+
It was released <span id="relative-release-date"></span>on <span id="auto-download-date">{{< site-param windows_installer.installer_x64.release_date >}}</span>.
1616
</p>
1717
<h3>Other Git for Windows downloads</h3>
1818
<h4>Standalone Installer</h4>
1919
<p>
20-
<strong><a href="{{< site-param windows_installer.installer32.url >}}">32-bit Git for Windows Setup</a>.</strong>
20+
<strong><a href="{{< site-param windows_installer.installer_x64.url >}}">Git for Windows/x64 Setup</a>.</strong>
2121
</p>
2222
<p>
23-
<strong><a href="{{< site-param windows_installer.installer64.url >}}">64-bit Git for Windows Setup</a>.</strong>
23+
<strong><a href="{{< site-param windows_installer.installer_arm64.url >}}">Git for Windows/ARM64 Setup</a>.</strong>
2424
</p>
2525
<h4>Portable ("thumbdrive edition")</h4>
2626
<p>
27-
<strong><a href="{{< site-param windows_installer.portable32.url >}}">32-bit Git for Windows Portable</a>.</strong>
27+
<strong><a href="{{< site-param windows_installer.portable_x64.url >}}">Git for Windows/x64 Portable</a>.</strong>
2828
</p>
2929
<p>
30-
<strong><a href="{{< site-param windows_installer.portable64.url >}}">64-bit Git for Windows Portable</a>.</strong>
30+
<strong><a href="{{< site-param windows_installer.portable_arm64.url >}}">Git for Windows/ARM64 Portable</a>.</strong>
3131
</p>
3232
<h4>Using winget tool</h4>
3333
<p>

layouts/partials/monitor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h4> Latest source Release </h4>
1010
<span class="release-date">
1111
({{ .Site.Params.latest_release_date }})
1212
</span>
13-
<span data-mac="{{ .Site.Params.macos_installer.version }}" data-win="{{ .Site.Params.windows_installer.installer64.version }}" id="installer-version"></span>
13+
<span data-mac="{{ .Site.Params.macos_installer.version }}" data-win="{{ .Site.Params.windows_installer.installer_x64.version }}" id="installer-version"></span>
1414

1515
<a href="https://www.kernel.org/pub/software/scm/git/" class="button" id="download-link">Download Source Code</a>
1616
</div>

0 commit comments

Comments
 (0)