Skip to content
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

Block Electron updates if Internet access is disabled #653

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ jobs:
echo "ORIGINAL_ELECTRON_VERSION=$ORIGINAL_ELECTRON_VERSION" | Out-File $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Setting the Electron version to the latest supporting Windows 7/8/8.1 (=22.3.25)"
(Get-Content ./package.json) -replace '("electron":\s+)"[\d.]+[\w\d-.]*?"', '$1"22.3.25"' | Set-Content ./package.json
echo "Copying the package.json to dist"
cp ./package.json ./dist/package.json
echo "Installing dependencies in root and dist"
npm install; cd dist; npm install; cd ..
echo "Installed Electron version:$(npx electron --version)"
Expand All @@ -272,6 +274,7 @@ jobs:
mv "dist/bld/Electron/$file Setup*.exe" "dist/bld/Electron/$file Win7 Setup $INPUT_VERSION_E.exe"
mv "dist/bld/Electron/$file Setup*.exe.blockmap" "dist/bld/Electron/$file Win7 Setup $INPUT_VERSION_E.exe.blockmap"
}
mv "dist/bld/Electron/latest.yml" "dist/bld/Electron/latest-win7.yml"
ls ./dist/bld/Electron/
# DEV: We did not use electron-builder to publish because we needed to change the filenames, so we need to publish to GitHub here
if ($INPUT_TARGET -ne 'artefacts') {
Expand All @@ -293,6 +296,8 @@ jobs:
./scripts/Rewrite-DraftReleaseTag.ps1
# Set the module type to one supported by Electron
# (Get-Content ./package.json) -replace '("type":\s+)"module"', '$1"commonjs"' | Set-Content ./package.json
echo "Copying the rewritten package.json to dist"
cp ./package.json ./dist/package.json
echo "Installing dependencies in root and dist"
npm install; cd dist; npm install; cd ..
echo "Installed Electron version:$(npx electron --version)"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
"arch": "ia32"
},
{
"target": "nsis-web",
"target": "portable",
"arch": "ia32"
},
{
"target": "nsis-web",
"arch": "x64"
"target": "appx"
},
{
"target": "nsis-web",
"arch": "arm64"
"arch": "ia32"
},
{
"target": "portable",
"arch": "ia32"
"target": "nsis-web",
"arch": "x64"
},
{
"target": "appx"
"target": "nsis-web",
"arch": "arm64"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/Publish-ElectronPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (-not $CRON_LAUNCHED) {
}
$upload_uri = $release.upload_url -ireplace '\{[^{}]+}', ''
"`nUploading assets to: $upload_uri..."
$filter = '\.(exe|zip|msix|appx|7z)$'
$filter = '\.(exe|zip|msix|appx|7z|yml)$'
if ($portableonly) {
$filter = '\.(zip)$'
}
Expand Down
2 changes: 1 addition & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ function checkUpdateServer () {
// Do update checks 10s after startup
setTimeout(function () {
if (/PWA/.test(params.appType)) {
console.log('Checking for updates to the PWA...');
console.log('Internally checking for updates to the PWA...');
checkPWAUpdate();
}
// Delay GitHub checks so that any needed PWA update can be notified first
Expand Down