1

我有一个Electron app,我必须发布它,但我遇到了Linux分发版本的问题。对于 Linux,我决定构建一个.AppImage分发文件,问题是构建的 AppImage 在构建应用程序的主机以及其他机器上成功启动。但是,当我尝试在网站上上传应用程序时,必须从中下载应用程序并启动下载的应用程序时,会出现这样的屏幕。

启动应用程序时出现的屏幕,从互联网下载

这是我的package.json文件的内容:

{
  "name": "electron-app",
  "productName": "electronApp",
  "main": "public/electron.js",
  "version": "0.1.0",
  "private": true,
  "homepage": "./",
  "author": {
    "name": "John Doe",
    "email": "test@test.com"
  },
  "build": {
    "appId": "app.com.electron",
    "productName": "electronApp",
    "linux": {
      "target": [
        {
          "target": "AppImage",
          "arch": [
            "x64",
            "ia32",
            "armv7l",
            "arm64”"
          ],
        }
      ]
     },
    "files": [
      "build/**/*",
      "node_modules/**/*"
    ],
    "directories": {
      "buildResources": "assets"
    }
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "dependencies": {
    "apexcharts": "^3.10.1",
    "apisauce": "^1.0.3",
    "cross-env": "^6.0.3",
    "electron-is-dev": "^1.1.0",
    "electron-root-path": "^1.0.16",
    "moment": "^2.24.0",
    "node-sass": "^4.12.0",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-code-input": "^3.8.1",
    "react-dom": "^16.8.6",
    "react-loading-overlay": "^1.0.1",
    "react-notification-system": "^0.3.0",
    "react-redux": "^7.1.0",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.0.1",
    "react-tradingview-widget": "^1.3.2",
    "react-web-tabs": "^1.0.1",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "reduxsauce": "^1.1.0",
    "seamless-immutable": "^7.1.4"
  },
  "scripts": {
    "lint": "eslint",
    "build": "yarn react-build && yarn electron-build",
    "react-start": "react-scripts start",
    "react-build": "react-scripts build",
    "react-test": "react-scripts test --env=jsdom",
    "react-eject": "react-scripts eject",
    "electron-postinstall": "electron-builder install-app-deps",
    "electron-start": "concurrently \"cross-env BROWSER=none yarn react-start\" \"wait-on http://localhost:3000 && electron .\"",
    "electron-build": "electron-builder"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@types/jest": "^24.0.15",
    "@types/react": "^16.8.22",
    "@types/react-redux": "^7.1.1",
    "babel-eslint": "10.0.1",
    "concurrently": "^5.0.0",
    "electron": "^7.1.1",
    "electron-builder": "^21.2.0",
    "eslint": "5.16.0",
    "eslint-plugin-react": "^7.14.2",
    "wait-on": "^3.3.0"
  }
}

我不知道,也许我需要一些额外的依赖项,比如.deb版本,但我真的不知道问题可能出在什么地方......

4

2 回答 2

1

这是桌面环境/文件管理器问题。他们正确识别文件类型,但他们不执行它(因为他们应该)。

此问题的可能原因是 AppImage 文件没有执行权限(下载文件时不会保留它们)。直接的解决方案是要求您的用户使其可执行。您可以通过检查文件管理器的文件属性选项卡中的“允许执行”权限或使用命令行指令来实现此目的:

chmod +x ./MyApp.AppImage.

这里也有解释https://docs.appimage.org/introduction/quickstart.html#ref-how-to-run-appimage

于 2020-04-17T22:05:17.320 回答
0

.AppImage 需要在 ext3/ext4 分区上。如果你的分区是 NTFS

于 2020-04-24T01:11:34.450 回答