electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.69k stars 1.74k forks source link

plugins of nsis not work #3635

Closed koolay closed 5 years ago

koolay commented 5 years ago

directory tree

 > tree build/
build/
├── installer.nsh
├── JosefinSans-BoldItalic.ttf
├── JosefinSans-Bold.ttf
├── JosefinSans-Italic.ttf
├── JosefinSans-LightItalic.ttf
├── JosefinSans-Light.ttf
├── JosefinSans-Regular.ttf
├── JosefinSans-SemiBoldItalic.ttf
├── JosefinSans-SemiBold.ttf
├── JosefinSans-ThinItalic.ttf
├── JosefinSans-Thin.ttf
├── plugins
│   ├── SimpleSC.dll
│   ├── x86-ansi
│   │   └── SimpleSC.dll
│   └── x86-unicode
│       └── SimpleSC.dll
├── SIL Open Font License.txt
├── SimpleSC.dll
├── x86-ansi
│   └── SimpleSC.dll
└── x86-unicode
    └── SimpleSC.dll

config

    "win": {
      "icon": "/home/xxx/Downloads/xxx.png",
      "target": [
        "NSIS"
      ]
    },
    "nsis": {
      "perMachine": true,
      "include": "installer.nsh",
      "shortcutName": "APICloud",
      "unicode": false
    }

Run the building command in ubuntu1604.

electron-builder --x64 --windows

output

 • electron-builder version=20.26.1
  • loaded configuration file=package.json ("build" field)
  • Specified application directory equals to project dir — superfluous or wrong configuration appDirectory=.
  • writing effective config file=/tmp/electron_build/builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=win32 arch=x64 electron=2.0.8 appOutDir=/tmp/electron_build/win-unpacked
  • building        target=nsis file=/tmp/electron_build/APICloud-1.0.0-win.exe archs=x64 oneClick=true
Error: /home/xxx/.cache/electron-builder/nsis/nsis-3.0.3.2/linux/makensis exited with code 1
Output:
Command line defined: "APP_ID=caea15328e794b9cb4894acbf7d72b4d"
Command line defined: "APP_GUID=f44f6890-1e2b-5570-9327-d14afbc4e07a"
Command line defined: "UNINSTALL_APP_KEY=f44f6890-1e2b-5570-9327-d14afbc4e07a"
Command line defined: "PRODUCT_NAME=APICloud"
Command line defined: "PRODUCT_FILENAME=APICloud"
Command line defined: "APP_FILENAME=APICloud"
Command line defined: "APP_DESCRIPTION=APICloud"
Command line defined: "VERSION=1.0.0"
Command line defined: "PROJECT_DIR=xxxx/electron-builder-cloud/electron"
Command line defined: "BUILD_RESOURCES_DIR=xxxx/electron-builder-cloud/electron/build"
Command line defined: "MUI_ICON=/tmp/electron_build/.icon-ico/icon.ico"
Command line defined: "MUI_UNICON=/tmp/electron_build/.icon-ico/icon.ico"
Command line defined: "APP_64=/tmp/electron_build/electron_cloud-1.0.0-x64.nsis.7z"
Command line defined: "APP_64_NAME=electron_cloud-1.0.0-x64.nsis.7z"
Command line defined: "APP_64_HASH=7043A916C65BF5472B15176ED8171F986F997B93AC01C9A993303594601244404F459BC087BB16B6D14EA442781C526CFAEC2498F1DAAC9351A9BB253B2299E7"
Command line defined: "APP_INSTALLER_STORE_FILE=APICloud\__installer.exe"
Command line defined: "COMPRESSION_METHOD=7z"
Command line defined: "ONE_CLICK"
Command line defined: "RUN_AFTER_FINISH"
Command line defined: "INSTALL_MODE_PER_ALL_USERS"
Command line defined: "INSTALL_MODE_PER_ALL_USERS_REQUIRED"
Command line defined: "SHORTCUT_NAME=APICloud"
Command line defined: "UNINSTALL_DISPLAY_NAME=APICloud 1.0.0"
Command line defined: "ESTIMATED_SIZE=118481"
Command line defined: "COMPRESS=auto"
Command line defined: "BUILD_UNINSTALLER"
Command line defined: "UNINSTALLER_OUT_FILE=Z:\tmp\electron_build\.__uninstaller-nsis-electron_cloud.exe"
Processing script file: "<stdin>" (UTF8)

Error output:
Plugin not found, cannot call SimpleSC::InstallService
!include: error in script: "xxxx/electron/build/installer.nsh" on line 93
Error in script "<stdin>" on line 62 -- aborting creation process
koolay commented 5 years ago

It worked when put the plugin file into directory ~/.cache/electron-builder/nsis/nsis-3.0.3.2/Plugins/x86-ansi.

phanmn commented 5 years ago

https://stackoverflow.com/questions/54398357/use-inetc-plugin-for-nsis-with-electron-builder After following Mevia answer, I can use plugin in installer.nsh

develar commented 5 years ago

Duplicates #2400