Electron Uygulamanızı Otomatik Güncelleme
electron-updater, güncelleme kanalları ve özenle tasarlanmış bir güncelleme akışıyla kullanıcılara sorunsuz güncellemeler sunun.
Electron Uygulamanızı Otomatik Güncelleme, CoddyKit'te ücretsiz bir Electron Desktop App Development dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Electron Desktop App Development öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Electron Desktop App Development kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Why Auto-Update Matters
Desktop apps are not auto-refreshed like web pages. Once a user installs your Electron app, you need a way to push new versions without asking them to re-download manually.
An auto-update system lets you ship bug fixes and features continuously, keeping every user on a recent, secure build.
- Reduces support burden from stale versions
- Delivers security patches fast
- Improves retention with new features
The electron-updater Library
The most common solution is electron-updater, part of the electron-builder ecosystem. It handles checking, downloading, and installing updates across Windows, macOS, and Linux.
Install it as a runtime dependency, not a dev dependency, because it ships inside your app.
npm install electron-updaterConfiguring the Publish Target
electron-updater reads a publish block in your build config to know where to fetch new versions. A common target is a generic HTTP server or a GitHub release.
"build": {
"publish": [{
"provider": "generic",
"url": "https://updates.example.com/myapp"
}]
}Triggering an Update Check
In your main process, call autoUpdater.checkForUpdates() after the app is ready. This contacts your publish URL and compares versions.
Run this from the main process only, never the renderer.
const { autoUpdater } = require('electron-updater')
app.whenReady().then(() => {
createWindow()
autoUpdater.checkForUpdates()
})Listening to Update Events
autoUpdater emits events you can hook into to drive your UI and logging.
update-available— a newer version existsdownload-progress— bytes transferredupdate-downloaded— ready to install
autoUpdater.on('update-available', () => {
console.log('New version found')
})
autoUpdater.on('download-progress', (p) => {
console.log('Progress: ' + Math.round(p.percent) + '%')
})Installing the Downloaded Update
When update-downloaded fires, the new version is staged. Call quitAndInstall() to restart the app onto the new version.
It is good practice to prompt the user first instead of restarting unexpectedly.
autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall()
})Update Channels
Channels let you ship pre-release builds to a subset of users. Common channels are latest, beta, and alpha.
Set the channel so testers receive early builds while everyone else stays on stable.
autoUpdater.channel = 'beta'
autoUpdater.allowPrerelease = trueCommunicating Progress to the UI
Because autoUpdater lives in the main process, forward its events to the renderer through your preload bridge so the UI can show a progress bar.
autoUpdater.on('download-progress', (p) => {
mainWindow.webContents.send('update-progress', p.percent)
})Handling Errors Gracefully
Network failures and signature mismatches happen. Always listen for the error event so a failed update never crashes the app or blocks the user.
autoUpdater.on('error', (err) => {
console.error('Update failed:', err == null ? 'unknown' : err.message)
})Code Signing Requirements
On macOS and Windows, auto-updates only work if your app is code signed. Unsigned builds will fail the signature check on install.
- macOS: Apple Developer ID certificate
- Windows: Authenticode certificate
Signing also protects users from tampered update payloads.
Manual vs Silent Updates
You can disable automatic downloading and let users decide when to update by setting autoDownload = false, then calling downloadUpdate() on demand.
Choose silent background updates for consumer apps, manual control for enterprise tools.
autoUpdater.autoDownload = false
autoUpdater.on('update-available', () => {
// ask user, then:
autoUpdater.downloadUpdate()
})Quick Check
Test your understanding of Electron auto-updates.
Recap
You learned how to ship seamless updates with electron-updater:
- Configure a
publishtarget - Call
checkForUpdates()from the main process - React to
update-available,download-progress, andupdate-downloaded - Use
quitAndInstall()to apply - Code sign your builds and choose channels
A reliable update pipeline keeps your whole user base current and secure.
Yapay zeka eğitmeniyle JavaScript öğren — ücretsiz
Tarayıcında gerçek kod yaz ve çalıştır, 7/24 yapay zeka eğitmeninden anında yardım al; web'de ya da uygulamada kaldığın yerden devam et.
- Kurslar
- 12
- Dersler
- 47
Sıkça Sorulan Sorular
“Electron Uygulamanızı Otomatik Güncelleme” dersi ücretsiz mi?
Evet — “Electron Uygulamanızı Otomatik Güncelleme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Electron Desktop App Development kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Electron Desktop App Development kursu toplamda 4 dersten oluşur.
“Electron Uygulamanızı Otomatik Güncelleme” dersinde ne öğreneceğim?
electron-updater, güncelleme kanalları ve özenle tasarlanmış bir güncelleme akışıyla kullanıcılara sorunsuz güncellemeler sunun. Electron Desktop App Development ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Electron Desktop App Development öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Electron Desktop App Development, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“Electron Uygulamanızı Otomatik Güncelleme” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Electron Desktop App Development dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Electron Desktop App Development dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Çok Pencereli Mimariler
- Arka Plan Süreçleri ve Çalışanlar
- Bulut Hizmetleriyle Entegrasyon
- Electron Uygulamanızı Otomatik Güncelleme