Sashka
7th April 2005, 05:39
NSIS version I am using is the latest official release -- NSIS 2.06
Here are the two code samples. First one does not work, so I had to revert to the second one, which does what I want. By not working I mean that it obviously does not create the directory (which has an illegal character '?'), but also it does not display the message box, as it should.
1)
...
StrCpy $TMP_DIR "C:\lalala?"
ClearErrors
CreateDirectory "$TMP_DIR"
IfErrors 0 +3
MessageBox MB_OK "Cannot create directory '$TMP_DIR'"
Abort
...
2)
...
StrCpy $TMP_DIR "C:\lalala?"
ClearErrors
CreateDirectory "$TMP_DIR"
IfFileExists "$TMP_DIR\*.*" +3
MessageBox MB_OK "Cannot create directory '$TMP_DIR'"
Abort
...
Another relevant matter. Are the calls 'IfErrors' and 'GetErrorLevels' related? Would it be correct to say that 'IfErrors' checks whether there is any error at all, whereas 'GetErrorLevel $var' shows the actual error code value?
Here are the two code samples. First one does not work, so I had to revert to the second one, which does what I want. By not working I mean that it obviously does not create the directory (which has an illegal character '?'), but also it does not display the message box, as it should.
1)
...
StrCpy $TMP_DIR "C:\lalala?"
ClearErrors
CreateDirectory "$TMP_DIR"
IfErrors 0 +3
MessageBox MB_OK "Cannot create directory '$TMP_DIR'"
Abort
...
2)
...
StrCpy $TMP_DIR "C:\lalala?"
ClearErrors
CreateDirectory "$TMP_DIR"
IfFileExists "$TMP_DIR\*.*" +3
MessageBox MB_OK "Cannot create directory '$TMP_DIR'"
Abort
...
Another relevant matter. Are the calls 'IfErrors' and 'GetErrorLevels' related? Would it be correct to say that 'IfErrors' checks whether there is any error at all, whereas 'GetErrorLevel $var' shows the actual error code value?