VueJS + Electron create debian 安装程序不起作用(electron-installer-debian)



我正在使用 VueJS 创建一个 Web 应用程序,我最终决定将其更改为桌面应用程序。所以我克隆了我的项目,并基于这个快速入门教程 Vue CLI 插件电子生成器,我将我的 Vue 应用程序更改为 Electron 应用程序。

但是现在我已经完成了我的软件开发,我想创建一个安装程序并在我想的任何地方使用它。这就是问题开始的地方。

本教程 Electron 打包程序教程允许我创建我的应用程序的软件包,而这个 Electron 安装程序 debian 软件包允许我创建 debian 安装程序。但是当生成.deb文件并执行它时,软件的大小为0 字节,安装后软件不会启动。

我做了任何事情,但我找不到问题所在。

这里有一些可以帮助人们帮助我的元素。

package.json :

{
"name": "Sogemex_Industry_App",
"productName": "Sogemex Industry App",
"author": "Nanon <ouattarananon22@gmail.com>",
"icon": "icon.png",
"description": "Sogemex Industry work application",
"version": "0.1.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"package-mac": "electron-packager . Sogemex_Industry_App --overwrite --platform=darwin --arch=x64 --icon=/home/nanon/Projets/VueJS/sogemex_electron/src/assets/sogemex-Industry.png --prune=true --out=release-builds",
"package-win": "electron-packager . Sogemex_Industry_App --overwrite --asar=true --platform=win32 --arch=ia32 --icon=/home/nanon/Projets/VueJS/sogemex_electron/src/assets/sogemex-Industry.png --prune=true --out=release-builds --version-string.CompanyName="Sogemex Industry" --version-string.ProductName="Sogemex Industry App"",
"package-linux": "electron-packager . Sogemex_Industry_App --overwrite --asar=true --platform=linux --arch=x64 --icon=/home/nanon/Projets/VueJS/sogemex_electron/src/assets/sogemex-Industry.png --prune=true --out=release-builds",
"debian-installer": "electron-installer-debian --src release-builds/Sogemex_Industry_App-linux-x64/ --arch amd64 --config debian.json"
},
"main": "background.js",
"dependencies": {
"axios": "^0.19.0",
"core-js": "^3.6.4",
"jquery": "^3.4.1",
"jspdf": "^1.5.3",
"jspdf-autotable": "^3.2.11",
"number-to-words": "^1.2.4",
"translate": "^1.1.0",
"vue": "^2.6.11",
"vue-cookie": "^1.1.4",
"vue-notification": "^1.3.20",
"vue-router": "^3.1.5",
"vue-select": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.2.0",
"@vue/cli-plugin-eslint": "^4.2.0",
"@vue/cli-plugin-router": "^4.2.0",
"@vue/cli-service": "^4.2.0",
"babel-eslint": "^10.0.3",
"electron": "^6.0.0",
"electron-builder": "^22.3.2",
"electron-packager": "^14.2.1",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.1.2",
"sass": "^1.25.0",
"sass-loader": "^8.0.2",
"vue-cli-plugin-electron-builder": "^1.4.5",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

debian.json :

{
"dest": "release-builds/",
"description": "Sogemex Industry work application",
"version": "0.1.1",
"icon": "icon.png",
"categories": [
"Office"
],
"lintianOverrides": [
"changelog-file-missing-in-native-package"
]
}

优麒麟软件视图:

运行lintian release-builds/sogemex-industry-app_0.1.1_amd64.deb --no-tag-display-limit时的终端输出:

有人可以帮助我吗?

好的,所以我终于解决了我的问题。这个 github 主题让我说问题不在于 debian 安装程序的创建,而在于应用程序的打包方式。

在那之后,我意识到 runnpm run electron:build没有使用electron-packager,而是在dist_electron文件夹中创建了一个名为linux-unpack的应用程序包。当我尝试将其用作软件包来创建我的安装程序时,electron-installer-debian指定我缺少一些文件,许可证和版本(版本包含电子版本。我不知道这是否是规则,但这就是我包含的规则(。

所以我只是添加了它们,我的安装程序就创建了,我的软件终于能够在计算机上启动了。

最新更新