Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
🌲 A drop-in module that adds autoUpdating capabilities to Electron apps
翻譯準備中
開發工具TypeScriptGitHub @electron自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗A drop-in module that adds autoUpdating capabilities to Electron apps
Supports multiple update sources:
Before using this module, make sure your Electron app meets these criteria:
update.electronjs.org
@electron-forge/publisher-s3npm i update-electron-app
update.electronjs.orgDrop this anywhere in your main process:
const { updateElectronApp } = require('update-electron-app')
updateElectronApp()
By default your repository URL is found in your app's package.json file.
You can also specify custom options:
const { updateElectronApp, UpdateSourceType } = require('update-electron-app')
updateElectronApp({
updateSource: {
type: UpdateSourceType.ElectronPublicUpdateService,
repo: 'github-user/repo'
},
updateInterval: '1 hour',
logger: require('electron-log')
})
const { updateElectronApp, UpdateSourceType } = require('update-electron-app')
updateElectronApp({
updateSource: {
type: UpdateSourceType.StaticStorage,
baseUrl: `https://my-bucket.s3.amazonaws.com/my-app-updates/${process.platform}/${process.arch}`
}
})
Once you've called updateElectronApp as documented above, that's it! Here's what happens by default:
ready event; the module figures that out.update(options)Additional Options:
updateInterval String (optional) - How frequently to check for updates. Defaults to 10 minutes. Minimum allowed interval is 5 minutes. This is a human readable interval supported by the ms modulelogger Object (optional) - A custom logger object that defines a log function. Defaults to console. See electron-log, a module that aggregates logs from main and renderer processes into a single file.notifyUser Boolean (optional) - Defaults to true. When enabled the user will be
prompted to apply the update immediately after download.updateElectronApp returns an object with a stopUpdates function that stops the
periodic update checks:
const { updateElectronApp } = require('update-electron-app')
const { stopUpdates } = updateElectronApp()
// Later, when you no longer want to check for updates:
stopUpdates()
stopUpdates is safe to call at any time, including before the app is ready or on
platforms where updates aren't supported. Calling it more than once has no
additional effect.
For macOS, you'll need to build a .zip file.
Use electron-forge or electron-installer-zip to package your app as a zip.
For Windows, you'll need to build a .exe and .nupkg files with electron-forge or electron-winstaller.
For Windows auto-updates to work, make sure every GitHub Release also has the following Squirrel.Windows assets attached, otherwise the update will silently fail:
RELEASES - the manifest that Squirrel reads to discover available updates*-full.nupkg - the full update package*.exe - the installer*-delta.nupkg - optional, smaller delta packages used to speed up updates when presentOn Windows, extra app launches indicate that your app isn't handling the Squirrel.Windows startup events (such as install, update, and uninstall) that fire during these operations. You can use the electron-squirrel-startup module to handle these events and avoid the unwanted launches.
Yes :)
If you publish your builds manually ensure the file structure is:
**/{platform}/{arch}/{artifact}For example that means that these files should exist:
**/win32/x64/RELEASES**/darwin/arm64/RELEASES.json**/darwin/arm64/My App v1.0.0.zip (or something similar)If using the public update service, the https://update.electronjs.org server handles release fetching logic. Only releases that have valid SemVer tags and are not marked as draft or pre-release will be collected by the update service.
The latest release returned by the repos/{owner}/{repo}/releases
GitHub API containing all requisite binaries will be the update target.
MIT