Want life cycle handler like "uninstall" for electron app installed by macOS dmg


I am using electron-builder to create app which has Squirrel.Mac support

the build output is dmg and I can install the app by drag it into application folder

but I noticed the life cycle events (which works fine on windows) like “–squirrel-uninstall” “–squirrel-updated” are not issued, and so I can not add handlers for them

I need to clear some application data like password saved in keychain before the application is moved into trash, but the handler is not even called.

Is it by design or there is something else I can do ? thanks!