Old 24th January 2006, 12:11   #1
nlpaufr
Junior Member
 
Join Date: Jan 2006
Location: Etten-Leur, the Netherlands
Posts: 3
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
nlpaufr is offline   Reply With Quote
Old 24th January 2006, 13:23   #2
nlpaufr
Junior Member
 
Join Date: Jan 2006
Location: Etten-Leur, the Netherlands
Posts: 3
Lightbulb

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.
nlpaufr is offline   Reply With Quote
Old 24th January 2006, 13:36   #3
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
yep, u need to use absolute jumps with labels rather than relative jumps.
Comm@nder21 is offline   Reply With Quote
Old 24th January 2006, 13:41   #4
nlpaufr
Junior Member
 
Join Date: Jan 2006
Location: Etten-Leur, the Netherlands
Posts: 3
I changed the IfErrors statement to

${If} ${Errors}
!InsertMacro Logging "File $MY_TEMP\${FILE_NAME} could not be installed"
${EndIf}
nlpaufr is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump