Comments (10)
Sorry that I misled you. I forgot some details about Squirrel.Win. 'squirrel-win-installer' is fired when the app has been updated.
I'm feeling bad now, so I can't give you a good solution. I'll try to return to this problem on the next week.
from electron-simple-updater.
Unfortunately, Squirrel downloads updates by itself, so I can't control it.
from electron-simple-updater.
Hi, I want to download automatically but update only if user wants, in mac I can cancel, but in windows I can't.
I am using squirrel events to stop..
updater.on('squirrel-win-installer', onSquirrelInstalling);
function onSquirrelInstalling(event) {
console.log(event)
}
But never is called.
My squirrel log
2017-07-26 11:01:41> CheckForUpdateImpl: Downloading RELEASES file from http://www.example.com/example/standalone/releases/win32/0.0.8
2017-07-26 11:01:41> FileDownloader: Downloading url: http://www.example.com/example/standalone/releases/win32/0.0.8/RELEASES?id=example&localVersion=0.0.7&arch=amd64
2017-07-26 11:01:42> FileDownloader: Downloading file: http://www.example.com/example/standalone/releases/win32/0.0.8/example-0.0.8-full.nupkg
2017-07-26 11:02:56> ApplyReleasesImpl: Writing files to app directory: C:\Users\example\AppData\Local\example\app-0.0.8
2017-07-26 11:03:02> LogHost: Rigging execution stub for example_ExecutionStub.exe to C:\Users\example\AppData\Local\example\example.exe
2017-07-26 11:03:08> ApplyReleasesImpl: Squirrel Enabled Apps: [C:\Users\example\AppData\Local\example\app-0.0.8\example.exe]
2017-07-26 11:03:09> ApplyReleasesImpl: Starting fixPinnedExecutables
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: Command Prompt.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: File Explorer.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: Google Chrome.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: SourceTree.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: Task Manager.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Examining Pin: Visual Studio Code.lnk
2017-07-26 11:03:09> ApplyReleasesImpl: Fixing up tray icons
2017-07-26 11:03:09> ApplyReleasesImpl: Couldn't rewrite shim RegKey, most likely no apps are shimmed: System.NullReferenceException: Object reference not set to an instance of an object.
at Squirrel.UpdateManager.ApplyReleasesImpl.b__13_0(RegistryView view)
2017-07-26 11:03:09> ApplyReleasesImpl: Couldn't rewrite shim RegKey, most likely no apps are shimmed: System.NullReferenceException: Object reference not set to an instance of an object.
at Squirrel.UpdateManager.ApplyReleasesImpl.b__13_0(RegistryView view)
2017-07-26 11:03:09> ApplyReleasesImpl: cleanDeadVersions: for version 0.0.8
2017-07-26 11:03:09> ApplyReleasesImpl: cleanDeadVersions: exclude folder app-0.0.7
2017-07-26 11:03:09> ApplyReleasesImpl: cleanDeadVersions: exclude folder app-0.0.8
Thanks
from electron-simple-updater.
Hi. Sometimes squirrel updates the app even if quitAndInstall isn't called. I don't remember what's the exact squirrel behavior on different platforms.
As for squirrel-win-installer, you should subscribe to the event before updater.init is called.
from electron-simple-updater.
Is updating anyway, calling quitAndInstall or not.
I am in renderer.js, like your example,
function attachUpdaterHandlers() {
updater.on('update-available', onUpdateAvailable);
updater.on('update-downloading', onUpdateDownloading);
updater.on('update-downloaded', onUpdateDownloaded);
updater.on('squirrel-win-installer', onSquirrelInstalling);
updater.setOptions('logger', {
info(text) {
console.log("Information in Auto-update: " + String(text));
},
warn(text) {
console.log("Warning in auto-update: " + String(text));
}
});
function onUpdateAvailable(meta) {
//If you want, ask for update
/*if (window.confirm('Update ' + meta.version + ' is available. The current version is ' + updater.version + '. Do you like to download in background it now?', 'Update')) {
updater.downloadUpdate();
}*/
}
function onUpdateDownloading(meta) {
console.log("The update is downloading...");
}
function onUpdateDownloaded(meta) {
var index = dialog.showMessageBox(mainWindow, {
type: 'info',
buttons: ['Restart to update', 'Remind me later'],
defaultId: 0,
title: "Example",
message: 'New version has been downloaded. Please restart the application to apply the updates.',
detail: meta.readme,
cancelId: 1
});
if (index === 1) {
console.log("Aborting the update...")
return;
} else {
// Restart app, then update will be applied
updater.quitAndInstall();
}
}
function onSquirrelInstalling(event) {
event.preventDefault = true;
console.log(event)
console.log(event.squirrelAction)
}
But is never calling..
Also try in main.js, before updater.init called..
updater.on('squirrel-win-installer', onSquirrelInstalling);
updater.init({
checkUpdateOnStart: false,
autoDownload: false
});
function onSquirrelInstalling(event) {
event.preventDefault = true;
console.log(event)
console.log(event.squirrelAction)
}
And is only calling event in installation.. (event squirrel-install) not more..
I need to stop the update!
from electron-simple-updater.
Okey, no problem! I will be waiting
from electron-simple-updater.
I looked up at squirrel logic again. Normally, it updates the app as soon as updates are downloaded, so it doesn't matter whether the app restarted or not. How do you cancel update on mac?
If an app is updated but it still can find a new version after restart - in most situation it has wrong version configuration. Check whether the version property inside C:\Users\example\AppData\Local\example\app-0.0.8\resources\app.asar\package.json is correct.
from electron-simple-updater.
In mac, if I don't call 'updater.quitAndInstall()'.. is not updating
function onUpdateDownloaded(meta) {
var index = dialog.showMessageBox(mainWindow, {
type: 'info',
buttons: ['Restart to update', 'Remind me later'],
defaultId: 0,
title: "Example",
message: 'New version has been downloaded. Please restart the application to apply the updates.',
detail: meta.readme,
cancelId: 1
});
if (index === 1) {
console.log("Aborting the update...")
return;
} else {
// Restart app, then update will be applied
updater.quitAndInstall();
}
}
In windows I see that before to onUpdateDownloaded callback, is created new app-0.0.8 (and saves app-0.0.7) and also application.exe has new version (0.0.8).. and after restar is updating anyway.. I thought that we could stop update.. or we could go back when users choose to not update
from electron-simple-updater.
It seems that Squirrel.Mac behavior is changed in the latest version. In older version it applied update immediately.
And yes, it seems that on windows you can only revert to a previous version in your code if a user rejects update. Maybe Update.exe has some helpful features for it, I don't know.
from electron-simple-updater.
Feel free to reopen this issue if your problem is not solved.
from electron-simple-updater.
Related Issues (20)
- NSIS Support HOT 3
- checkForUpdates not responding HOT 7
- Could not create temporary directory HOT 2
- Squirrel.Windows DEPRECATED :( HOT 6
- Enable downgrading/rollback HOT 1
- Events 'update-not-available', 'update-available', etc. not firing Render HOT 6
- Update often fails on Raspberry Pi HOT 4
- Update is disabled because the app is not packaged HOT 4
- opt.logger.debug is not a function HOT 1
- What should be path of update for windows HOT 2
- Add User agent to request HOT 5
- Simple Updater: The Request was Aborted HOT 6
- Empty warning text HOT 2
- Support for download progress (important for slow connections) HOT 3
- Linux App image HOT 1
- cannot perform update "Update is disabled because the app is not packaged" HOT 3
- Where can i locate the downlaoded electron packages? HOT 2
- Stuck at downloading windows squirrel HOT 3
- Documentation for updates.json ? HOT 8
- File downloaded file gets truncated in linux if calling quitAndInstall. HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-simple-updater.