Skip to content
⌘ NSIS Forum Archive

Appending 2 files together

4 posts

Sheik#

Appending 2 files together

Hi all,
Is there any command in NSIS that can append 2, possibly large, files together?

Similar to cmd.exe's copy command where you can do a "copy file1+file2 file3" ?
(I suppose I could "exec" that command if needed)

I know I could also write a short function that would use FileOpen/FileRead/FileWrite/FileClose to do this as well.
But I thought purposes that maybe CopyFiles or something else might be able to do it directly with a flag maybe?
Red Wine#
Read the documentation, it saves time and effort.

Sheik#
Doh!
I didn't even THINK to look in the textfunc header!

I looked in Filefunc header, and didn't see anything, so I figured there was nothing already made!

Thanks again!
Scott
zeeh3#edited
Well, I have been using this with success:

!macro NOWINDOW PATH_EXEC PARAMS TEXT
  DetailPrint "${TEXT}"
  nsExec::Exec '"${PATH_EXEC}" ${PARAMS}'
!macroend
ReadEnvStr $R0 "COMSPEC"
!insertmacro NOWINDOW "$R0" '/c copy /B "$INSTDIR\part.001" + "$EXEDIR\part.002" "$INSTDIR\joined.dat" /y' "Joining Files..." 
Very fast with big files 🙂