Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 12th May 2006, 16:04   #1
bambou51
Guest
 
Posts: n/a
error during CreateDir

The following code triggers an alarm unless the folder already exists:

ClearErrors
${CreateDirectory} "c:\folder"
IfErrors 0 +2
MessageBox MB_OK "Failed to create folder: $0"

I have exactly the same problem with CopyFiles
  Reply With Quote
Old 12th May 2006, 18:21   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Are you using this.
Not enough information really.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 14th May 2006, 16:02   #3
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
I was having a similar problem recently. I found out in my situation that it was becuase I was using some relative jumps in my macros that actually caused the code to jump to my error routine when there wasn't really an error at all.

My solution was to use labels instead of relative jumps. That might work for you too with the line that reads "IfErrors 0 +2"
Comperio is offline   Reply With Quote
Old 15th May 2006, 06:35   #4
bambou51
Guest
 
Posts: n/a
I still have the same problem with label jump...

${RecFindOpen} "$EXEDIR\Media" $R0 $R1
ClearErrors
CreateDirectory "$TARGET$R0"
IfErrors exitWithFolderErrors
${RecFindFirst}
ClearErrors
CopyFiles "$EXEDIR\Media$R0\$R1" "$TARGET$R0\$R1"
IfErrors exitWithFileErrors
${RecFindNext}
${RecFindClose}

exitWithFolderErrors:
MessageBox MB_OK "Failed to create folder: $TOPKAPI_FOLDER$R0 ($0)"
Quit
exitWithFileErrors:
MessageBox MB_OK "Failed to copy file: $TOPKAPI_FOLDER$R0\$R1 ($0)"
Quit

The folder is created, but I have an error...
  Reply With Quote
Old 19th May 2006, 09:57   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Are you using the latest version of NSIS? I think I recall a bug fixed in some version that caused CreateDirectory to raise the error flag with no good reason.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp 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