問題描述
對於 Mac,是否有關於基於電子的應用程序卸載的事件?還是一種區分安裝和更新的方法? (Is there an event on electron based app's uninstall, for Mac? Or a way to distinguish between an install and an update?)
我看到帶有 NSIS 的 windows 有選項,但 mac 沒有。
我想給用戶一個選項,讓他們在卸載應用程序時清理應用程序相關文件。但是我還沒有找到可以在 mac 端觸發的事件。
參考解法
方法 1:
I think there are no such events as you want for mac os. It's only provided for windows. uninstalling an app on macOS is you need to just drag it over to the trash. so, if you want to remove app‑related files to be deleted then just remove app.getPath("home")
data before autoUpdater.quitAndInstall()
.
(by Vikram Tiwari、Harsh Makwana)