Search code examples
pluginsnsis

NSIS - file in PLUGINSDIR doesn't execute


Function .onInit
  InitPluginsDir
  ; check registry for installed version...
Function End
Section "other" OTHER
  !define SOME_FILE "file.exe"
  SetOutPath "$PLUGINSDIR"
  File /nonfatal "${SOME_FILE}"
  ExecWait '"$PLUGINSDIR\${SOME_FILE}" /q /norestart'
SectionEnd

I have replaced TEMP (which I would delete at the end) with PLUGINSDIR, because it makes sense to use NSIS's own temporary directory.

But it doesn't work, the execution doesn't happen.

Am I doing it right ?


Solution

  • Looks correct to me.

    Are you sure the file exists? Remove the /nonfatal maybe.

    Maybe anti virus getting in the way? Try Process Monitor to see why process creation fails...