Old 11th December 2003, 19:54   #1
psyke
Member
 
Join Date: Mar 2003
Posts: 65
Possible error in makensis,nsi

Hello.

I've been seeing this on my system for a while now (sorry I didn't point it out earlier. )

It appears to me that the .nsi and .nsh file types aren't registered if NSIS is being installed and these associations weren't already setup up by an older (pre beta4) NSIS installer.

Here's the relevant code (with extraneous bits snipped) from examples\makensis.nsi:
PHP Code:
  ReadRegStr $R0 HKCR ".nsi" ""
  
StrCmp $R0 "NSISFile" 0 no_nsioldassoc
    DeleteRegKey HKCR 
"NSISFile"
    
Goto nsi
  no_nsioldassoc
:

  
StrCmp $R0 "NSIS.Script" 0 no_nsi
    nsi
:
    <
SNIP!>
    
no_nsiopen:
    <
SNIP!>
  
no_nsi
Now say this is being run on a system where .nsi isn't registered to open with anything.

After the ReadRegStr, $R0 will contain "", and the comparison to NSISFile will fail so we branch to no_nsioldassoc. Now the comparison to NSIS.Script fails and we go to no_nsi. And we're done registering .nsi on this system.

It seems odd to be checking for NSIS.Script before it's ever written (I guess you're trying to skip registering if it's already been done). But I'm not 100% certain what kinds of situations you're trying to account for so I'll have to leave the solution in your hands. For myself, I simply replaced the jump to no_nsioldassoc with a jump to nsi as a temporary workaround.


My thanks to all contributors to NSIS, it's an incredibly remarkable piece of software!
psyke is offline   Reply With Quote
Old 11th December 2003, 20:04   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Thanks, fixed.
Joost Verburg 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