Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 16th January 2007, 22:26   #1
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
How to code a page with "minimal" and "full" install options

Hi, I'm trying to create an app that has a custom page with two options (icons?); "minimal install" and "full install" - similar to a Microsoft Office type of installation. Depending on which the user selects, I'd like to call the appropriate code. Can anyone give me a brief explanantion of how to do this - I've tried searching but aren't really sure what I'm looking for!. Thanks
drod is offline   Reply With Quote
Old 16th January 2007, 22:31   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
I guess by that you mean that you don't wish to show a components page that it may be customized to show only minimal and full install types, right?
Did you already set up the custom page or we're talking start from scratch?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 16th January 2007, 22:43   #3
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
Hi, yes, that's correct - so when the app starts it would go to this "selection page". Once I knew what type of install they require I can then present pages that will have different type questions. For example the "full" one will have some more text fields that will contain paths to progs only available in the full release.

I've not set any custom pages up yet as I'm still trying to plan/workout exactly what I need to do!
drod is offline   Reply With Quote
Old 16th January 2007, 22:52   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
briefly,
you'd need to get your self familiar with InstallOptions by examining the included examples up to the point that you'd be able to design a custom page and add the desired controls.
mainly you'd need 2 grouped radio buttons one for full install and the other for minimal.
also, you need to define your sections as optional with /o switch. in custom page's leave function you're getting user's choice and accordingly you're enabling sections with SectionSetFlag.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 16th January 2007, 23:01   #5
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
great stuff - that's exactly the info I need; at least now I know the sequence and where to look. Thanks for that!
drod is offline   Reply With Quote
Old 16th January 2007, 23:13   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
you're welcome!
give me a break and i'll show you an example

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 16th January 2007, 23:26   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
compile and execute the following example and see the difference in log window when you choose different install types :)
code:
Name "My Application"
OutFile 'test.exe'
ShowInstDetails show
LicenseData '${NSISDIR}\License.txt'
LicenseBkColor 0xFFFFFF
InstallDir '$PROGRAMFILES\$(^name)'

Page License
Page Custom customcreate customleave
Page Directory
Page InstFiles

Section "main app" sec01 ;executed only for minimal install
setoutpath '$INSTDIR'
SectionEnd

Section /o "additional files" sec02
SetOutpath '$APPDATA'
sectionend

section /o "common files" sec03
setoutpath '$COMMONFILES'
sectionend

function customcreate
push $1
InstallOptions::Dialog '$PLUGINSDIR\custom.ini'
pop $1
Pop $1
functionend

function customleave
ReadINIStr $1 '$PLUGINSDIR\custom.ini' 'field 1' 'state'
Strcmp $1 '1' end
SectionSetFlags ${sec02} 1
SectionSetFlags ${sec03} 1
end:
functionend

function .onInit
InitPluginsDir
GetTempFileName $0
Rename $0 '$PLUGINSDIR\custom.ini'

WriteINIStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '2'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'type' 'radiobutton'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'left' '20'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'right' '-20'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'top' '20'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'bottom' '32'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'Text' 'minimal install'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'state' '1'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 1' 'flags' 'group'

WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'type' 'radiobutton'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'left' '20'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'right' '-20'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'top' '40'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'bottom' '52'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'Text' 'full install'
WriteINIStr '$PLUGINSDIR\custom.ini' 'field 2' 'state' '0'
functionend


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 17th January 2007, 04:03   #8
Swapan Das
Senior Member
 
Join Date: Nov 2005
Location: Kolkata (Calcutta),India
Posts: 106
Red Wine you've provided a great working example! I've even added another option 'Typical' to it.

And Drod I must thank you for asking such a good and more precisely real-life project Question.

Red Wine is just doing great job. By the way where is Bruno?
Swapan Das is offline   Reply With Quote
Old 17th January 2007, 09:19   #9
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
Hi Red Wine. Thanks for all the help and especially the code example - it would have taken me ages to get to that!

I've just got back on line so will start to work through and make sense of it.
drod is offline   Reply With Quote
Old 18th January 2007, 15:06   #10
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
stop that.

there's a faaaaaaare more easy way than this.

use the normal components page and use "InstType" settings.

for every section you can set:

PHP Code:
InstType "Full"
InstType "Minimal"

Section test testid
SectionIn 1 
#section is in installtype Full only
SectionEnd

Section test2 testid2
SectionIn 1 2 
#section is in installtype Full and Minimal
SectionEnd 
you also can use sections without using SectionIn, they then can only be selected in "Custom" InstType (which is always predefined, see NSIS doc, chapter 4.8.1.24 InstType.
Comm@nder21 is offline   Reply With Quote
Old 18th January 2007, 15:28   #11
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
stop that.
I assume this is addressed to me right?
Stop what?
What exactly is bothering you and I'm supposed to stop it?
What is your problem anyway, unless you were blind you would seen above that I've already asked drod why not a components page.
Sorry if when I post it bothers you, I'm not posting on threads that you have opened, I'd never do I promise, but I can't do something beyond this because I intend to keep posting, so you'd have to deal with your problem!

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 18th January 2007, 16:41   #12
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
well, this was in no wy ment agressive, plz do not missunderstand this

it was rather ment that you two are discussing about quite a biiig and complicated solution. i just meant you should not waste so much time with installoptions before trying out nsis' included functions


sorry again, if you thought i was attacking you.
i appreciate how you're helping ppl in this forums, don't take it personally.
Comm@nder21 is offline   Reply With Quote
Old 18th January 2007, 17:06   #13
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
Originally posted by Comm@nder21
well, this was in no wy ment agressive, plz do not missunderstand this

it was rather ment that you two are discussing about quite a biiig and complicated solution. i just meant you should not waste so much time with installoptions before trying out nsis' included functions


sorry again, if you thought i was attacking you.
i appreciate how you're helping ppl in this forums, don't take it personally.
Regarding to my self, I like to "waste" my time keep trying with NSIS, and I also like to share this "time wasting" with others, but only when they have request this share, so you'd better avoid reading my posts if you wish to save your time.
Last and least. When I'm able, I like to welcome new users who asking for help related to NSIS, by the mean to show them, how great, and far beyond a typical installation system, stands this incredible scriptable system.
That's all.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 18th January 2007, 17:16   #14
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
i do too, but i also always try to find just any solution.

so the first that comes to my mind will be taken, except it will probably take more time to implement it than to think about a more simple one.

and yes, i often just overfly your posts, but this is what i do with all forum posts, if i do not need the exact knowledge at the moment and just a hint what all is about.
Comm@nder21 is offline   Reply With Quote
Old 18th January 2007, 17:31   #15
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Dealing with you here? That's the real waste of time
I do not intend to waste my time here, nor I intend to control what I'm going to write when I'm answering to user's request, taking in account that you might not approve my post

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 18th January 2007, 19:56   #16
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
hey, hey

at least i am still dealing with you and do NOT see that as a waste of time

irc is a waste of time, yes but nevertheless its great fun... you ought to come there sometime, then we could continue such useless discussions
Comm@nder21 is offline   Reply With Quote
Old 19th January 2007, 09:31   #17
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
I have serious problems to browse the forum since last evening! Who knows what's going on...
Anyway... comm@nder21 see my new signature

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 19th January 2007, 19:27   #18
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
I saw that signature and can't figure out what it means in English!

Maiden castle?? absolutely no idea.

"not willing to defeat the human stupidity"?? = unwilling to attempt to conquer human stupidity? I don't know. Oh well, I guess it's just more drek the internet floated my way.
demiller9 is offline   Reply With Quote
Old 19th January 2007, 20:05   #19
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
@demiller9 thanks for the help with english,
defeat is wrong expression? should I change it? I do not mean conquer, I mean something like 'try to deal with'...
Maiden castle = unbeatable castle, also wrong?

edit:
done, removed until i find the correct expressions, often I use a dictionary to translate my expressions, seems the translation is not successful all the time, or my expressions are too complicated to be translated correctly

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Last edited by Red Wine; 19th January 2007 at 20:31.
Red Wine is offline   Reply With Quote
Old 19th January 2007, 20:53   #20
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
@Red Wine - We're getting off topic here, but...
I think (after your last post) perhaps the 'maiden castle' might be an 'invincible fortress'? I don't recall the exact signature now, so its hard to say how to improve it.

I realize English isn't the native language for everyone, and I thank everyone for making the effort to use it.

Don
demiller9 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