NSIS build fails
See original GitHub issueNot sure if it’s already supposed to be buildable, in any case here is the output:
Building one-click NSIS installer using nsis 3.0rc1
Command line defined: "PRODUCT_NAME=My App"
Command line defined: "APP_ID=com.app.my"
Command line defined: "APP_DESCRIPTION=My App Client Software"
Command line defined: "APP_BUILD_DIR=/Users/kunkinkan/Desktop/app/dist/win-unpacked"
Command line defined: "VERSION=1.5.1"
Command line defined: "MUI_ICON=/Users/kunkinkan/Desktop/app/build/icon.ico"
Command line defined: "MUI_UNICON=/Users/kunkinkan/Desktop/app/build/icon.ico"
Command line defined: "COMPANY_NAME=app Foundation"
Command line defined: "APP_EXECUTABLE_FILENAME=My App.exe"
Command line defined: "UNINSTALL_FILENAME=Uninstall My App.exe"
Command line defined: "MULTIUSER_INSTALLMODE_INSTDIR=85125e2a-0211-5c49-9018-9358da1074b1"
Command line defined: "MULTIUSER_INSTALLMODE_INSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1"
Command line defined: "MULTIUSER_INSTALLMODE_UNINSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1"
Command line defined: "MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME=UninstallString"
Command line defined: "MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME=InstallLocation"
Command line defined: "MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER"
Command line defined: "MULTIUSER_INSTALLMODE_ALLOW_ELEVATION"
Command line defined: "ONE_CLICK"
Processing config: /Users/kunkinkan/.cache/nsis/nsis-3.0rc1/nsisconf.nsh
Processing script file: "/Users/kunkinkan/Desktop/app/node_modules/electron-builder/templates/nsis/installer.nsi" (UTF8)
Unhandled rejection Error: libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Error: Command failed: /Users/kunkinkan/.cache/nsis/nsis-3.0rc1/osx/makensis -DPRODUCT_NAME=My App -DAPP_ID=com.app.my -DAPP_DESCRIPTION=My App Client Software -DAPP_BUILD_DIR=/Users/kunkinkan/Desktop/app/dist/win-unpacked -DVERSION=1.5.1 -DMUI_ICON=/Users/kunkinkan/Desktop/app/build/icon.ico -DMUI_UNICON=/Users/kunkinkan/Desktop/app/build/icon.ico -DCOMPANY_NAME=app Foundation -DAPP_EXECUTABLE_FILENAME=My App.exe -DUNINSTALL_FILENAME=Uninstall My App.exe -DMULTIUSER_INSTALLMODE_INSTDIR=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_INSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_UNINSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME=UninstallString -DMULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME=InstallLocation -DMULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER -DMULTIUSER_INSTALLMODE_ALLOW_ELEVATION -DONE_CLICK -XFileBufSize 64 -XName "My App" -XOutFile "/Users/kunkinkan/Desktop/app/dist/My App Setup 1.5.1.exe" -XUnicode true -XSetCompressor /SOLID lzma -XSetCompressorDictSize 64 -XAutoCloseWindow true /Users/kunkinkan/Desktop/app/node_modules/electron-builder/templates/nsis/installer.nsi
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
at /Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/util.ts:91:18
at ChildProcess.exithandler (child_process.js:209:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12)
From previous event:
at Object.exec (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/util.ts:78:9)
at NsisTarget.<anonymous> (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/targets/nsis.ts:121:15)
at undefined.next (native)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
From previous event:
at tsAwaiter (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/awaiter.ts:10:47)
at Object.build (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/builder.ts:182:52)
at Object.<anonymous> (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/build-cli.ts:8:28)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:449:3
Building one-click NSIS installer using nsis 3.0rc1
Error: libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Error: Command failed: /Users/kunkinkan/.cache/nsis/nsis-3.0rc1/osx/makensis -DPRODUCT_NAME=My App -DAPP_ID=com.app.my -DAPP_DESCRIPTION=My App Client Software -DAPP_BUILD_DIR=/Users/kunkinkan/Desktop/app/dist/win-unpacked -DVERSION=1.5.1 -DMUI_ICON=/Users/kunkinkan/Desktop/app/build/icon.ico -DMUI_UNICON=/Users/kunkinkan/Desktop/app/build/icon.ico -DCOMPANY_NAME=app Foundation -DAPP_EXECUTABLE_FILENAME=My App.exe -DUNINSTALL_FILENAME=Uninstall My App.exe -DMULTIUSER_INSTALLMODE_INSTDIR=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_INSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_UNINSTALL_REGISTRY_KEY=85125e2a-0211-5c49-9018-9358da1074b1 -DMULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME=UninstallString -DMULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME=InstallLocation -DMULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER -DMULTIUSER_INSTALLMODE_ALLOW_ELEVATION -DONE_CLICK -XFileBufSize 64 -XName "My App" -XOutFile "/Users/kunkinkan/Desktop/app/dist/My App Setup 1.5.1.exe" -XUnicode true -XSetCompressor /SOLID lzma -XSetCompressorDictSize 64 -XAutoCloseWindow true /Users/kunkinkan/Desktop/app/node_modules/electron-builder/templates/nsis/installer.nsi
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
at /Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/util.ts:91:18
at ChildProcess.exithandler (child_process.js:209:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12)
From previous event:
at Object.exec (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/util.ts:78:9)
at NsisTarget.<anonymous> (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/targets/nsis.ts:121:15)
at undefined.next (native)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
From previous event:
at tsAwaiter (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/awaiter.ts:10:47)
at Object.build (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/builder.ts:182:52)
at Object.<anonymous> (/Users/kunkinkan/Desktop/app/node_modules/electron-builder/src/build-cli.ts:8:28)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:449:3
Issue Analytics
- State:
- Created 7 years ago
- Comments:36 (20 by maintainers)
Top Results From Across the Web
Windows 10 build Error (NSIS) #1850 - GitHub
When I try to build app with npm run package I get an error while NSIS packaging stage. Building NSIS installer Packaging NSIS...
Read more >nsis script fails to build in electron-builder - Stack Overflow
I'm assuming you commented out the ;StrCmp $R1 '10' lbl_winnt_10_2016 line? Try adding the line back but change lbl_winnt_10_2016 to ...
Read more >Why do I get NSIS Error?
The installer has failed a self-check. This means that for some actions, the installer file has been altered from its original form. If...
Read more >Wireshark 3.5 NSIS Build Error
I'm trying to build a NSIS installer for Wireshark 3.5 and encounter build errors related to generating documentation.
Read more >How to fix the NSIS error in Windows 11 - YouTube
Interested in how to fix the NSIS error in Windows 11?This video will show you how to do it!▻ Check articles with full ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I finally figured out what the issue was. It was caused by encoding.
https://sourceforge.net/p/nsis/bugs/1165/
Modyfing the generated script which is piped into stdin to state
Unicode false
, works.I also discovered the reason why it worked in SSH-ing into the builder server vs Jenkins.
When SSH-ing into the builder server and typing
locale
.When making Jenkins run
locale
.So the solution for me was to change the environment variables within Jenkins to match the ones which exist when SSH-ing.
Apparently this is a well known issue http://unix.stackexchange.com/questions/164779/jenkins-does-not-use-systems-locales
@develar How does makensis fail? Error message?
makensis uses the current locale when dealing with command line parameters and the filesystem on the local machine (and probably a couple of other places). It does not really care what the locale is but your input data needs to be able to be converted to wchar_t with mbsrtowcs etc.