Embargo updates from Win7/8/8.1

Fixes #593.

# Conflicts:
#	www/js/init.js
This commit is contained in:
Jaifroid 2024-05-14 08:57:13 +01:00
parent 67579ae54b
commit 9f8a1084ed
2 changed files with 6 additions and 2 deletions

View File

@ -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.');
}
}
}

View File

@ -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 ************/