electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE: "could not open file: ....nsis\include\allowOnlyOneInstallerInstance.nsh"

Open Ortieez opened this issue 1 year ago • 7 comments

  • Electron-Builder Version: 24.13.3
  • Node Version: 21.7.1
  • Electron Version: 28.3.3
  • Electron Type (current, beta, nightly): current
  • Target: Windows 64 bit

Hi, I have an issue when I'm trying to build this electron-vite app to windows it throws an error:

Error output
 • electron-builder  version=24.13.3 os=10.0.22631
• loaded configuration  file=C:\Users\alipe\Documents\My Projects\dnd-app\electron-builder.yml
• writing effective config  file=dist\builder-effective-config.yaml
• skipped dependencies rebuild  reason=npmRebuild is set to false
• packaging       platform=win32 arch=x64 electron=28.3.3 appOutDir=dist\win-unpacked
• building        target=nsis file=dist\sqlite-demo-0.0.1-setup.exe archs=x64 oneClick=true perMachine=false
⨯ C:\Users\alipe\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
Output:
Command line defined: "APP_ID=com.dnd-app"
Command line defined: "APP_GUID=9bf2585d-ff7c-5c41-b388-ebed16c33dff"
Command line defined: "UNINSTALL_APP_KEY=9bf2585d-ff7c-5c41-b388-ebed16c33dff"
Command line defined: "PRODUCT_NAME=dnd-app"
Command line defined: "PRODUCT_FILENAME=dnd-app"
Command line defined: "APP_FILENAME=sqlite-demo"
Command line defined: "APP_DESCRIPTION=An Electron application with React and TypeScript"
Command line defined: "VERSION=0.0.1"
Command line defined: "PROJECT_DIR=C:\Users\alipe\Documents\My Projects\dnd-app"
Command line defined: "BUILD_RESOURCES_DIR=C:\Users\alipe\Documents\My Projects\dnd-app\build"
Command line defined: "APP_PACKAGE_NAME=sqlite-demo"
Command line defined: "MUI_ICON=C:\Users\alipe\Documents\My Projects\dnd-app\build\icon.ico"
Command line defined: "MUI_UNICON=C:\Users\alipe\Documents\My Projects\dnd-app\build\icon.ico"
Command line defined: "APP_64=C:\Users\alipe\Documents\My Projects\dnd-app\dist\sqlite-demo-0.0.1-x64.nsis.7z"
Command line defined: "APP_64_NAME=sqlite-demo-0.0.1-x64.nsis.7z"
Command line defined: "APP_64_HASH=ED2BCF96CE16086CBB658F4DBCC91A4EBBA8092DDA53EA6F10B44A2E2AB64590A296B40F19C64DC68D703997AE04AE344FD8032776A369BEA2E8D2C1A64C7E03"
Command line defined: "APP_64_UNPACKED_SIZE=274786"
Command line defined: "COMPANY_NAME=example.com"
Command line defined: "APP_PRODUCT_FILENAME=dnd-app"
Command line defined: "APP_INSTALLER_STORE_FILE=sqlite-demo-updater\installer.exe"
Command line defined: "COMPRESSION_METHOD=7z"
Command line defined: "ONE_CLICK"
Command line defined: "RUN_AFTER_FINISH"
Command line defined: "SHORTCUT_NAME=dnd-app"
Command line defined: "UNINSTALL_DISPLAY_NAME=dnd-app"
Command line defined: "RECREATE_DESKTOP_SHORTCUT"
Command line defined: "ESTIMATED_SIZE=274785"
Command line defined: "COMPRESS=auto"
Command line defined: "BUILD_UNINSTALLER"
Command line defined: "UNINSTALLER_OUT_FILE=C:\Users\alipe\Documents\My Projects\dnd-app\dist\__uninstaller-nsis-sqlite-demo.exe"
Processing config: C:\Users\alipe\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\nsisconf.nsh
Processing script file: "<stdin>" (UTF8)

Error output:
!include: could not open file: "C:\Users\alipe\Documents\My Projects\dnd-app\node_modules\.pnpm\[email protected][email protected][email protected]__electr_jhkj5etvr5lkpiqd5wtx2uh6ge\node_modules\app-builder-lib\templates\nsis\include\allowOnlyOneInstallerInstance.nsh"
Error in script "<stdin>" on line 87 -- aborting creation process
failedTask=build stackTrace=Error: C:\Users\alipe\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
Output:
Command line defined: "APP_ID=com.dnd-app"
Command line defined: "APP_GUID=9bf2585d-ff7c-5c41-b388-ebed16c33dff"
Command line defined: "UNINSTALL_APP_KEY=9bf2585d-ff7c-5c41-b388-ebed16c33dff"
Command line defined: "PRODUCT_NAME=dnd-app"
Command line defined: "PRODUCT_FILENAME=dnd-app"
Command line defined: "APP_FILENAME=sqlite-demo"
Command line defined: "APP_DESCRIPTION=An Electron application with React and TypeScript"
Command line defined: "VERSION=0.0.1"
Command line defined: "PROJECT_DIR=C:\Users\alipe\Documents\My Projects\dnd-app"
Command line defined: "BUILD_RESOURCES_DIR=C:\Users\alipe\Documents\My Projects\dnd-app\build"
Command line defined: "APP_PACKAGE_NAME=sqlite-demo"
Command line defined: "MUI_ICON=C:\Users\alipe\Documents\My Projects\dnd-app\build\icon.ico"
Command line defined: "MUI_UNICON=C:\Users\alipe\Documents\My Projects\dnd-app\build\icon.ico"
Command line defined: "APP_64=C:\Users\alipe\Documents\My Projects\dnd-app\dist\sqlite-demo-0.0.1-x64.nsis.7z"
Command line defined: "APP_64_NAME=sqlite-demo-0.0.1-x64.nsis.7z"
Command line defined: "APP_64_HASH=ED2BCF96CE16086CBB658F4DBCC91A4EBBA8092DDA53EA6F10B44A2E2AB64590A296B40F19C64DC68D703997AE04AE344FD8032776A369BEA2E8D2C1A64C7E03"
Command line defined: "APP_64_UNPACKED_SIZE=274786"
Command line defined: "COMPANY_NAME=example.com"
Command line defined: "APP_PRODUCT_FILENAME=dnd-app"
Command line defined: "APP_INSTALLER_STORE_FILE=sqlite-demo-updater\installer.exe"
Command line defined: "COMPRESSION_METHOD=7z"
Command line defined: "ONE_CLICK"
Command line defined: "RUN_AFTER_FINISH"
Command line defined: "SHORTCUT_NAME=dnd-app"
Command line defined: "UNINSTALL_DISPLAY_NAME=dnd-app"
Command line defined: "RECREATE_DESKTOP_SHORTCUT"
Command line defined: "ESTIMATED_SIZE=274785"
Command line defined: "COMPRESS=auto"
Command line defined: "BUILD_UNINSTALLER"
Command line defined: "UNINSTALLER_OUT_FILE=C:\Users\alipe\Documents\My Projects\dnd-app\dist\__uninstaller-nsis-sqlite-demo.exe"
Processing config: C:\Users\alipe\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\nsisconf.nsh
Processing script file: "<stdin>" (UTF8)









                                                                                                                                                                                                  Error output:
!include: could not open file: "C:\Users\alipe\Documents\My Projects\dnd-app\node_modules\.pnpm\[email protected][email protected][email protected]__electr_jhkj5etvr5lkpiqd5wtx2uh6ge\node_modules\app-builder-lib\templates\nsis\include\allowOnlyOneInstallerInstance.nsh"
Error in script "<stdin>" on line 87 -- aborting creation process









                                                                                                                                                                                                      at ChildProcess.<anonymous> (C:\Users\alipe\Documents\My Projects\dnd-app\node_modules\.pnpm\[email protected]\node_modules\builder-util\src\util.ts:252:14)
  at Object.onceWrapper (node:events:634:26)
  at ChildProcess.emit (node:events:519:28)
  at ChildProcess.cp.emit (C:\Users\alipe\Documents\My Projects\dnd-app\node_modules\.pnpm\[email protected]\node_modules\cross-spawn\lib\enoent.js:34:29)
  at maybeClose (node:internal/child_process:1105:16)
  at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
 ELIFECYCLE  Command failed with exit code 1.

If needed, my repo for this project is: github.com/ortieez/dnd-app

I have no clue what to do with this.

Ortieez avatar Jul 17 '24 15:07 Ortieez

Are you using pnpm? If so, can you try these settings for your .npmrc? https://pnpm.io/next/npmrc#virtual-store-dir https://pnpm.io/next/npmrc#virtual-store-dir-max-length (set it something lower than default, like 80?)

mmaietta avatar Jul 17 '24 18:07 mmaietta

Thanks for the tip, however that still does not work. I have tried setting the virtual-store-dir, then tried setting the number to 80, 70, 60, 50.. But nothing worked. I also tried with npm.


HOWEVER I now tried using yarn instead, it somehow worked and the app built successfully.

I am really confused.. but it works with yarn :D

Ortieez avatar Jul 17 '24 22:07 Ortieez

I just encountered the same problem with pnpm and setting virtual-store-dir-max-length=70 helped.

gzdunek avatar Jul 24 '24 14:07 gzdunek

Can confirm, setting virtual-store-dir-max-length=70 then reinstall using pnpm install fix the issue.

hsnfirdaus avatar Jul 25 '24 16:07 hsnfirdaus

先改virtual-store-dir-max-length=70再pnpm install 直接 ok

Guocccw avatar Jul 26 '24 10:07 Guocccw

Finally good, really can't stand it

embraceyouting avatar Aug 04 '24 04:08 embraceyouting

Running pnpm config set virtual-store-dir-max-length 70 worked just fine! Can someone please help me understand why?

SalimOfShadow avatar Aug 16 '24 19:08 SalimOfShadow

I have the same question: [email protected] Why does not support the default configuration of pnpm

virtual-store-dir-max-length

Default: On Linux/macOS: 120 On Windows: 60

Types: number

MengLizhi avatar Mar 25 '25 01:03 MengLizhi

@MengLizhi official pnpm hoisting support was added in 26.0.3+ when we migrated from a Golang dependency to a completely new JS-based implementation. Can you please try the latest release v26.0.12?

mmaietta avatar Mar 25 '25 18:03 mmaietta

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Apr 25 '25 00:04 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar May 28 '25 00:05 github-actions[bot]