Search code examples
nsis

NSIS - how to get the filename of the installer executable?


I've found two ways of getting the complete path of the installer file in a NSIS script:

  1. System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
  2. Using $EXEPATH (2.26+)

But I need only the filename, and not the complete path. How go get it? Is there an ExtractFileName() type function?


Solution

  • $EXEFILE is what you want. It'll be of the form foo.exe.