Code Monkey home page Code Monkey logo

electron-simple-updater's Introduction

logo

electron-simple-updater

Build Status npm version

Description

This module allows to automatically update your application. You only need to install this module and write two lines of code! To publish your updates you just need a simple file hosting, it does not require a dedicated server.

Supported OS:

Differences between electron-simple-updater and built-in autoUpdater

  • Actually, autoUpdater is used inside.
  • Linux support.
  • It handles Squirrel.Windows install/update command line arguments.
  • It doesn't require a dedicated release server.
  • You need only 2 lines of code to make it work.

Installation

Install with npm:

npm install --save electron-simple-updater

Usage

Publish a new release

  1. Insert a link to a hosting where you will store updates.json to main.js. You can find a sample of updates.json in the example

    // Just place this code at the entry point of your application:
    const updater = require('src/index');
    updater.init('https://raw.githubusercontent.com/megahertz/electron-simple-updater/master/example/updates.json');

    You can set this link in package.json:updater.url instead of init() argument.

  2. Build your release using electron-builder or another tool. Note: Your application must be signed for automatic updates on macOS. This is a requirement of Squirrel.Mac.

  3. Upload your release with update.json to a hosting. You can do it manually or use electron-simple-publisher to simplify this process. Note: Squirrel.Mac requires a properly prepared release.json file. A release in the property url must be zipped .app file.

  4. That's it!

    Now your application will check for updates on start and download it automatically if an update is available. After app is restarted a new version will be loaded. But you can customize it to ask a user if he would like to install updates. See the example for details.

API

Options

You can set options when calling init() method or in package.json:updater section.

Name Default Description
autoDownload true Automatically download an update when it's found in updates.json
channel 'prod' An application which is built for channel like 'beta' will receive updates only from this channel
checkUpdateOnStart true Check for updates immediately when init() is called
disabled false Disable update feature. This option is set to true automatically for applications built for Mac App Store or Windows Store
logger console You can pass electron-log, winston or another logger with the following interface: { debug(), info(), warn() }. Set it to false if you would like to disable a logging feature
version app.getVersion() Current app version. In most cases, you should not pass this options manually, it is read by electron from version at package.json
url* undefined The only required parameter. This is a URL to updates.json file. You can use templates '{platform}', '{arch}' and '{channel}' in a file name.

Method

init(options)

Initialize a package. By default it finish the process if is run by Squirrel.Windows installer.

setFeedURL(url) deprecated

Sets the url and initialize the electron-simple-updater. Instead of built-in auto-updater init(), this method receives a URL to updates.json.

getFeedURL() deprecated

Return the current updates.json URL.

checkForUpdates()

Asks the server whether there is an update. url must be set before this call. Instead of built-in auto-updater, this method does not start downloading if autoDownload options is set to false.

downloadUpdate()

Start downloading update manually. You can use this method if autoDownload option is set to false

quitAndInstall()

Restarts the app and installs the update after it has been downloaded. It should only be called after update-downloaded has been emitted.

setOptions(name, value)

Set one or a few options. Pass an object as the name for multiple set.

Properties (read only)

These properties are mapped to options

  • build
  • channel
  • version
  • buildId - this string contains a build, a channel and version

Events

meta object of some events is a data from updates.json

error(err)

Emitted when there is an error while updating.

checking-for-update

Emitted when start downloading update.json file.

update-available(meta)

Emitted when there is an available update.

update-not-available

Emitted when there is no available update.

update-downloading(meta)

Emitted when star downloading an update.

update-downloaded(meta)

Emitted when an update has been downloaded.

squirrel-win-installer(event)

Emitted when the app is run by Squirrel.Windows when installing. The SimpleUpdater creates/removes shortcuts and finishes the process by default.

  • event.preventDefault - set to true if you would like to customize this action
  • event.squirrelAction - squirrel-install, squirrel-updated, squirrel-uninstall, squirrel-obsolete

Related

  • electron-builder - A complete solution to package and build an Electron app. Also it contains alternative implementation of update package.
  • electron-simple-publisher - Simple way to publish releases for electron-simple-updater

License

Licensed under MIT.

Logo was designed by prolko base on the original electron logo.

electron-simple-updater's People

Contributors

brendtumi avatar kant avatar lobsterman avatar mateuszroth avatar megahertz avatar tony607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

electron-simple-updater's Issues

Private GitHub Repo

Can you confirm whether or this package will work with a private GitHub repo? If so, could you provide any additional detail on the setup steps required?

I've been able to get auto-update working correctly on a public facing account but when I switch it over to a private repo it errors out.

The only reference to private accounts I can find is:

  • adding the GitHub token to publisher.json
  • "private": true, in the root package.json example (not sure if this related or not)

Cannot find module 'electron-simple-updater'

Uncaught Exception:
Error: Cannot find module 'electron-simple-updater' at Module._resolveFilename (module.js:470:15)

This is thrown after I run the app. Any ideas why this is happening?

What should the windows update file be? zip or portable exe? Or setup.exe?

What should the windows update file be? zip or portable exe? Or setup.exe?

"win32-x64-prod": {
    "readme": "Second release",
    "update": "https://github.com/megahertz/electron-simple-updater/releases/download/win32-x64-prod-v0.0.2",
    "install": "https://github.com/megahertz/electron-simple-updater/releases/download/win32-x64-prod-v0.0.2/Simple.Updater.Example.Setup.0.0.2.exe",
    "version": "0.0.2"
  }

The example just points to a directory.

electron-simple-updater is not initialized

I have ember electron app compiled with electron-forge.

I run with your example.. and console is showing "electron-simple-updater is not initialized", what is going on?

Andd when I run checkforupdates.. it shows "update is disabled" without any error..

Also, I put disabled to false, and neither is not working

updater.init({
checkUpdateOnStart: false,
autoDownload: false,
disabled: false,
});

In package.json

"updater": {
"url": "https://raw.githubusercontent.com/megahertz/electron-simple-updater/master/example/updates.json"
},

Thanks!!

Use network share as update source produces Error: connect ECONNREFUSED

Hi, first of all, congrats for your great work.

I started a project when I need to use an offline solution on a local network. So I cannot update the apps on my web server.
When I tried to connect to my network share folder it produces the following error:

[warn] Error: connect ECONNREFUSED 127.0.0.1:80

I use the following code:
updater.init('\\\\10.0.1.1\\c\\update');

The path is correct and with fs I can browse the files.
Sample code:

const testFolder = '\\\\10.0.1.1\\c\\update';
const fs = require('fs');
fs.readdir(
...
    console.log(file);
...

Can you help me?

Thank you

Linux updater checks that AppImage file is writable, but we care only about directory permissions

Here access call checks with W_OK that the file is writable:

https://github.com/megahertz/electron-simple-updater/blob/master/lib/linux.js#L47

However, since fs.rename call is used to replace the file (write to directory entry, not to the file), it doesn't actually care that the file is writable by the current user — only directory permissions matter here. Even if the file is not writable, but the directory is writable, the file can be replaced.

Two ways to fix it:

  1. Check that the file exists with F_OK (instead of W_OK), and handle fs.rename error later.
  2. Check that path.dirname(appImagePath) is writable instead of appImagePath (this can be done in addition to 1).

Auto-update with bitbucket project. Some general questions and issues.

Hey guys I am trying to get this to work with my electron app that's on bitbucket.

Concerning the two lines of code that is placed in at the entry point of the app, I'm assuming i should be using my own updates.json file, instead of the one they're providing correct?

In my updates.json file, it says it should be pointing to a zipped .app file. Can this be uploaded to the bitbucket project, and taken from there when updating, or do I need to have that file on a server? I guess the confusion comes from the word "hosting" in step 3, not sure if that means a server or my bitbucket project, or something else

Let me know what you guys think.

Thanks!
Michael

Works with linux and ARM?

Hi, I wonder if electron-simple-updater is able to auto update an application running on Linux with ARM architecture (raspberry pi 3). Thank you in advance.

publish win32

hi im having a small issue

when i build the app using > "distall": "build --arch=all",

it builds both 32 and 64...

but if i go > npm run publish it only uploads the 64bit how do i upload the 32?

Download and install progress

It would be great if there were an ability to have a progress meter for app downloads / installs. Any chance that events could push regular changes in percentage complete?

Change darwin update format

The update link for Darwin is specified as follows:

  "darwin-x64-prod": {
    "update": "https://github.com/megahertz/electron-simple-updater/releases/download/example-darwin-x64-prod-v0.0.2/release.json",
    "version": "0.0.2",
    "platform": "darwin",
    "readme": "Second version"
  }

Is it possible to change the:
update: XXXX/XXXX/XXXX/release.json to XXXX/XXXX/XXXX/MyApp-0.0.11-mac.zip?

The electron-builder does not seem to produce a release.json for me so it has to be created manually. In any-case, release.json it does not seem to provide any useful meta except for the url.

Unable get any response on Call back (Issue Or Question)

Hey,
I didn't get any call back response after updater Init, error, update avail etc
Please Give me Suggestion I'm Using Angular 4 and for update Squirrel.Windows
Platform is Windows Machine Only

`const updater = require('electron-simple-updater');
updater.init({
checkUpdateOnStart: true,
autoDownload: false,
url:"urlHere"
});

updater.checkForUpdates();
updater.on('checking-for-update',checkUpdate);
updater.on('update-available', UpdateAvailable);
updater.on('update-not-available', onUpdateNotAvailable)
updater.on('error', updateError);

function updateError() {
console.log('error');
}
function onUpdateNotAvailable() {
console.log('No update');
}
function UpdateAvailable() {
console.log('update Avail');
}
function checkUpdate() {
console.log('checkUpdate');
}`

I use this in main.js

Version is not loaded from package.json

I have tried to use simple-updater with https://github.com/SimulatedGREG/electron-vue this boilerplate but the package.json is not loaded so the version and updater url is always empty.

In the index.js i tried this:

`import { app, BrowserWindow } from 'electron'
const updater = require('electron-simple-updater');

updater.init({
checkUpdateOnStart: false,
autoDownload: false
});

console.log(updater);`

but version is empty, why is the version and the update url not loaded from the package.json?

On Windows, can' open app, updater failing.

On Windows, the updater is erroring out and keeping the app from even being opened.

Below is the log of the error:
error.txt

Here's my setup in the app:
const updater = require('electron-simple-updater');
function onUpdateDownloaded() {
updater.quitAndInstall();
}
updater.init()
updater.on('update-downloaded', onUpdateDownloaded);

Can you help me determine what the problem is?

Self signed certificate error

I have a self signed certificate for HTTPS and when I try to get the new version I get this error

{ Error: self signed certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1085:38)
    at emitNone (events.js:86:13)
    at TLSSocket.emit (events.js:185:7)
    at TLSSocket._finishInit (_tls_wrap.js:603:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38) code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }

I tried with event-certificate-error but app didn't catch the signal.

Can not find Squirrel

Hi,
Can you help me about squirrel.windows? I can't find how install it on my electron project.

Thanks in advance.

Download progress

Hello,

Is there any way we can get event which lets us know what % of # of bytes is downloaded? If not, i think it would be worthy addition to this library.

Thanks

Updates will not install if app is already initialized

I've discovered that if you:

a) Install an app
b) publish an app update while the app is still running
c) check for updates (without restarting app)

...then the updates will never install. It seems that if it receives a 404 the first time, it will never check again to see if subsequent update checks are valid.

error

I don't know why these errors?

/Applications/daying.app/Contents/Resources/electron.asar/renderer/api/remote.js:267:16
    at metaToPlainObject (/Applications/daying.app/Contents/Resources/electron.asar/renderer/api/remote.js:271:5)
    at metaToValue (/Applications/daying.app/Contents/Resources/electron.asar/renderer/api/remote.js:213:14)
    at metaToValue (/Applications/daying.app/Contents/Resources/electron.asar/renderer/api/remote.js:203:22)
    at EventEmitter.<anonymous> (/Applications/daying.app/Contents/Resources/electron.asar/renderer/api/remote.js:282:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Darwin

updates are working on windows but when i run the same code on mac it stuck on downloading updates from(url)

its not throwing any issues or errors

Update example to reflect new updates.json

The example uses the old updates.json format:

{
  "win32-x64-prod": {
    "updateUrl": "https://github.com/megahertz/electron-simple-updater/releases/download/example-win32-x64-prod-v0.0.2",
    "installerUrl": "https://github.com/megahertz/electron-simple-updater/releases/download/example-win32-x64-prod-v0.0.2/Simple.Updater.Example.Setup.0.0.2.exe",
    "version": "0.0.2",
    "platform": "win32",
    "readme": "Second version"
  }
}

This should be updated to reflect the new format:

{
  "win32-x64-prod": {
    "update": "https://github.com/megahertz/electron-simple-updater/releases/download/example-win32-x64-prod-v0.0.2",
    "version": "0.0.2",
    "platform": "win32",
    "readme": "Second version"
  }
}

Alternatively, it would be good if there was better error-checking when parsing the json. If updateUrl exists (instead of update ), it doesn't work and doesn't throw any clear errors as to why.

Just integrated this into my project. It all seems to be working (just confirming the updates download and install now). 🎉🎉🎉
Well done, significantly less grief than a Nuts server and Electrons standard AutoUpdate module.

whether check if the update installer has been downloaded ?

I find it if I don't choose quitAndInstall ,and the update installer will be downloaded again?

updater.init({
      // autoDownload: false,
      logger: console,
      url: 'https://boat.alibaba.com/ide/update.json'
    })
    updater.on('error', (err)=>{
      console.log('error')
      console.log(err)
      console.log(err.message)
      console.log(err.stack)
    })
    updater.on('update-downloading', (meta)=>{
      console.log('[update-downloading]', meta)
    })
    updater.on('update-downloaded', (meta) => {
      console.log('[update-downloaded]', meta);
      let restart = window.confirm('there has been a update version, whether to update immediately ?')

      if(restart){
        updater.quitAndInstall()
      }      
    })

btw, if I choose update, the update result is right.

and I want know where is the download path ?

always receiving a 'warn' when check for updates

Hello, i just signed my app successfully, i created 2 apps, one with an alert, and one update without that alert, but when i open first app my log say this.

captura de pantalla 2017-06-15 a la s 12 17 36

and downloading never ends...

is there any fix for this?

Electron V 1.6.6
Electron-simple-updater V 1.2.1

UPDATE

well i figured out that my app was not signed correctly, but now, when downloading starts, then ends, i receive same error.. :(

Gitlab

thank you so much for your solution, i'm asking if we can use gitLab instead of gitHub

[Question] Does simple updater support Enterprise GitHub?

Currently, our team is using electron-simple-updater perfectly to update the production release. But the problem occurs when we wants to have a new development channel which hosts release on Enterprise GitHub.

Does anyone know if this project supports Enterprise GitHub?
Thanks in advance.

download-progress

hi I see the default electron uses this can we access this method through yours?

autoUpdater.on('download-progress', (progressObj) => {

// })

Downloads the same update multiple times

Consider scenaro. I have updates.json as

{
    "linux-x64-prod": {
        "readme": "Second release",
        "update": "...",
        "install": "...",
        "version": "1.0.0"
    }
}

and then I host or publish this on a server. When my app runs it says

{"level":"info","message":"Update for linux-x64-prod-v1.0.0 is not available","timestamp":"2017-01-31T15:03:57.501Z"}

that is perfectly valid. But now i make some changes and now I change the verrion to 2.0 as

{
    "linux-x64-prod": {
        "readme": "Second release",
        "update": "...",
        "install": "...",
        "version": "2.0.0"
    }
}

and now I publish this updates.json. and push latest build. When I start my app. It says

{"level":"info","message":"Found version 2.0.0 at .....}

that is valid and then we get message

{"level":"info","message":"New version 2.0.0 has been downloaded","timestamp":"2017-01-31T15:13:05.173Z"}

but now I close my app and start the app. It shows new changes, but in logs we see

{"level":"info","message":"Found version 2.0.0 at ...}

It happens every time when I start app. I am expecting that it should not download version2.0 again as its already there.

I am thinking of storing the version returned from response in a file and check , either to download it or not.

ESU not finding "metadata for update. Run checkForUpdates first."

Hi,

Thank you for taking the time to build this module. However, I'm struggling to get this module working on my Mac machine, for my mac build, that I created with Electron packager and Electron Installer, but I keep getting this message:

There is no metadata for update. Run checkForUpdates first. Update for darwin-x64-prod-v2.0.0 is not available Update for darwin-x64-prod-v2.0.0 is not available

Below is the link to see my updates.json, and the zip file, as well as the dmg installer for Mac:
Update Repo with all the updates.json, packages, etc.

In my main.js, I have this code:
const updater = require('electron-simple-updater'); updater.init("https://github.com/tjoye20/vthreat-updates/releases/download/v2.0.0/updates.json") updater.checkForUpdates(); updater.downloadUpdate();

Can you help me determine why it's not finding the metadata and downloading the update. The currently packaged version of the app is version 1.0.0, and the updates.json now is version 2.0.0

Your help would be greatly appreciated.

-Tj

can not get update!

I publish an app with version 1.0.4 in package.json, when I use electron-simple-updater, I make the updates.json like:
{
"win32-x64-prod": {
"readme": "日常更新",
"update": "https://xxxx/worker-management/1520414279",
"install": "https://xxxx/worker-management/1520414279/%E4%BC%8A%E4%BA%91%E4%BB%93TEM%20Setup%201.0.5.exe",
"version": "1.0.5"
}
}

I run this script to pack:
"pack:win": "electron-builder --win --ia32"
my update url is
"updater": { "url": "http://xxxx/worker-management/raw/master/updates.json?private_token=xxxx" }

in main.js

updater.init({
checkUpdateOnStart: false,
autoDownload: false
})

in render.js:

import { remote } from 'electron'
export default function update() {
const updater = remote.require('electron-simple-updater')
updater.on('update-available', meta => {
console.log('[updater] update avaiable', meta.version)
updater.downloadUpdate()
})
updater.on('update-not-available', () => {
console.log('there is no available update')
})
updater.on('update-downloading', () => {})
updater.on('update-downloaded', () => {
if (window.confirm('Restart and install updates?')) {
updater.quitAndInstall()
}
})
updater.on('error', err => {
console.warn(err)
})
updater.checkForUpdates()
}

I always got 'there is no available update'.
What is wrong with my case?

Cant read property 'on' on undefined

Hi, I am using your updater and I have problem when I import it, it can't ready properto 'on' on undefined on line 35 of index.js.

I was able to fix it by including autoupdater like this:

const electron =  require('electron');
const app = electron.remote.app;
const autoUpdater = electron.remote.autoUpdater;

But I would like to know if this is my issue or issue of library. Am I doing something wrong? I have my electron 1.4.7 in devDependecies of project and I don't have it installed globally.

Auto Update problems on Windows & Mac

On Mac the update is starting and the downloading callback is triggered, but then nothing happens, the file is not downloaded and "update-downloaded" never called. It is here required to sign the app for mac that this works?

On Windows the update works.

Update failing with "Could not read desktop shortcut in AppImage"

Update used to work fine with earlier appimages generated by earlier versions of electron-builder (<= 19.33.0).
But electron-simple-updater is not able to find desktop shortcut data ([Desktop Entry]) in the appimages generated by newer version of electron-builder (failed with electron-builder version 19.34.2)

I extracted the content of newer appimages and the desktop file does exist with "[Desktop Entry]". Maybe some change is needed in electron-simple-updater to be compatible with newer appimages.

[Linux] desktop file is lacking a Categories= entry

The desktop file is lacking a Categories= entry in the *.desktop file.

According to the menu spec,

By including one of the Main Categories in an application's desktop entry file, the application will be ensured that it will show up in a section of the application menu dedicated to this category. If multiple Main Categories are included in a single desktop entry file, the entry may appear more than once in the menu.

Hence, please add at least one of the following in the Categories= key.

Main Category Description Notes
AudioVideo Application for presenting, creating, or processing multimedia (audio/video)
Audio An audio application Desktop entry must include AudioVideo as well
Video A video application Desktop entry must include AudioVideo as well
Development An application for development
Education Educational software
Game A game
Graphics Application for viewing, creating, or processing graphics
Network Network application such as a web browser
Office An office type application
Science Scientific software
Settings Settings applications Entries may appear in a separate menu or as part of a "Control Center"
System System application, "System Tools" such as say a log viewer or network monitor
Utility Small utility application, "Accessories"

In addition, you could specify one or more from the longer list of Additional Categories.

Please test the result with desktop-file-validate and make sure it passes.

electron-builder offers native support for this since v19.22.1.

Reference: AppImage/appimage.github.io#2

Error executing action `run` on resource 'bash[migrate gitlab-rails database]'

Recipe: gitlab::database_migrations

  • bash[migrate gitlab-rails database] action run

    ================================================================================
    Error executing action run on resource 'bash[migrate gitlab-rails database]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received '137'
    ---- Begin output of "bash" "/tmp/chef-script20170225-15635-2afg6l" ----
    STDOUT:
    STDERR:
    ---- End output of "bash" "/tmp/chef-script20170225-15635-2afg6l" ----
    Ran "bash" "/tmp/chef-script20170225-15635-2afg6l" returned 137

    Resource Declaration:

    In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb

    51: bash "migrate gitlab-rails database" do
    52: code <<-EOH
    53: set -e
    54: log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
    55: umask 077
    56: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
    57: STATUS=${PIPESTATUS[0]}
    58: echo $STATUS > #{db_migrate_status_file}
    59: exit $STATUS
    60: EOH
    61: environment env_variables unless env_variables.empty?
    62: notifies :run, 'execute[enable pg_trgm extension]', :before unless omnibus_helper.not_listening?("postgresql") || !node['gitlab']['postgresql']['enable']
    63: notifies :run, "execute[clear the gitlab-rails cache]", :immediately unless omnibus_helper.not_listening?("redis") || !node['gitlab']['gitlab-rails']['rake_cache_clear']
    64: dependent_services.each do |svc|
    65: notifies :restart, svc, :immediately
    66: end
    67: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
    68: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
    69: end

    Compiled Resource:

    Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:51:in `from_file'

    bash("migrate gitlab-rails database") do
    action [:run]
    updated true
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    command "migrate gitlab-rails database"
    backup 5
    returns 0
    code " set -e\n log_file="/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"\n umask 077\n /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-77254ab\n exit $STATUS\n"
    interpreter "bash"
    declared_type :bash
    cookbook_name "gitlab"
    recipe_name "database_migrations"
    not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-77254ab) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-77254ab | grep -Fx 0)"
    only_if { #code block }
    end

    Platform:

    x86_64-linux

can not find squirrel

I am getting an error while clicking the install button as"can not find squirrel" and the next log message i.e. downloading the update from the url is displayed but the update doesn't gets downloaded.

error when updating

Hi so i finally managed with your help and some figuring out got the updates and publishing to work the way i need.

here is my config

setText('version', updater.version);
setText('build', updater.buildId);

updater.checkForUpdates();

updater.on('update-available', onUpdateAvailable);
updater.on('update-not-available', onUpdateNotAvailable)
updater.on('update-downloading', onUpdateDownloading);
updater.on('update-downloaded', onUpdateDownloaded);
updater.setOptions('logger', {
info(text) { log('info', text); },
warn(text) { log('warn', text); }
});
function onUpdateNotAvailable(){
console.log("SHOULD ALLOW USER TO LOGIN/OFFLINE OR ONLINE");
}
function onUpdateAvailable(meta) {
setText('new-version', meta.version);
setText('description', meta.readme);
console.log("SHOULD STOP USER FROM LOGIN AND UPDATE");
updater.downloadUpdate();
}
function onUpdateDownloading() {
console.log("SHOULD SHOW USER DOWNLOADING");
}
function onUpdateDownloaded() {
console.log("SHOULD INSTALL AND CHECK AGAIN");
updater.quitAndInstall();
}
//logger
function log(level, text) {
console.log([${level}] ${text});
}
//text
function setText(id, text) {
console.log([${id}] ${text});
}

once the app starts here is the log from the console.

version 0.0.4
index.js:45 build win32-x64-prod-v0.0.4
index.js:41 [info] Found version 0.0.5 at https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
index.js:45 new-version 0.0.5
index.js:45 description undefined
index.js:30 SHOULD STOP USER FROM LOGIN AND UPDATE
index.js:34 SHOULD SHOW USER DOWNLOADING
index.js:41 [info] Downloading updates from https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
index.js:41 [info] Found version 0.0.5 at https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
index.js:45 new-version 0.0.5
index.js:45 description undefined
index.js:30 SHOULD STOP USER FROM LOGIN AND UPDATE
index.js:34 SHOULD SHOW USER DOWNLOADING
index.js:41 [info] Downloading updates from https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
index.js:34 SHOULD SHOW USER DOWNLOADING
index.js:41 [info] Downloading updates from https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
index.js:34 SHOULD SHOW USER DOWNLOADING
index.js:41 [info] Downloading updates from https://github.com/Custardcs/FilmplicityReleases/releases/download/win32-x64-prod-v0.0.5
3index.js:41 [warn] Error: Command failed: 4294967295
System.AggregateException: One or more errors occurred. ---> System.Exception: Couldn't acquire lock, is another instance running
at Squirrel.SingleGlobalInstance..ctor(String key, TimeSpan timeOut)
at Squirrel.UpdateManager.b__32_0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.Update.Program.<Update>d__5.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at Squirrel.Update.Program.executeCommandLine(String[] args) at Squirrel.Update.Program.main(String[] args) at Squirrel.Update.Program.Main(String[] args) ---> (Inner Exception #0) System.Exception: Couldn't acquire lock, is another instance running at Squirrel.SingleGlobalInstance..ctor(String key, TimeSpan timeOut) at Squirrel.UpdateManager.<acquireUpdateLock>b__32_0() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Squirrel.UpdateManager.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Squirrel.Update.Program.d__5.MoveNext()<---

i got a few questions why does it hit into the

SHOULD SHOW USER DOWNLOADING

so many times?

Binary delta updates

Check AppImageUpdate, it uses zsync-curl for binary delta updates. Which means that going from nightly to nightly, you only download the few MB that have actually changed. Haven't checked how well it performs on Electron apps specifically, but I'd assume serious time and bandwidth savings.

replacing files

hello this package is not replacing files on windows...

any fix?

Merge into electron-auto-updater (or vice versa)

electron-builder default target for windows now NSIS and electron-auto-updater was implemented — https://github.com/electron-userland/electron-builder/tree/master/nsis-auto-updater (https://github.com/electron-userland/electron-builder/wiki/Auto-Update)

As far I see in your project you did great job:

  • It seems your module allows to avoid special server for macOS?
  • And you already support auto-update on Linux (AppImage)?

These task are planed to be implemented in the electron-builder. But I don't want to reinvent the wheel :)

Maybe you can help me to merge your excellent module into electron-auto-updater? Or maybe better just support electron-simple-updater in the electron-builder?

Well, finally, I will "steal" all your ideas and will implement it in the electron-auto-updater, but maybe some cooperation will be better :)

What do you think?

Привет из Германии ;)

Option to save the update downloaded

Hi!

Once update is downloaded (autoDownload), I ask to the user if he want to update now, or remind later, if you click remind later, and you restart app, when is initializing, is downloading again the update..

Can I have the update downloaded yet and ask to update now directly when app is initializing?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.