Electron-builder: Custom NSIS Script !include could not find nsh file

Created on 10 Feb 2017  路  4Comments  路  Source: electron-userland/electron-builder

  • Version: 13.3.1

  • Target: Windows


I'm trying to include this _EnvVarUpdate.nsh_ so I can update the PATH environment variable. According to the wiki page

build is added as addincludedir (i.e. you don't need to use BUILD_RESOURCES_DIR to include files).

so in my _build/installer.nsh_ the first line I have !include "EnvVarUpdate.nsh"

but I keep getting the error below.

Error output:
!include: could not find: "EnvVarUpdate.nsh"
!include: error in script: "/home/jonathan/Documents/Git/sdt/build/installer.nsh" on line 1
Error in script "<stdin>" on line 5 -- aborting creation process

If I try to change to !include "${BUILD_RESOURCES_DIR}/EnvVarUpdate.nsh" it seems to load the file but got a different error while creating the installer.

Processed 1 file, 10 command line commands, writing output (x86-unicode):
warning: uninstall function "un.EnvVarUpdate" not referenced - zeroing code (179-377) out

Note: you may have one or two (large) stale temporary file(s) left in your temporary directory (Generally this only happens on Windows 9x).

Error output:
Error: warning treated as error

Any ideas? Much appreciate!

Most helpful comment

Same problem for me but the suggested link does not exist anymore...

All 4 comments

@develar worked great! thanks! what about

build is added as addincludedir (i.e. you don't need to use BUILD_RESOURCES_DIR to include files).

it doesn't seem to do what it's advertising.

@FromStoneage Do you have an example showing how to include the EnvVarUpdate function in your .nsh script

Same problem for me but the suggested link does not exist anymore...

Was this page helpful?
0 / 5 - 0 ratings