NSIS版本不会在Windows上安装Electron应用程序。安装程序无提示退出并产生1620错误

时间:2019-07-09 18:37:31

标签: node.js installation electron electron-builder

我正在使用电子构建器构建一个电子应用程序。构建过程会生成一个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 ===

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

1 个答案:

答案 0 :(得分:0)

我当时处在同样的情况。现在可以通过手动删除应用程序来进行新安装。您可以从“控制面板”>“程序”>“卸载程序”中删除应用程序。