gpt4 book ai didi

reactjs - Electron .AppImage 分发应用程序在从网站下载时无法打开

转载 作者:行者123 更新时间:2023-12-03 12:33:38 32 4
gpt4 key购买 nike

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

The screen which appears, when launching the app, downloaded from the internet

这是我的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版本,但我真的不知道,问题可能出在什么地方......

最佳答案

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

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

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

关于reactjs - Electron .AppImage 分发应用程序在从网站下载时无法打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61273334/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com