簡體   English   中英

Electron Linux:.AppImage 沒有顯示圖標,而 .deb 是

[英]Electron Linux: .AppImage is not showing the icon, while .deb is

我有一個 Electron 應用程序,我想將其分發到所有操作系統。

我的 Linux 發布文件有問題。 我已經測試了.deb文件和.AppImage文件。

問題是圖標:雖然如果我使用.deb文件在 Ubuntu 上運行我的應用程序,它會正確顯示圖標,當我使用.AppImage它不會。

此外,當我在開發模式下運行它以及為 Windows 和 macOS 發布時,該圖標工作正常。

為什么呢?

我的應用程序的源代碼可在此處獲得

AppImage 有圖標錯誤。 您需要在主窗口中設置它。

  const options = {
    backgroundColor: '#fff',
    width: 1200,
    height: 800,
    webPreferences: {
      nativeWindowOpen: true,
      nodeIntegration: true
    }
  }

  if (process.platform === "linux") {
    options.icon = path.join(`${__dirname}/icon/icon.png`);
  }

  mainWindow = new BrowserWindow(options);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM