Archive: Copy a directory after install


Copy a directory after install
Hey guys,

is it possible to copy a directory after the installation with nsis?


CopyFiles can copy files and directories and it also works after the instfiles page if that's what you want


thanks!

but two question:
1.:
If my program installed successfully, i want do copy some files (copyfiles is ok). But in which function/section can i do this? Section -Post ?

2.:
I tryed CopyFiles in the Section -Post, but it didnt copy my files.
In the function .onInit it did.


Any invisible section will be executed unconditionally. Check your CopyFiles statement.

Stu


Just adding on Afrow's comments...

If you want to copy only if there were no errors in the install, then you might consider using the function .onInstSuccess.

If you decide to use a section (such as one named "-post" as you stated earlier), then make sure that section is the last one in your install script. (Sections execute in order from top down.)


thanks guys :)

but in the .onInstSuccess function, CopyFiles dont work :(
here my code:

Function .onInstSuccess

; Updaten
CopyFiles ".\Service Packs\*.*" "$INSTDIR"

FunctionEnd


i want to copy all files in service packs to my installdir (service packs should be a extra folder).

don't use relative paths, use full paths (no ".\")


Hi Anders,

the problem is: our installer is on a cd and i dont know the path.
or do you have a better suggestion?


$EXEDIR

Stu


yeah, it works! thank you very much!! :D