Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th March 2003, 08:25   #1
psyke
Member
 
Join Date: Mar 2003
Posts: 65
Exclamation URGENT!! bug with IfErrors, or i need to sleep. ;)

OK, according to the docs for IfErrors:
Quote:
Checks and clears the error flag
As far as I can tell, it does not clear the error flag. Here's a small script that demonstrates this:
PHP Code:
Name "iferrors bug?"
OutFile "iferrors.exe"
ShowInstDetails nevershow
AutoCloseWindow true

Section 
"one"
  
ClearErrors
  ReadRegStr 
$1 HKCR "software\microsoft" shit
  IfErrors 0 NoError
    
#ClearErrors    ;HAVE TO CLEAR ERROR FLAG, OTHERWISE IT PERSISTS!
    
MessageBox MB_OK "could not read from HKCR\software\microsoft\shit"
    
Goto ErrorYay
  NoError
:
    
MessageBox MB_OK "read '$1' from HKCR\software\microsoft\shit"
  
ErrorYay:
SectionEnd

Section 
"two"
  
IfErrors 0 NoError
    MessageBox MB_OK 
"error in section two!!"
    
Goto ErrorYay
  NoError
:
    
MessageBox MB_OK "no errors in section two"
  
ErrorYay:
SectionEnd 
If ClearErrors is used to manually clear the error flag, that seems to work.

I hope I'm not just confused/hallucinating.

Somebody please confirm this is a bug or let me know where i've gone wrong. i'm using the latest development snapshot.

thanks

Salaam/Peace
psyke is offline   Reply With Quote
Old 30th March 2003, 10:17   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
I've tested this with a different script, but it gives the same result.

PHP Code:
ReadRegStr $1 HKCR "software\\microsoft" shit
IfErrors 0 Not
  IfErrors 0 Not
    MessageBox MB_OK 
"Error!"
Not
Or Documentation Fix or Command Fix here.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 30th March 2003, 10:59   #3
psyke
Member
 
Join Date: Mar 2003
Posts: 65
hi deguix,

thx for checking out my problem.

the script you posted shows the problem with greater clarity, thank you.

actually i started with a small script like yours, but then i was wondering if there was a scoping issue so that at least a different section would have a cleared error flag... i was quite surprised when i saw the error flag persisted across sections after using 'IfErrors'.

lol - i'm not sure how much sense that last paragraph made, but it makes sense to me.

Salaam/Peace.
psyke is offline   Reply With Quote
Old 30th March 2003, 13:10   #4
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
Well, I don't know if it's a bug in the Docs or in NSIS, but I can tell you, psyke, that you are NOT hallucinating, confused or tired. Be happy !

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 30th March 2003, 13:28   #5
psyke
Member
 
Join Date: Mar 2003
Posts: 65
thanks virtlink.

i'm feeling less confused and tired now.
psyke is offline   Reply With Quote
Old 30th March 2003, 14:06   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Fixed in latest CVS version (clears the error flag again).

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
Old 30th March 2003, 16:04   #7
psyke
Member
 
Join Date: Mar 2003
Posts: 65
thanks, kichik, great job as usual.

Salaam/Peace.
psyke 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