Archive: Copy outfile to install directory


Copy outfile to install directory
I am trying to write my installer so that when it has completed a certain task, that it copies itself to the output directory. I have something similar to this:

!define OUTFILE "filename"

OutFile "${OUTFILE}.exe"

CreateDirectory $INSTDIR
CopyFiles "${OUTFILE}.exe" "$INSTDIR"

The output says the copy failed. Does anyone have an idea for me?

Thanks.


outfile is the name and location where the compiler should write the installer.
Copyfiles is a runtime instruction to copy files from a certain location to a certain location on target machine.