2016-08-03 5 views
0

Ich habe viele Dinge über diesen Subjet gelesen, aber ich kann keine vollständige Dokumentation finden. Es ist mir gelungen, mit Hilfe von Electron-Packager und Electron-Winstaller eine setup.exe für meine Elektronenanwendung zu erstellen. Ich habe den Electron-Release-Server benutzt, um einen Server zu erstellen, auf dem meine Elektronen-App zum Einsatz kommen kann.Auf der Suche nach einem kompletten Tutorial über den Prozess, um eine Elektronenapp installiert zu aktualisieren

ich hinzufügen in meinem Elektron App diesen Frieden Code

const autoUpdater = electron.autoUpdater; 
var feedUrl = 'http://10.61.32.53:1337//download/:' + app.getVersion(); 
autoUpdater.setFeedURL(feedUrl); 
// event handling after download new release 
autoUpdater.on('update-downloaded', function (event, releaseNotes,  releaseName, releaseDate, updateUrl, quitAndUpdate) { 

// confirm install or not to user 
var index = dialog.showMessageBox(mainWindow, { 
type: 'info', 
buttons: [i18n.__('Restart'), i18n.__('Later')], 
title: "Typetalk", 
message: i18n.__('The new version has been downloaded. Please restart the application to apply the updates.'), 
detail: releaseName + "\n\n" + releaseNotes 
}); 

if (index === 1) { 
    return; 
} 

// restart app, then update will be applied 
quitAndUpdate(); 
}); 

Aber wenn ich meine Anwendung installieren, ich habe diesen Fehler:

exception

In der Tat, ich glaube, ich don‘ Ich verstehe, was ich auf der Clientseite, aber auch auf der Serverseite tun soll. Jede Hilfe wäre sehr willkommen! Vielen Dank im Voraus

Antwort

0

ich in meiner Version folgende verwendet und das funktioniert (mit Ausnahme des Tray Icon):

app.on('ready',() => { 
    console.warn("Starting Autoupdater") 
    console.warn(app.getVersion()) 
    var feedUrl = 'http://ls-desktop.herokuapp.com/update/' + os.platform() + '/' + app.getVersion() + '/'; 
    autoUpdater.setFeedURL(feedUrl); 

    tray = new Tray(__dirname + '/LS.png') 
    console.log(__dirname + '/LS.png') 

    console.log('created'); 
    autoUpdater.on('checking-for-update', function() { 
     tray.displayBalloon({ 
     title: 'Autoupdater', 
     content: 'Checking for Update!' 
     }) 
    }); 

    autoUpdater.on('update-available', function() { 
     console.log("update-available"); 
    }); 

    autoUpdater.on('update-not-available', function() { 
     tray.displayBalloon({ 
     title: 'Autoupdater', 
     content: 'No Updates availible!' 
     }) 
    }); 

    autoUpdater.on('update-downloaded', function() { 
     console.log(" update-downloaded"); 
    }); 

    setTimeout(function() {autoUpdater.checkForUpdates()}, 10000); 

    autoUpdater.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) { 

     var index = dialog.showMessageBox({ 
     type: 'info', 
     buttons: ['Restart', 'Later'], 
     title: "Lornsenschule Vertretungsplan", 
     message: ('The new version has been downloaded. Please restart the application to apply the updates.'), 
     detail: releaseName + "\n\n" + releaseNotes 
     }); 

     if (index === 1) { 
     return; 
     } 

     quitAndUpdate() 
    }); 
    }) 

Notiere die setTimeout(function() {autoUpdater.checkForUpdates()}, 10000);, die die wirkliche Abhilfe ist, die ich verwendet. der Rest ist nur ein schöner Zusatz Ich denke

+0

Danke für Ihre Hilfe. Ich habe es noch nicht versucht, aber ich werde es tun. –

Verwandte Themen