Hi,
I was browsing for a JRE checker/installer and found the one online at:
[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
Help with Java JRE installer as shown online
4 posts
Re: Help with Java JRE installer as shown online
Section "Start menu shortcuts" SecCreateShortcut.Exactly. Quotes are used to write strings that contain spaces. So everything between the quotes belongs to one string.
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?You can probably use SetSectionFlags?
(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.
Re: Re: Help with Java JRE installer as shown online
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
Originally posted by MSGHi, so does that mean that the second parameter is the name of the Section? What is the point of the string?
Exactly. Quotes are used to write strings that contain spaces. So everything between the quotes belongs to one string.
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.
You can probably use SetSectionFlags?
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.
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.
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
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
Re: Re: Re: Help with Java JRE installer as shown online
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.)
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.)