electron-builder: Windows 10 build Error (NSIS)

  • Version: 19.8.0

  • Target: Windows

Hi;

When I run npm run dev my app works fine. When I try to build app with npm run package I get an error while NSIS packaging stage.

Building NSIS installer
  Packaging NSIS installer for arch x64
Error: C:\Users\Benny\AppData\Local\electron-builder\cache\nsis\nsis-3.0.1.13\Bin\makensis.exe exited with code 1
Output:
Command line defined: "APP_ID=org.develar.ElectronReact"
Command line defined: "APP_GUID=6bbac5fa-04bd-5b9b-b752-acf42e3ab443"
Command line defined: "PRODUCT_NAME=ElectronReact"
Command line defined: "PRODUCT_FILENAME=ElectronReact"
Command line defined: "APP_FILENAME=electron-react-boilerplate"
Command line defined: "APP_DESCRIPTION=Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development"
Command line defined: "VERSION=1.0.0"
Command line defined: "PROJECT_DIR=C:\Apps\order-siparis"
Command line defined: "BUILD_RESOURCES_DIR=C:\Apps\order-siparis\resources"
Command line defined: "COMPANY_NAME=C. T. Lin"
Command line defined: "APP_PRODUCT_FILENAME=ElectronReact"
Command line defined: "APP_64=C:\Apps\order-siparis\release\electron-react-boilerplate-1.0.0-x64.nsis.7z"
Command line defined: "APP_64_NAME=electron-react-boilerplate-1.0.0-x64.nsis.7z"
Command line defined: "COMPRESSION_METHOD=7z"
Command line defined: "REQUEST_EXECUTION_LEVEL=user"
Command line defined: "COMPRESS=auto"
Processing config: C:\Users\Benny\AppData\Local\electron-builder\cache\nsis\nsis-3.0.1.13\nsisconf.nsh
Processing script file: "<stdin>" (ACP)

Error output:
Plugin not found, cannot call Nsis7z::Extract
Error in macro doExtractEmbeddedAppPackage on macroline 4
Error in macro extractEmbeddedAppPackage on macroline 18
Error in script "<stdin>" on line 21 -- aborting creation process

NSIS script:
!addincludedir "C:\Apps\order-siparis\node_modules\electron-builder\templates\nsis\include"
!addplugindir /x86-unicode "C:\Users\Benny\AppData\Local\electron-builder\cache\nsis-resources\nsis-resources-3.0.0\plugins\x86-unicode"
!addplugindir /x86-unicode "C:\Apps\order-siparis\resources\x86-unicode"
!include "C:\Users\Benny\AppData\Local\Temp\electron-builder-TpJGD7\0-1-messages.nsh"
!include "common.nsh"

WindowIcon Off
AutoCloseWindow True
RequestExecutionLevel ${REQUEST_EXECUTION_LEVEL}

SilentInstall silent

Function .onInit
  !insertmacro check64BitAndSetRegView
FunctionEnd

Section
  StrCpy $INSTDIR $PLUGINSDIR\app
        SetOutPath $INSTDIR

        !insertmacro extractEmbeddedAppPackage

  System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_DIR", "$EXEDIR").r0'
        ExecWait "$INSTDIR\${APP_EXECUTABLE_FILENAME}"

  SetOutPath $PLUGINSDIR
        RMDir /r $INSTDIR
SectionEnd

Can someone direct me to the right way please. I’m pretty lost for now.

OS: Windows 10
node: v8.1.2
npm: 5.1.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 8
  • Comments: 31 (10 by maintainers)

Most upvoted comments

FYI: Deleting C:\Users\pamtbaau\AppData\Local\electron-builder\cache directory solved the issue for me.

Using: “electron-builder”: “^19.49.2”,