Archive: Custom Page Install


Custom Page Install
  Is it possible to use custom pages to install stuff?

If you have two radio buttons on a page, if one is seclected it installs one item, or if the other is select it installs a different item.

I only ask as I have tried this but even if one or the other radio button is selected it still installs both items

Can this be solved, if so how?

Also I was hoping to have two cutome pages doing the same thing on each but with the option to install diffeent items

Oh I didn't want to use the components page for this either

Thanks

(Oh this is a little of topic but
Also how do you use the Attach file option when posting on here?
But please this isn't my main question as I can soon upload stuff and attach it via link.)


In the 'Section' which does the actual installation (i.e. the one that copies the files to the installation folder, etc), check the status of the radio buttons and take appropriate action. In other words, if radio button 1 was selected, install item 1 otherwise install item 2.


Ok I'm still having problems

I've tried to adapt the Install Options script to what I want

but its still not working

I select one or the other and still both of them are installed

I have attached that full script and the basic script,

If someone could take a look and show me where I'm going wrong I would be grateful

-Tony

Basic Script

Full Script

On and before you mention it :) I know I should replce the uninstall delet strings with $INSTDIR but it just doesn't delete half the stuff.


I've had a look at the "Basic" script but I'm not sure what you are trying to do.

Each of the four sections has an empty name, this means that the section will be a hidden one which will always be installed. This is why you do not see any components listed when the components page appears (and why everything gets installed).

If you give each section a name (eg Section "One" sec1) then it will appear in the components page (as "One", "Two", etc) and the user can tick the box next to the component name to select it for installation. So the components page can be used to select any combination of these four sections.

From your earlier message, I assume that the Ion_Cannon_Option and Hangar_Option custom pages have radio buttons and you want to use these in some way to control what gets installed.

Could you explain a bit more about what you want the script to do?

Do you want some sections to always be installed?

If one section is selected, do you want to automatically select another (or disable another)?


I didn't really want them in the components page

That's one reason for no names, I saw this in another forum thread, so I might be wrong, more than likely :(

Yes your right about the radio buttons, what I'm trying to do is have a two custom pages, with two options.

1st option I want to install a certain item or items and disable the 2nd option and visa versa

Same goes for the other custom page

So you can only select one option on each page then install the selected items.

hope that makes sence


Anyone? please :)


To section have a name, and do not appear in the components page, put the "-" before the name. I.e.:

Section "-Any Name"

1st option I want to install a certain item or items and disable the 2nd option and visa versa
Read the State of the Radiobuttons in the two pages. Use the code below:

(When IOPage1.ini is the name of the INI file you are using for the page, Field #1 and #2 are the numbers of the radiobuttons fields, as #1 the first and #2 the second)

ReadINIStr$0 "IOPage1.ini" "Field #1" "State"

>StrCmp $0 1 0 Radiobutton2

# Code want to run when the radiobutton1 was been selected

>Radiobutton2:
>ReadINIStr $0 "IOPage1.ini" "Field #2" "State"
>StrCmp $0 1 0 Radiobutton2End

# Code want to run when the radiobutton2 was been selected

>Radiobutton2End:

># Normal Script Codes

Here is a simple demo script that uses the component page to do what I think you want. The user can select one of two 'Cannon' options and one of two 'Hanger' options.


Thanks to both of you for your time and patience :D

Pengyou before I use your script and remove the custom pages

I would like to ask deguix a few questions

1. Do I still need the SectionGetFlags script in the .oninit section? plus do I still need the .onSelChange section?

2. Does the # need to be in front of the field numbers? or is that just refering to the number itself.

I tried your code, it looks like this


Section "-Ion"
SetDetailsPrint none
ReadINIStr $0 "cannons.ini" "Field 1" "State"
StrCmp $0 1 0 Radiobutton2
SetOutPath "$INSTDIR\blah"
File "Ionblue\*.opt"
Radiobutton2:
ReadINIStr $0 "cannons.ini" "Field 2" "State"
StrCmp $0 1 0 Radiobutton2End
SetOutPath "$INSTDIR\blah"
File "Ionpurple\*.opt"
Radiobutton2End:
SectionEnd

SetOverwrite on
Section "-Hangar"
SetDetailsPrint none
ReadINIStr $0 "hangar.ini" "Field 1" "State"
StrCmp $0 1 0 Radiobutton2
SetOutPath "$INSTDIR\blah\blah"
File "HangarReb\*.opt"
Radiobutton2:
ReadINIStr $0 "hangar.ini" "Field 2" "State"
StrCmp $0 1 0 Radiobutton2End
SetOutPath "$INSTDIR\blah\blah"
File "HangarImp\*.opt"
Radiobutton2End:
SectionEnd


and the info in the ini files

Cannons.ini

[Settings]
NumFields=2

[Field 1]
Type=RadioButton
Text= Blue Ion Cannons
Left=10
Right=-10
Top=40
Bottom=50
State=1

[Field 2]
Type=RadioButton
Text= Purple Ion Cannons
Left=10
Right=-10
Top=60
Bottom=70
State=0


[Settings]
NumFields=2

[Field 1]
Type=RadioButton
Text= Rebel
Left=10
Right=-10
Top=40
Bottom=50
State=1

[Field 2]
Type=RadioButton
Text= Imperial
Left=10
Right=-10
Top=60
Bottom=70
State=0


but with either option selected nothing was installed, so I'm just wondering what I'm doing wrong

Again thanks for your time :)

TonyDS, Here is a revised demo script for you. Unlike the previous script, one of the five available options is always selected.

I used macros in the new script so it should be easier to make it work with different numbers of options.


Whoa thanks so much :)