對於 Mac,是否有關於基於電子的應用程序卸載的事件?還是一種區分安裝和更新的方法? (Is there an event on electron based app's uninstall, for Mac? Or a way to distinguish between an install and an update?)


問題描述

對於 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 TiwariHarsh Makwana)

參考文件

  1. Is there an event on electron based app's uninstall, for Mac? Or a way to distinguish between an install and an update? (CC BY‑SA 2.5/3.0/4.0)

#electron-builder #electron #node.js






相關問題

Electron Builder 代碼簽名下載證書錯誤 (Electron Builder Code Signing Download Certificate Error)

Electron 使用 electron-builder 創建 MSI 安裝程序 (Electron create MSI installer using electron-builder)

如何使用電子/電子生成器創建發布通道? (How to create release channels with electron/electron-builder?)

electron-builder,如何設置節點環境變量 (electron-builder, how to set node environmental variables)

電子應用Mac應用商店圖標問題->“缺少必需的圖標” (electron app Mac app store icon issue -> "missing required icon")

帶有 Vue 和 vue-cli-plugin-electron-builder 的電子應用程序無法與 Tesseract.js 一起使用 (Electron App with Vue and vue-cli-plugin-electron-builder can't working with Tesseract.js)

使用 Electron-builder 自定義 NSIS 安裝程序 (Customize NSIS installer with Electron-builder)

在 Mac 中打開 Electron 應用程序時出錯:“file:///Applications/../Contents/Resources/app.asar/dist/index.html” (Error in Opening Electron App in Mac:"file:///Applications/../Contents/Resources/app.asar/dist/index.html")

Mac Os 10.11.6 中 Windows 的 Electron Pakaging 問題 (Electron Pakaging issue for Windows in Mac Os 10.11.6)

對於 Mac,是否有關於基於電子的應用程序卸載的事件?還是一種區分安裝和更新的方法? (Is there an event on electron based app's uninstall, for Mac? Or a way to distinguish between an install and an update?)

Electron 應用架構 - IPC 與 API (Electron application architecture - IPC vs API)

公證問題:altool 不在 PATH 中? (Notarize issue: altool not in PATH?)







留言討論