Archive: CopyFiles IfErrors


CopyFiles IfErrors
Hello!

Can somebody please help me?
I'm trying to find out why my CopyFiles statement generates an error in the logging:

CopyFiles "E:\sattmate\target\Patches\Patch_2\Backup\FILES\GLOBAL\transport_handler.txt"->"E:\sattmate\user\nlpaufr"
Call: 2164
detailprint: File E:\sattmate\user\nlpaufr\transport_handler.txt could not be installed

My code is:
ExpandEnvStrings $MY_TEMP ${TO_FOLDER_NAME}
ClearErrors
CopyFiles /FILESONLY /SILENT $TARGET_FOLDER_PATCH\${FROM_FOLDER_NAME}\${FILE_NAME} "$MY_TEMP"
IfErrors 0 +2
!InsertMacro Logging "File $MY_TEMP\${FILE_NAME} could not be installed"


I've been searching the NSIS forum for help on this, but I can't seem to find a thread that explains why my IfErrors statement doesn't do what I expect.
By the way, how do I find out what the actual error is? I found a thread about kernel32.dll but I don't understand how that is supposed to work. The results I get are numbers, not texts...

Many thanks,

Pauline


I actually found out what the problem was myself!
The !InsertMacro statement just below the IfErrors is what made it all go wrong. The jump from the Iferrors jumps into the Logging macro statements, instead of to the statements after the Logging Macro.:tinfoil:


yep, u need to use absolute jumps with labels rather than relative jumps.


I changed the IfErrors statement to

${If} ${Errors}
!InsertMacro Logging "File $MY_TEMP\${FILE_NAME} could not be installed"
${EndIf}