-
Notifications
You must be signed in to change notification settings - Fork 263
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
Request: Clean up app data directories on uninstall #113
Comments
+1 (I haven't check, really, Doesn't Squirrel.Windows remove app data on uninstall?) But I guess that issue should be opened in the Squirrel.Windows issue tracker. BTW, electron-builder NSIS uninstaller deletes app data on uninstall. Code: https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Squirrel/UpdateManager.ApplyReleases.cs#L92 Not yet checked, but it seems, yes, Squirrel doesn't remove app data folder. |
+1 for having this feature as default. So at this moment any idea is there any api I can delete that data folder in uninstall event handler? |
require('rimraf').sync(require('electron').app.getPath('userData')); Inside the |
@MarshallOfSound actually I tried this but what I notice is that if I did not close my app when run uninstall, uninstall does not work at all. I guess when the app is running, the userdata directory is being used so rimraf failed I also tried calling app.quit() before that remove statement, it did not help either.. btw, I am running an app based on electron and if I did not call rimraf during unstall like this
it work fine and even if the app is up and running, uninstall will close it firstly and uninstall successfully |
The optimal situation for this would be for the app to inform the other running instances of the app to quit. I tried it using the app api but couldn't make it work. The hacky solution was to put a try catch around the rimraf command. |
+1 on this. Currently using the installer on a project and users were startled to see the userData directory still populated with files. I can take a stab at this if the issue is still open. |
Going to take a stab at this. |
@ianrtracey Did you ever come up with a solution for this? Currently stuck on the same problem and nothing seems to work. |
Got bogged down. Will take a look at this this weekend @topched . |
I am also facing the same issue. Any solution? |
I provided a solution to this issue a few comments in, see #113 (comment) |
any updated? I'm facing the same issue too. |
I removed preferences file(which contains all logged in user data) from app data like below on squirrel uninstall event. //Remove local preferences file |
Any Updates?? Still i am facing same issue... I am using -
Inside the --squirrel-uninstall event |
Can |
Go to "test-app-one" project inside electron-builder git source repo. |
Lets say the electron windows app is installed on a windows machine which has multiple windows users(Administrator and other user accounts).
I have deleteAppDataOnUninstall to true in package.json. Issue: When the app is reinstalled, Other windows accounts wont get a fresh newly installed app. The one who uninstalled the app only that user account gets a newly installed app. How can we delete all the app user data for all accounts when app is uninstalled? |
@paragdulam Thank you for your solution! It works as expected in Windows. Do you or anyone have any idea if anything similar is available for MacOS? I am creating a .dmg and then installing or re-installing the app via it. |
Currently when you uninstall a Squirrel app it levaes behind it's AppData directory with quite a bit of data which means a uninstall -> reinstall is not a clean install.
It would be better if it deleted those AppData folders and their contents on uninstall as that would kind of be expected of an uninstall.
Trying to implement this in JS with the Squirrel hooks results in file is locked errors (as you are trying to delete files that are in use).
The text was updated successfully, but these errors were encountered: