Archive: Copying Installer EXE


Copying Installer EXE
Hi there,

I want to be able to copy the installer's EXE file to the install directory as part of the installation procedure, so I can use Windows Add/Remove Programs' repair function to allow the user to reinstall our program if it gets damaged.

I can use $EXEDIR to get the directory the EXE is in, but is there an equivilent for the EXE name as defined by OutFile? I tried referencing OutFile using $OutFile and ${OutFile} but it didn't work.

I don't really want to define the installer's name twice in the script.

Thanks!

David Hall


Ah just found this:
http://nsis.sourceforge.net/Get_installer_filename


Here's the code

; Copy installer to installation directory
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
CopyFiles "$R0" "$INSTDIR"