From 9f8a1084eddcb4109ccbc13525bbc2276c341b47 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Tue, 14 May 2024 08:57:13 +0100 Subject: [PATCH] Embargo updates from Win7/8/8.1 Fixes #593. # Conflicts: # www/js/init.js --- www/js/app.js | 7 +++++-- www/js/init.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index c4c6db32..43eb6c85 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1013,14 +1013,17 @@ function checkUpdateServer () { }); // Electron updates if (window.electronAPI) { + var electronVersion = navigator.userAgent.replace(/^.*Electron.([\d.]+).*/i, '$1'); + var isUpdateableElectronVersion = !electronVersion.startsWith(params.win7ElectronVersion); var baseApp = (params.packagedFile && /wikivoyage/.test(params.packagedFile)) ? 'wikivoyage' : (params.packagedFile && /wikmed|mdwiki/.test(params.packagedFile)) ? 'wikimed' : 'electron'; - if (baseApp === 'electron') { + if (baseApp === 'electron' && isUpdateableElectronVersion) { console.log('Launching Electron auto-updater...'); electronAPI.checkForUpdates(); } else { - console.log('Auto-update: Packaged apps with large ZIM archives are not currently auto-updated.'); + console.log('Auto-update: ' + (isUpdateableElectronVersion ? 'Packaged apps with large ZIM archives are not currently' + : 'Versions for Windows 7+ 32bit cannot be') + ' auto-updated.'); } } } diff --git a/www/js/init.js b/www/js/init.js index f49bdfb2..ba9ef598 100644 --- a/www/js/init.js +++ b/www/js/init.js @@ -66,6 +66,7 @@ params['cachedStartPages'] = { // 'mdwiki_en_all_maxi': 'A/Wikipedia:WikiProject_Medicine/Open_Textbook_of_Medicine2', wikivoyage_en_all_maxi: 'A/Main_Page' }; +params['win7ElectronVersion'] = '22.3'; // KEEP UP TO DATE!!! This is the last minor version to support Win 7/8/8.1. Auto-update is embargoed for values starting with this. params['kiwixDownloadLink'] = 'https://download.kiwix.org/zim/'; // Include final slash params['kiwixHiddenDownloadLink'] = 'https://master.download.kiwix.org/zim/'; /** ***** DEV: ENSURE SERVERS BELOW ARE LISTED IN package.appxmanifest ************/