Как использовать построитель электронов с портативной мишенью?

Я пытаюсь создать exe-файл с electron-builder не установщиком, поэтому я пытаюсь установить для цели переносимый

{
  "name": "hello-world",
  "version": "1.0.0",
  "description": "a hello world",
  "main": "index.js",
  "scripts": {
    "start": "electron .",
    "dist": "build"
  },
  "author": "KR",
  "license": "ISC",
  "devDependencies": {
    "electron": "^4.1.4",
    "electron-builder": "^20.39.0"
  },
  "build":{
     "appId": "com.whatever.helloworld",
     "win":{
        "target": ["portable"],
         "icon" :   "build/icon.ico"            
     }
     
    
  }
}

Однако когда я пытаюсь npm run dist, я получаю

Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
  • electron-builder version=20.39.0
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=dist\builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=win32 arch=x64 electron=4.1.4 appOutDir=dist\win-unpacked
  • default Electron icon is used reason=application icon is not set
  • building        target=portable file=dist\hello-world 1.0.0.exe archs=x64

и программа застряла навсегда. Когда я его ломаю (ctrl-c), он говорит

 Error: Exit code: 255. Command failed: D:\electrontest\hello-world\node_modules\7zip-bin\win\x64\7za.exe a -bd -mx=9 -mtc=off -mtm=off -mta=off D:\electrontest\hello-world\dist\hello-world-1.0.0-x64.nsis.7z .

Итак, я предполагаю, что программа застряла в сжатии 7za.

Я искал, и нет ни одного примера использования electronic-builder с портативными только несколькими с nsis. (У меня есть еще один вопрос, но сначала я хотел бы изучить основы).


person KansaiRobot    schedule 22.04.2019    source источник


Ответы (1)


используйте электронный конструктор из 1, затем в package.json используйте в скриптах:

"dist": "electron-builder --win=portable",
person Muhammad Usman    schedule 03.09.2020