【问题标题】:NSIS build does not install the Electron application on Windows. The installer exits silently and produces a 1620 errorNSIS 构建不会在 Windows 上安装 Electron 应用程序。安装程序静默退出并产生 1620 错​​误
【发布时间】:2019-11-19 09:03:42
【问题描述】:

我正在使用 electron-builder 构建一个 Electron 应用程序。构建过程会生成一个 setup.exe 文件,但是当我启动安装过程时,安装程​​序会完成大约 50%,然后退出。

运行安装程序后,安装目录中的唯一文件%USERPROFILE%\AppData\Local\Programs\Application-Name 是uninstaller.exe 文件。

Mac版安装成功,解压后的EXE文件在Windows上正常运行。

我已经在 Windows 7 和 Windows 8 上进行了尝试,结果相同。我还尝试将 oneClick 属性设置为 true 和 false ,但任一选项均未成功。

{
  "name": "Application-Name",
  "author": "Company",
  "description": "Publication Archive",
  "version": "0.1.0",
  "private": true,
  "homepage": "./",
  "main": "./src/electron.js",
  "dependencies": {
    "connected-react-router": "^6.5.0",
    "history": "^4.9.0",
    "node-sass": "^4.12.0",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-redux": "^7.1.0",
    "react-router-dom": "^5.0.1",
    "react-scripts": "3.0.1",
    "redux": "^4.0.2",
    "redux-thunk": "^2.3.0",
    "sqlite3": "^4.0.9"
  },
  "scripts": {
    "preelectron-pack:win": "npm run build && cp ./src/db.js ./build/db.js && cp ./src/electron.js ./build/electron.js",
    "electron-pack:win": "cross-env DEBUG=electron-builder build --win"
  },
  "build": {
    "appId": "com.electron.application-name",
    "directories": {
      "buildResources": "icons",
      "output": "release-builds"
    },
    "win": {
      "target": [
        {
          "target": "nsis",
          "arch": [
            "x64"
          ]
        }
      ],
      "icon": "icons/winapp.png"
    },
    "nsis": {
      "oneClick": false,
      "deleteAppDataOnUninstall": false
    },
    "files": [
      "build/**/*",
      "node_modules/**/*",
      "db/**/*",
      "public/**/*"
    ]
  },
  "devDependencies": {
    "cross-env": "^5.2.0",
    "devtron": "^1.4.0",
    "electron": "^5.0.6",
    "electron-builder": "^20.44.4",
    "electron-devtools-installer": "^2.2.4",
    "typescript": "^3.5.3"
  }
}

安装程序日志文件内容:

=== Verbose logging started: 7/9/2019  13:50:53  Build type: SHIP UNICODE 5.00.7601.00  Calling process: C:\Windows\system32\msiexec.exe ===
MSI (c) (18:B0) [13:50:53:991]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (18:B0) [13:50:53:991]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (18:98) [13:50:54:030]: Resetting cached policy values
MSI (c) (18:98) [13:50:54:030]: Machine policy value 'Debug' is 0
MSI (c) (18:98) [13:50:54:030]: ******* RunEngine:
           ******* Product: Application-Name Setup 0.1.0.exe
           ******* Action: 
           ******* CommandLine: **********
MSI (c) (18:98) [13:50:54:033]: Note: 1: 2203 2: Application-Name Setup 0.1.0.exe 3: -2147286960 
MSI (c) (18:98) [13:50:54:034]: MainEngineThread is returning 1620
=== Verbose logging stopped: 7/9/2019  13:50:54 ===

我希望运行安装程序的结果是应用程序安装在默认位置,或者会有更有用的错误消息,但我似乎无法找到正确的选项组合来完成此操作工作。

【问题讨论】:

    标签: node.js installation electron electron-builder


    【解决方案1】:

    我也遇到了同样的情况。现在可以通过手动删除应用程序进行新安装。您可以从控制面板> 程序> 卸载程序中删除应用程序。

    【讨论】:

      猜你喜欢
      • 2012-11-07
      • 1970-01-01
      • 1970-01-01
      • 2021-06-28
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 2013-05-25
      • 1970-01-01
      相关资源
      最近更新 更多