用electron创建MSI安装程序时出现问题

2024-05-16 06:43:36 发布

您现在位置:Python中文网/ 问答频道 /正文

大家好

我正试图通过electron创建一个MSI安装程序,这样它就可以将我文件夹中的所有文件,包括python脚本。unpack版本(win-ia32-unpacked)可执行文件可以工作,但它必须在项目文件夹中运行,因为它依赖于该文件夹中的所有文件。在

这就是我的包.json文件看起来像

{
  "name": "ProjectName",
  "description": "....",
  "version": "0.0.3",
  "main": "main.js",
  "build": {
    "app-bundle-id": "org.test.mytest",
    "app-category-type": "public.app-category.box",
    "mac": {
      "contents": [
        {
          "x": 410,
          "y": 150,
          "type": "link",
          "path": "/Applications"
        },
        {
          "x": 130,
          "y": 150,
          "type": "file"
        }
      ]
    },
    "win": {
      "title": "Layoverbox app",
      "version": "0.28.999.1",
      "iconUrl": "http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png",
      "msi": true,
      "authors": "Author"
    }
  },
  "scripts": {
    "start": "node ./start-electron.js",
    "postinstall": "install-app-deps",
    "pack": "build --dir",
    "dist:win32": "./node_modules/.bin/build --platform win32 --arch ia32"
  },
  "author": "Layoverbox Team <jonathan@company.com>",
  "private": true,
  "dependencies": {
    "jquery": "^3.1.0",
    "keymaster": "^1.6.2",
    "lodash": "^4.13.1",
    "request": "^2.72.0",
    "shelljs": "^0.7.5",
    "strip": "^3.0.0"
  },
  "devDependencies": {
    "electron-builder": "^5.26.0",
    "electron-prebuilt": "^1.3.3",
    "electron-rebuild": "^1.2.0"
  }
}

它用打包和解包的文件夹创建dist文件夹。 但是压缩文件夹中没有运行任何东西,也没有MSI的迹象,我在命令行中得到以下错误。在

^{pr2}$

任何帮助都将不胜感激。在


Tags: 文件build文件夹trueappmainversiontype