|
|
#1 |
|
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 |
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Major Dude
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" |
|
|
|
|
|
#4 |
|
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... |
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] 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 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|