githubelectronauto-updateelectron-updater

Updating electron's update server value with an app update


I have a privately distributed app in electron, which uses my own git account (private repository) for update purposes.

I'm using GH_TOKEN.txt and this method;

autoUpdater.setFeedURL({
  provider: 'github',
  repo: '****',
  owner: '****',
  private: true,
  token: "****"
})

Now I would like to change this update server to another GitHub account, but I need to update the previous repo with this update so for the next update all the apps installed can use new one in the future.

I publish updates from the terminal, how can I publish a package to a server with a different update server?


Solution

  • I published to a new GitHub account then downloaded files and uploaded to previous update server manually.

    Although log output is like below not looking fantastic, but it seems to be working.

    Found version 1.0.35 (url: APPNAME-Setup-1.0.35.exe)
    New Update Available
    Downloading update from APPNAME-Setup-1.0.35.exe
    updater cache dir: C:\Users\USERNAME\AppData\Local\APPNAME-updater
    Cached update sha512 checksum doesn't match the latest available update. New update must be downloaded. 
    Cached: **************************************************==, 
    expected: **************************************************==. 
    Directory for cached update will be cleaned
    Download block maps (old: "https://api.github.com/repos/*******/APPNAME/releases/assets/23617985.blockmap", new: https://api.github.com/repos/*******/APPNAME/releases/assets/23617985.blockmap)
    Cannot download differentially, fallback to full download: Error: Maximum allowed size is 50 MB
        at Object.responseHandler (C:\Users\USERNAME\AppData\Local\Programs\APPNAME\resources\app.asar\node_modules\builder-util-runtime\out\httpExecutor.js:241:26)
        at ClientRequest.<anonymous> (C:\Users\USERNAME\AppData\Local\Programs\APPNAME\resources\app.asar\node_modules\builder-util-runtime\out\httpExecutor.js:303:17)
        at ClientRequest.emit (events.js:210:5)
        at SimpleURLLoaderWrapper.<anonymous> (electron/js2c/browser_init.js:2510:12)
        at SimpleURLLoaderWrapper.emit (events.js:210:5)
    New version 1.0.35 has been downloaded to C:\Users\USERNAME\AppData\Local\APPNAME-updater\pending\update.exe