Old 14th January 2002, 03:01   #1
MailmanHS
Junior Member
 
Join Date: Jan 2002
Posts: 3
Section executes even though its not checked

My install prog has 3 sections, one required for the program, and two for creating shortcuts. the desktop shortcuts section seems to execute even if its unchecked, and executes twice if checked. I'm not using any InstType groups. I just want the three options. Any ideas why its doing this? I'm using NSIS 1.94.

Section "HiT-SQUAD Alpha 0.50 (required)"
;Install Files
SetOutPath $INSTDIR
SetCompress Auto
SetOverwrite on
File /r testbuild\*.*
SectionEnd

SectionDivider " shortcuts "

Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\HiT-SQUAD.lnk" "$INSTDIR\Bin\SeriousSam.exe" "+game hit-squad" "$INSTDIR\mods\hit-squad\hs.ico" 0
SectionEnd

Section "Start Menu Shortcut"
CreateDirectory "$SMPROGRAMS\HiT-SQUAD"
CreateShortCut "$SMPROGRAMS\HiT-SQUAD\HiT-SQUAD.lnk" "$INSTDIR\Bin\SeriousSam.exe" "+game hit-squad" "$INSTDIR\mods\hit-squad\hs.ico" 0
CreateShortCut "$SMPROGRAMS\HiT-SQUAD\Start Dedicated HS Server.lnk" "$INSTDIR\Bin\DedicatedServer.exe" "DefaultHS +game hit-squad" "$INSTDIR\mods\hit-squad\hs.ico" 0
; CreateShortCut "$SMPROGRAMS\HiT-SQUAD\Uninstall.lnk" "$INSTDIR\Mods\hit-squad\Uninst.exe"
SectionEnd

edit: also, when i compile the script, it says I have 4 sections (1 required). That should be 3 sections (1 required).

edit: hrmm, it seems that if I comment out SectionDivider " shortcuts " that fixes it. I'd rather not have to comment out the divider. Any ideas why this command would screw things up?

Last edited by MailmanHS; 14th January 2002 at 03:27.
MailmanHS is offline   Reply With Quote
Old 14th January 2002, 21:57   #2
MailmanHS
Junior Member
 
Join Date: Jan 2002
Posts: 3
anyone?
MailmanHS is offline   Reply With Quote
Old 14th January 2002, 22:20   #3
F. Heidenreich
Member
 
F. Heidenreich's Avatar
 
Join Date: Nov 2001
Location: Dresden, Germany
Posts: 97
I've reproduced this behaviour with this small script:
code:
Name "Test"
OutFile "Test-Setup.exe"

Section
MessageBox MB_OK "Section 1"
SectionEnd

SectionDivider " divider "

Section
MessageBox MB_OK "Section 2"
SectionEnd



and I think this is a bug in NSIS.

~ Florian
F. Heidenreich is offline   Reply With Quote
Old 15th January 2002, 07:25   #4
F. Heidenreich
Member
 
F. Heidenreich's Avatar
 
Join Date: Nov 2001
Location: Dresden, Germany
Posts: 97
A better sample would be
code:
Name "Test"
OutFile "Test-Setup.exe"

ComponentText " "

Section "Section 1"
MessageBox MB_OK "Section 1"
SectionEnd

SectionDivider " divider "

Section "Section 2"
MessageBox MB_OK "Section 2"
SectionEnd



Section 2 will be executed even if it's unchecked an if it's checked it will be executed twice. Leaving the divider, all worked fine.

~ Florian
F. Heidenreich is offline   Reply With Quote
Old 15th January 2002, 19:47   #5
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
I changed the following if statement in script.cpp line 729:

if (secname[0]=='-')
{
if (!n)
{
ERROR_MSG("Error: SectionDivider cannot be first section\n");
return PS_ERROR;
}
build_cursection=NULL;
entry ent={EW_RET,};
cur_entries->add(&ent,sizeof(entry));
build_header.common.num_entries++;
}

Now all seems well.

Robert
rainwater is offline   Reply With Quote
Old 15th January 2002, 19:53   #6
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Sorry, that is build.cpp not script.cpp
rainwater is offline   Reply With Quote
Old 17th January 2002, 16:31   #7
MailmanHS
Junior Member
 
Join Date: Jan 2002
Posts: 3
Thanks rainwater! That worked great.
MailmanHS is offline   Reply With Quote
Old 17th January 2002, 17:38   #8
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Wink

Now, if Justin could only update the release soon before people go crazy trying to figure out why the installer is not working.
rainwater is offline   Reply With Quote
Old 22nd January 2002, 21:43   #9
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
*bump*

Just wanted to bump this topic to make sure it doesnt get lost.
rainwater is offline   Reply With Quote
Old 24th January 2002, 17:16   #10
0mar
Registered User
 
Join Date: Jan 2002
Posts: 30
Thank goodness for these forums!

(Not to mention the many thanks to Justin and contributors like Michael, for NSIS)

I would doubtlessly have spent many (frustrating) hours wondering why my installer was messed up if not for this info.

I have developed a LiteStep installer using NSIS 1.67 and I would really like to upgrade to 1.94 or any newer versions that come out.

I'm wondering - as long as I don't use dividers in my installer will I be fine...? That's what the posts above seem to indicate, but I'd just like to be certain before making the jump from 1.67 to 1.94.

Any other bugs in 1.94 I should watch out for?

Thanks in advance.
0mar is offline   Reply With Quote
Old 24th January 2002, 17:31   #11
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Yes, its just a problem with using section dividers. There aren't any other major bugs that I known about. If you really want to use section dividers, I can send you a fixed version.
rainwater is offline   Reply With Quote
Old 24th January 2002, 18:32   #12
0mar
Registered User
 
Join Date: Jan 2002
Posts: 30
Thank you rainwater!

I'm glad to hear that (as far as you know) there aren't any other major concerns with 1.94.

And I gladly accept your generous offer - I would love to have your version with the build.cpp fix.
0mar 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