Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-updater running uninstall script #3128

Closed
Alin13 opened this issue Jul 18, 2018 · 3 comments
Closed

Auto-updater running uninstall script #3128

Alin13 opened this issue Jul 18, 2018 · 3 comments

Comments

@Alin13
Copy link

Alin13 commented Jul 18, 2018

Electron-builder: 19.56.2
Electron-updater: ^3.0.1
Target: Windows

Build config:

"nsis": {
	"include": "windows/uninstall.nsh",
	"deleteAppDataOnUninstall": true
}

Uninstall.nsh:

!macro customUnInstall
	; remove the scheduled task + registry
!macroend

I'm using electron-updater to check and install new updates in my app, but I have a small issue regarding the above configs: when a new update is installed the appData is not removed (which is ok), but the uninstall.nsh is called (which is bad).
Is there a way to call uninstall.nsh just when the app is uninstalled manually and not on updates (just as the behavior for appData) ?

@develar
Copy link
Member

develar commented Jul 18, 2018

Wrap your code into

${ifNot} ${isUpdated}
${endIf}

@Alin13
Copy link
Author

Alin13 commented Jul 18, 2018

Wow, that was a quick response. Thank you very much !

@develar
Copy link
Member

develar commented Jul 18, 2018

Note — we are not going to simplify and introduce yet another macro, because this feature ONLY for those, who understand what they are doing. And so, additional level of magic is not acceptable. I have added note to doc about ${isUpdated} and customUnInstall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants