question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows 10 build Error (NSIS)

See original GitHub issue
  • 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

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
pamtbaaucommented, Dec 23, 2017

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

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

0reactions
xadkcommented, Aug 8, 2021

I was having the same problem. Apparently electron-builder does blind copy without checking if directories in target path exist and doesn’t even try to create them, which raises the exception. I created all the non-existing directories in target path [/resources] so that it can copy and it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve NSIS Error : 4 Steps - Instructables
1.Clear your browser's cache. ... 3.Download the installer using another computer and copy it to the original computer. 4. Scan the hard drive...
Read more >
FIX: NSIS error "Error launching installer" - Appuals.com
The message NSIS error – Error launching installer means that the installer has failed the self-check because it has been modified from its...
Read more >
NSIS Error - Microsoft Community
The NSIS errors may occur under one of the following conditions: 1. Software files downloaded from the Internet are not complete.
Read more >
How To Fix the NSIS error Error launching installer in ...
How To Fix the NSIS error Error launching installer in Windows 10 or 11 · Method 1: Shifting the setup file to another...
Read more >
8 Fixes For NSIS Error "Error Launching Installer"
Solutions To Fix NSIS Error · Use Command Prompt To Install A Program. · Rename The File, Or Change The Location. · Download...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found