Old 23rd October 2009, 10:52   #1
mark.bury
Junior Member
 
Join Date: Oct 2009
Posts: 2
Help with Java JRE installer as shown online

Hi,

I was browsing for a JRE checker/installer and found the one online at:

http://nsis.sourceforge.net/New_inst...ing_jre.ini%29

[nsis . sourceforge . net / New_installer_with_JRE_check]

(I have looked at this forum for similar questions but lots of the links to answers are edited out)

the thing is in the code it mentions:

MustInstallJRE:
Exch $0 ; $0 now has the installoptions page return value
; Do something with return value here
Pop $0 ; Restore $0
StrCpy $InstallJRE "yes"
Return

obviosly the "do something with return value here" is supposed to call the section to do the install:

There is a section called:

Section -installjre jre.

I have looked online at the documentation and I'm left a bit unsure.

The doc says that the layout for sections are:

Section [name] [section_index_output]

but i have other sections that seem to follow a different layout of:

Section "Start menu shortcuts" SecCreateShortcut.

What is the difference with quotes? (it looks like the name is the second value)

And if possible how do I call the installjre section?

Many Thanks.

Mark
mark.bury is offline   Reply With Quote
Old 23rd October 2009, 11:25   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Re: Help with Java JRE installer as shown online

Quote:
Section "Start menu shortcuts" SecCreateShortcut.
What is the difference with quotes? (it looks like the name is the second value)
Exactly. Quotes are used to write strings that contain spaces. So everything between the quotes belongs to one string.

Quote:
And if possible how do I call the installjre section?
You can probably use SetSectionFlags?
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.13

Quote:
(I have looked at this forum for similar questions but lots of the links to answers are edited out)
To read those 'URL submitted by user' links, simply click the Quote button on that post - you'll see the URL in the text field.
MSG is offline   Reply With Quote
Old 23rd October 2009, 12:47   #3
mark.bury
Junior Member
 
Join Date: Oct 2009
Posts: 2
Re: Re: Help with Java JRE installer as shown online

Quote:
Originally posted by MSG
Exactly. Quotes are used to write strings that contain spaces. So everything between the quotes belongs to one string.
Hi, so does that mean that the second parameter is the name of the Section? What is the point of the string?

Quote:

You can probably use SetSectionFlags?
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.13
I'm new to NSIS but have used other programming languages. Can you not call a section without a method instruction (i.e. the SectionSetFlags)? Sorry if this is a stupid question.

Quote:

To read those 'URL submitted by user' links, simply click the Quote button on that post - you'll see the URL in the text field.
Thanks, I did find an old post that used the same code I found and had a similar un-answered question but that was last year.
http://forums.winamp.com/showthread....&highlight=jre

I have attached the file i'm working on and the line number i'm having trouble with is 376.


Thanks for the quick responce,
Mark
Attached Files
File Type: nsi txt4emis.nsi (17.6 KB, 126 views)
mark.bury is offline   Reply With Quote
Old 23rd October 2009, 19:45   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Re: Re: Re: Help with Java JRE installer as shown online

Quote:
Hi, so does that mean that the second parameter is the name of the Section? What is the point of the string?
You appear to be confused about what the purpose of a section is.

Sections are the separate components that the user can select or deselect for installation. Like, when you install winamp, you can choose to install CD or wmv support, or various other plugins. Each option on that Components page is a section in the installer script. (In your script there doesn't appear to be a Components page, but this doesn't change the behaviour of sections of course.)

This is why sections cannot be 'called' manually. They are executed automatically (if they were enabled by the user on the Components page), as soon as the actual installation process begins. So what you need to do is use SectionSetFlags to enable or disable the section, so that it will or will not be installed.

(note: Because sections are shown on the Components page, they have a name parameter. The name is what the section will be listed as, on the Components page.)
MSG 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