electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

Uninstall page add checkbox to delete user data

Open lfpei opened this issue 2 years ago • 3 comments

  • Electron-Builder Version: ^22.14.13
  • Node Version: 16.13.1
  • Electron Version:18.2.0
  • Electron Type (current, beta, nightly):
  • Target:

The configuration is necessary! Now if you want to achieve it, you must customize the page.It will be a big project. Wish there was a config that would add that checkbox, and delete the specified directory

lfpei avatar Jun 05 '22 13:06 lfpei

If you are referring to the uninstaller, I recommend manually creating one using Squirel: Win - https://github.com/Squirrel/Squirrel.Windows Mac - https://github.com/Squirrel/Squirrel.Mac

Electron Builder Also support it: (Windows - Mac is not officially supported and required manually creating the installers) https://www.electron.build/configuration/squirrel-windows.html

You will want to write your own uninstall function that simply cleans the user data folder, Example:

image

You will need to catch all Squirrel Events, for example using a package like so: https://github.com/mongodb-js/electron-squirrel-startup

Which will handle the following events: https://github.com/electron-archive/grunt-electron-installer#handling-squirrel-events

All events: (Windows) https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Update/Program.cs#L98

Youtube Tutorial for Squirrel: https://www.youtube.com/watch?v=W8Qu4qMJyh4

You can use that to make a custom looking installer for Windows,

In the video he is packaging an entire app but you can package your app with simple logic, you can make a single executable on Visual Studio that will act as the installer for your program, you can store files inside an exe file using the resources settings on visual studio,

On mac, I have no idea where to start from, perhaps just make an xCode app that will do all the installation logic manually it's not that hard just a couple shortcuts and knowing what folders to put them in.

I will use Xamarian if I will have to manually create an installer+uninstaller for Mac easily, Which will allow me to make Mac apps using c#, if the goal is to package an electron app and release it, you can make the installer and uninstaller yourself and sign it manually using your code signing certificates and sign tools provided by either apple or microsoft

Also worth mentioning that you can't directly customize the UI using Squirrel, But, You have access to the --squirrel-firstrun parameter that allows you to do pretty much anything you want during the first install acting as an installer in itself, More info:

https://github.com/Squirrel/Squirrel.Windows/issues/415

burgil avatar Jun 05 '22 19:06 burgil

Check this out: image

burgil avatar Jun 06 '22 20:06 burgil

@burgil, can the above property used for msi build as well? Or only for nsis?

KishoreKumar186 avatar Jun 09 '22 10:06 KishoreKumar186